-- SYSTRONICS SQLite dump
BEGIN;
DROP TABLE IF EXISTS "activation_requests";
CREATE TABLE "activation_requests" ("id" integer primary key autoincrement not null, "user_id" integer, "login" varchar not null, "requested_at" datetime not null default (CURRENT_TIMESTAMP), "req_status" integer not null default ('0'), "conf_status" integer not null default ('0'), "product_id" integer, "product_name" varchar not null, "product_version" varchar, "product_type" varchar not null default (''), "submodules" text, "licensing_model" varchar, "eu_company" varchar not null, "eu_company_confirm" varchar, "eu_address" varchar not null, "eu_city" varchar not null, "eu_state" varchar not null default ('N/A'), "eu_postal_code" varchar not null default (''), "eu_country" varchar not null, "eu_phone" varchar not null, "eu_fax" varchar, "eu_email" varchar not null, "eu_website" varchar, "eu_contact_name" varchar not null, "eu_contact_email" varchar not null, "res_company" varchar not null default (''), "res_address" varchar not null default (''), "res_city" varchar not null default (''), "res_state" varchar not null default ('N/A'), "res_postal_code" varchar not null default (''), "res_country" varchar not null default (''), "res_phone" varchar not null default (''), "res_fax" varchar, "res_email" varchar not null default (''), "res_website" varchar, "res_contact_name" varchar not null default (''), "res_contact_email" varchar not null default (''), "distributor_name" varchar not null default (''), "sage_version" varchar not null, "sage_edition" varchar not null, "sage_serial" varchar not null, "agreed" integer not null default ('0'), "from_mobile" integer, "tp_special_offer" integer not null default ('0'), "show_autofill" integer not null default ('0'), "updated_by" varchar, "created_at" datetime, "updated_at" datetime, foreign key("product_id") references products("id") on delete set null on update no action, foreign key("user_id") references users("id") on delete cascade on update no action);
DROP TABLE IF EXISTS "applet_requests";
CREATE TABLE "applet_requests" ("id" integer not null, "transaction" text not null, "module" varchar not null, "custom_module" text, "first_name" varchar not null, "last_name" varchar not null, "email" varchar not null, "login" varchar not null, "request_type" integer, "requested_at" datetime, "user_id" integer, "created_at" datetime, "updated_at" datetime, foreign key("user_id") references "users"("id") on delete set null, primary key ("id"));
DROP TABLE IF EXISTS "audits";
CREATE TABLE "audits" ("id" integer primary key autoincrement not null, "user_id" integer, "action" varchar not null, "auditable_type" varchar, "auditable_id" integer, "old_values" text, "new_values" text, "ip_address" varchar, "user_agent" varchar, "created_at" datetime not null default CURRENT_TIMESTAMP, foreign key("user_id") references "users"("id") on delete set null);
DROP TABLE IF EXISTS "cache";
CREATE TABLE "cache" ("key" varchar not null, "value" text not null, "expiration" integer not null, primary key ("key"));
DROP TABLE IF EXISTS "cache_locks";
CREATE TABLE "cache_locks" ("key" varchar not null, "owner" varchar not null, "expiration" integer not null, primary key ("key"));
DROP TABLE IF EXISTS "campaign_list_recipients";
CREATE TABLE "campaign_list_recipients" ("id" integer primary key autoincrement not null, "campaign_list_id" integer not null, "email" varchar not null, "name" varchar, "company" varchar, "country" varchar, "created_at" datetime, "updated_at" datetime, foreign key("campaign_list_id") references "campaign_lists"("id") on delete cascade);
DROP TABLE IF EXISTS "campaign_lists";
CREATE TABLE "campaign_lists" ("id" integer primary key autoincrement not null, "name" varchar not null, "created_by" integer, "created_at" datetime, "updated_at" datetime, foreign key("created_by") references "users"("id") on delete set null);
DROP TABLE IF EXISTS "campaigns";
CREATE TABLE "campaigns" ("id" integer primary key autoincrement not null, "name" varchar not null, "subject" varchar not null, "html_body" text not null, "from_name" varchar, "from_email" varchar, "status" varchar not null default 'draft', "send_interval_sec" integer not null default '0', "campaign_list_id" integer, "created_by" integer, "scheduled_at" datetime, "sent_at" datetime, "created_at" datetime, "updated_at" datetime, foreign key("campaign_list_id") references "campaign_lists"("id") on delete set null, foreign key("created_by") references "users"("id") on delete set null);
DROP TABLE IF EXISTS "cms_page_blocks";
CREATE TABLE "cms_page_blocks" ("id" integer not null, "cms_page_id" integer not null, "descriptor" varchar, "content" text, "restype" integer not null default '0', "created_at" datetime, "updated_at" datetime, foreign key("cms_page_id") references "cms_pages"("id") on delete cascade, primary key ("id"));
DROP TABLE IF EXISTS "cms_pages";
CREATE TABLE "cms_pages" ("id" integer not null, "slug" varchar, "title" varchar not null, "lang" integer not null default '0', "source" varchar not null default 'manual', "is_published" tinyint(1) not null default '1', "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "content_categories";
CREATE TABLE "content_categories" ("id" integer not null, "name" varchar not null, "sort_order" integer not null default '0', "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "countries";
CREATE TABLE "countries" ("id" integer not null, "name" varchar not null, "iso_code" varchar, "mobile_iso_code" varchar, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "country_price_lists";
CREATE TABLE "country_price_lists" ("id" integer primary key autoincrement not null, "country" varchar not null, "price_list_code" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("price_list_code") references "price_lists"("code"));
DROP TABLE IF EXISTS "currencies";
CREATE TABLE "currencies" ("code" varchar not null, "name" varchar, "symbol" varchar not null, "decimals" integer not null default '2', "symbol_position" integer not null default '0', "thousands_separator" varchar not null default ',', "decimal_separator" varchar not null default '.', "long_description" varchar, "created_at" datetime, "updated_at" datetime, primary key ("code"));
DROP TABLE IF EXISTS "custom_project_categories";
CREATE TABLE "custom_project_categories" ("id" integer not null, "name" varchar not null, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "custom_project_category";
CREATE TABLE "custom_project_category" ("custom_project_id" integer not null, "custom_project_category_id" integer not null, foreign key("custom_project_id") references "custom_projects"("id") on delete cascade, foreign key("custom_project_category_id") references "custom_project_categories"("id") on delete cascade, primary key ("custom_project_id", "custom_project_category_id"));
DROP TABLE IF EXISTS "custom_projects";
CREATE TABLE "custom_projects" ("id" integer not null, "name" varchar not null, "country" varchar not null default '', "legacy_category" varchar, "sage_product" integer not null default '0', "released_at_unix" integer not null default '0', "description" varchar not null default '', "content" text not null, "value" numeric, "status" integer not null default '0', "legacy_created_at" datetime, "customer" varchar, "source_project" varchar, "sold_days" float, "actual_days" float, "sales_order" varchar, "keywords" varchar, "business_partner" varchar, "price_asis" numeric, "versions" varchar, "upgrades" varchar, "assurance" varchar, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "distributor_partner_links";
CREATE TABLE "distributor_partner_links" ("id" integer not null, "distributor_user_id" integer, "distributor_login" varchar not null, "partner_user_id" integer, "partner_login" varchar not null, "rule" varchar not null, "created_at" datetime, "updated_at" datetime, foreign key("distributor_user_id") references "users"("id") on delete set null, foreign key("partner_user_id") references "users"("id") on delete set null, primary key ("id"));
DROP TABLE IF EXISTS "distributor_territory";
CREATE TABLE "distributor_territory" ("user_id" integer not null, "territory_id" integer not null, foreign key("user_id") references "users"("id") on delete cascade, foreign key("territory_id") references "territories"("id") on delete cascade, primary key ("user_id", "territory_id"));
DROP TABLE IF EXISTS "download_assets";
CREATE TABLE "download_assets" ("id" integer not null, "relative_path" varchar not null, "title" varchar, "category" varchar, "storage_disk" varchar not null default 'legacy_downloads', "storage_path" varchar not null, "size_bytes" integer, "checksum" varchar, "is_internal" tinyint(1) not null default '0', "is_active" tinyint(1) not null default '1', "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "download_events";
CREATE TABLE "download_events" ("id" integer not null, "download_asset_id" integer, "legacy_file_id" integer, "user_id" integer, "login" varchar, "downloaded_at" datetime, "ip" varchar, "user_agent" text, "created_at" datetime, "updated_at" datetime, foreign key("user_id") references "users"("id") on delete set null, foreign key("download_asset_id") references "download_assets"("id") on delete set null, primary key ("id"));
DROP TABLE IF EXISTS "download_group_asset";
CREATE TABLE "download_group_asset" ("download_group_id" integer not null, "download_asset_id" integer not null, foreign key("download_group_id") references "download_groups"("id") on delete cascade, foreign key("download_asset_id") references "download_assets"("id") on delete cascade, primary key ("download_group_id", "download_asset_id"));
DROP TABLE IF EXISTS "download_groups";
CREATE TABLE "download_groups" ("id" integer not null, "name" varchar not null, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "download_notify_configs";
CREATE TABLE "download_notify_configs" ("id" integer not null, "sending_freq" integer not null default '0', "freq_type" integer not null default '3', "last_sent" datetime, "last_sent_status" integer not null default '0', "email_body" text, "email_subject" varchar, "email_to" varchar, "email_cc" varchar, "email_from" varchar, "date_range" integer, "date_range_value" integer, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "download_path_acls";
CREATE TABLE "download_path_acls" ("id" integer not null, "path" varchar not null, "ftype" integer not null default '0', "access_levels" text not null, "legacy_grplev" varchar, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "failed_jobs";
CREATE 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);
DROP TABLE IF EXISTS "feature_flags";
CREATE TABLE "feature_flags" ("id" integer primary key autoincrement not null, "key" varchar not null, "name" varchar not null, "description" varchar, "enabled" tinyint(1) not null default '0', "created_at" datetime, "updated_at" datetime);
INSERT INTO "feature_flags" ("id","key","name","description","enabled","created_at","updated_at") VALUES ('1','maintenance_mode_banner','Maintenance mode banner','Show a non-blocking maintenance notice in the admin shell.','0','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "feature_flags" ("id","key","name","description","enabled","created_at","updated_at") VALUES ('2','audit_verbose','Verbose audit logging','Include additional context fields in audit payloads when available.','0','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "feature_flags" ("id","key","name","description","enabled","created_at","updated_at") VALUES ('3','two_factor_optional','Optional staff 2FA','Allow staff to enroll TOTP 2FA under Profile. Enrolled users are challenged after login.','0','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "feature_flags" ("id","key","name","description","enabled","created_at","updated_at") VALUES ('4','hypercare_mode','Hypercare mode','Highlight the Hypercare admin screen and elevate ops visibility for two weeks post-cutover.','0','2026-08-28 05:56:32','2026-08-28 05:56:32');
DROP TABLE IF EXISTS "feedback_messages";
CREATE TABLE "feedback_messages" ("id" integer not null, "name" varchar not null, "email" varchar not null, "body" varchar not null, "topic" varchar not null, "submitted_at" datetime, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "homepage_pages";
CREATE TABLE "homepage_pages" ("id" integer primary key autoincrement not null, "payload" text, "created_at" datetime, "updated_at" datetime);
INSERT INTO "homepage_pages" ("id","payload","created_at","updated_at") VALUES ('1','{}','2026-08-28 05:55:55','2026-08-28 05:55:55');
DROP TABLE IF EXISTS "ip_blacklist";
CREATE TABLE "ip_blacklist" ("id" integer primary key autoincrement not null, "ip_address" varchar not null, "note" varchar, "is_active" tinyint(1) not null default '1', "created_at" datetime, "updated_at" datetime);
DROP TABLE IF EXISTS "job_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"));
DROP TABLE IF EXISTS "jobs";
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);
DROP TABLE IF EXISTS "legacy_identity_mappings";
CREATE TABLE "legacy_identity_mappings" ("id" integer primary key autoincrement not null, "legacy_source" varchar not null, "legacy_id" varchar not null, "legacy_access_level_id" integer, "legacy_group_id" integer, "mappable_type" varchar, "mappable_id" integer, "meta" text, "created_at" datetime, "updated_at" datetime);
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('1','accesslevels','16','16',NULL,NULL,NULL,'{"level_code":-1,"name":"Administrator"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('2','accesslevels','23','23',NULL,NULL,NULL,'{"level_code":10,"name":"Marketing"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('3','accesslevels','25','25',NULL,NULL,NULL,'{"level_code":20,"name":"Partner"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('4','accesslevels','35','35',NULL,NULL,NULL,'{"level_code":30,"name":"Sales & Marketing"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('5','accesslevels','26','26',NULL,NULL,NULL,'{"level_code":40,"name":"Systrotech Staff"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('6','accesslevels','30','30',NULL,NULL,NULL,'{"level_code":50,"name":"SYSTRONICS Staff"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('7','accesslevels','29','29',NULL,NULL,NULL,'{"level_code":60,"name":"SYSTRONICS Sales"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('8','accesslevels','31','31',NULL,NULL,NULL,'{"level_code":70,"name":"Distributor"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('9','accesslevels','32','32',NULL,NULL,NULL,'{"level_code":80,"name":"Accpac Implementation"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('10','accesslevels','33','33',NULL,NULL,NULL,'{"level_code":90,"name":"Generic"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('11','accesslevels','37','37',NULL,NULL,NULL,'{"level_code":100,"name":"Hr"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('12','accesslevels','36','36',NULL,NULL,NULL,'{"level_code":11,"name":"Mobile"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('13','accesslevels','34','34',NULL,NULL,NULL,'{"level_code":990,"name":"Arpy"}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('14','accessgrp','-1',NULL,'-1','App\\Domain\\Access\\Models\\Role','1','{"name":"Administrator","levels":[-1,70]}','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "legacy_identity_mappings" ("id","legacy_source","legacy_id","legacy_access_level_id","legacy_group_id","mappable_type","mappable_id","meta","created_at","updated_at") VALUES ('15','accessgrp','1',NULL,'1','App\\Domain\\Access\\Models\\Role','2','{"name":"Partner","levels":[20]}','2026-08-28 05:56:32','2026-08-28 05:56:32');
DROP TABLE IF EXISTS "mail_logs";
CREATE TABLE "mail_logs" ("id" integer primary key autoincrement not null, "campaign_id" integer, "template_key" varchar, "to_email" varchar not null, "subject" varchar, "status" varchar not null default 'queued', "error" text, "sent_at" datetime, "created_at" datetime, "updated_at" datetime, foreign key("campaign_id") references "campaigns"("id") on delete set null);
DROP TABLE IF EXISTS "migrations";
CREATE TABLE "migrations" ("id" integer primary key autoincrement not null, "migration" varchar not null, "batch" integer not null);
INSERT INTO "migrations" ("id","migration","batch") VALUES ('1','0001_01_01_000000_create_users_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('2','0001_01_01_000001_create_cache_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('3','0001_01_01_000002_create_jobs_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('4','2026_07_29_072652_create_permission_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('5','2026_07_29_080000_enhance_users_table_for_identity','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('6','2026_07_29_080100_add_legacy_columns_to_permission_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('7','2026_07_29_080200_create_audits_and_identity_mapping_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('8','2026_07_29_120000_create_settings_and_feature_flags_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('9','2026_07_29_140000_create_registration_blocked_domains_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('10','2026_07_29_150000_create_catalog_and_pricing_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('11','2026_07_29_160000_create_activation_requests_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('12','2026_07_29_170000_allow_duplicate_legacy_emails','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('13','2026_07_29_180000_preserve_legacy_orphan_references','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('14','2026_07_29_190000_preserve_legacy_price_row_ids','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('15','2026_07_29_200000_preserve_orphan_legacy_prices','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('16','2026_07_29_210000_create_downloads_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('17','2026_07_30_062614_create_personal_access_tokens_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('18','2026_07_30_100000_create_support_and_feedback_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('19','2026_07_30_120000_create_territories_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('20','2026_07_30_140000_create_cms_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('21','2026_07_30_150000_create_webinars_and_recruitment_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('22','2026_07_30_160000_create_communications_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('23','2026_07_30_170000_create_mobile_cms_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('24','2026_07_30_180000_create_crm_integration_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('25','2026_07_30_190000_create_ip_blacklist_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('26','2026_07_30_200000_create_applet_requests_and_sage_compat_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('27','2026_07_30_220000_add_two_factor_columns_to_users_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('28','2026_07_31_100000_create_product_page_sections_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('29','2026_07_31_120000_create_saleable_products_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('30','2026_07_31_140000_create_version_contents_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('31','2026_07_31_160000_add_download_asset_to_version_contents','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('32','2026_07_31_170000_create_release_pages_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('33','2026_08_03_120000_drop_mobile_cms_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('34','2026_08_03_120100_drop_recruitment_tables','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('35','2026_08_03_120200_remove_navigation_help_cms_pages','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('36','2026_08_27_120000_create_homepage_pages_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('37','2026_08_27_120100_add_tagline_to_products_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('38','2026_08_27_140000_create_navigation_menus_table','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('39','2026_08_27_150000_remove_testimonials','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('40','2026_08_28_120000_remove_awards','1');
INSERT INTO "migrations" ("id","migration","batch") VALUES ('41','2026_08_28_130000_remove_crm_integration','1');
DROP TABLE IF EXISTS "model_has_permissions";
CREATE TABLE "model_has_permissions" ("permission_id" integer not null, "model_type" varchar not null, "model_id" integer not null, foreign key("permission_id") references "permissions"("id") on delete cascade, primary key ("permission_id", "model_id", "model_type"));
DROP TABLE IF EXISTS "model_has_roles";
CREATE TABLE "model_has_roles" ("role_id" integer not null, "model_type" varchar not null, "model_id" integer not null, foreign key("role_id") references "roles"("id") on delete cascade, primary key ("role_id", "model_id", "model_type"));
DROP TABLE IF EXISTS "navigation_menus";
CREATE TABLE "navigation_menus" ("id" integer primary key autoincrement not null, "payload" text, "created_at" datetime, "updated_at" datetime);
INSERT INTO "navigation_menus" ("id","payload","created_at","updated_at") VALUES ('1','{}','2026-08-28 05:55:55','2026-08-28 05:55:55');
DROP TABLE IF EXISTS "office_holidays";
CREATE TABLE "office_holidays" ("id" integer not null, "office_id" integer, "name" varchar, "date_from" varchar, "date_to" varchar, "time_from" varchar, "time_to" varchar, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "password_reset_tokens";
CREATE TABLE "password_reset_tokens" ("email" varchar not null, "token" varchar not null, "created_at" datetime, primary key ("email"));
DROP TABLE IF EXISTS "permissions";
CREATE TABLE "permissions" ("id" integer primary key autoincrement not null, "name" varchar not null, "guard_name" varchar not null, "created_at" datetime, "updated_at" datetime, "legacy_access_level_id" integer, "legacy_level_code" integer, "legacy_source" varchar);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('1','admin.access','web','2026-08-28 05:56:31','2026-08-28 05:56:31',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('2','users.view','web','2026-08-28 05:56:31','2026-08-28 05:56:31',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('3','users.create','web','2026-08-28 05:56:31','2026-08-28 05:56:31',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('4','users.update','web','2026-08-28 05:56:31','2026-08-28 05:56:31',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('5','users.delete','web','2026-08-28 05:56:31','2026-08-28 05:56:31',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('6','users.reset_password','web','2026-08-28 05:56:31','2026-08-28 05:56:31',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('7','roles.view','web','2026-08-28 05:56:31','2026-08-28 05:56:31',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('8','roles.manage','web','2026-08-28 05:56:31','2026-08-28 05:56:31',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('9','audit.view','web','2026-08-28 05:56:31','2026-08-28 05:56:31',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('10','profile.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('11','settings.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('12','partners.view','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('13','partners.edit','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('14','partners.activate','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('15','partners.export','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('16','partners.resend_activation','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('17','acrequests.create','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('18','acrequests.view_own','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('19','acrequests.view_all','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('20','acrequests.update','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('21','acrequests.fulfill','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('22','acrequests.notify','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('23','acrequests.delete','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('24','applet_requests.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('25','downloads.view','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('26','downloads.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('27','downloads.reports','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('28','downloads.notify_config','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('29','prices.view','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('30','prices.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('31','catalog.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('32','compatibility.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('33','support.create','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('34','support.view_own','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('35','support.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('36','feedback.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('37','territories.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('38','distributors.view','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('39','distributors.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('40','webinars.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('41','webinars.register','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('42','content.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('43','custom_projects.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('44','campaigns.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('45','notifications.manage','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
INSERT INTO "permissions" ("id","name","guard_name","created_at","updated_at","legacy_access_level_id","legacy_level_code","legacy_source") VALUES ('46','analytics.view','web','2026-08-28 05:56:32','2026-08-28 05:56:32',NULL,NULL,NULL);
DROP TABLE IF EXISTS "personal_access_tokens";
CREATE TABLE "personal_access_tokens" ("id" integer primary key autoincrement not null, "tokenable_type" varchar not null, "tokenable_id" integer not null, "name" text not null, "token" varchar not null, "abilities" text, "last_used_at" datetime, "expires_at" datetime, "created_at" datetime, "updated_at" datetime);
DROP TABLE IF EXISTS "price_list_descriptions";
CREATE TABLE "price_list_descriptions" ("id" integer primary key autoincrement not null, "packaged_desc" text, "subscription_desc" text, "created_at" datetime, "updated_at" datetime);
DROP TABLE IF EXISTS "price_list_settings";
CREATE TABLE "price_list_settings" ("id" integer primary key autoincrement not null, "name" varchar not null, "value" varchar, "created_at" datetime, "updated_at" datetime);
DROP TABLE IF EXISTS "price_lists";
CREATE TABLE "price_lists" ("code" varchar not null, "rate" numeric not null default '1', "currency_code" varchar not null, "si_price" numeric not null default '0', "is_active" tinyint(1) not null default '1', "legacy_updated_at" datetime, "created_at" datetime, "updated_at" datetime, foreign key("currency_code") references "currencies"("code"), primary key ("code"));
DROP TABLE IF EXISTS "product_editions";
CREATE TABLE "product_editions" ("id" integer primary key autoincrement not null, "product_id" integer, "sage_edition" varchar not null default ('ALL'), "base_price" numeric not null default ('0'), "si_service_percent" numeric not null default ('0'), "include" tinyint(1) not null default ('0'), "hidden" tinyint(1) not null default ('0'), "part_number" varchar, "legacy_updated_at" datetime, "created_at" datetime, "updated_at" datetime, "legacy_product_id" integer, "saleable_product_id" integer, foreign key("product_id") references products("id") on delete cascade on update no action, foreign key("saleable_product_id") references "saleable_products"("id") on delete set null);
DROP TABLE IF EXISTS "product_page_sections";
CREATE TABLE "product_page_sections" ("id" integer primary key autoincrement not null, "product_code" varchar not null, "section_key" varchar not null, "title" varchar not null, "sort_order" integer not null default '0', "is_partner_only" tinyint(1) not null default '0', "body_html" text not null, "created_at" datetime, "updated_at" datetime);
DROP TABLE IF EXISTS "product_prices";
CREATE TABLE "product_prices" ("id" integer primary key autoincrement not null, "price_list_code" varchar not null, "product_edition_id" integer, "price" numeric not null default ('0'), "legacy_updated_at" datetime, "created_at" datetime, "updated_at" datetime, "legacy_id" integer, "legacy_product_edition_id" integer, foreign key("product_edition_id") references product_editions("id") on delete cascade on update no action, foreign key("price_list_code") references price_lists("code") on delete no action on update no action);
DROP TABLE IF EXISTS "products";
CREATE TABLE "products" ("id" integer not null, "code" varchar not null, "legacy_prefix" varchar, "name" varchar not null, "pack_type" integer not null default '0', "is_subscription" tinyint(1) not null default '0', "parent_product_id" integer, "is_active" tinyint(1) not null default '1', "created_at" datetime, "updated_at" datetime, "tagline" varchar, primary key ("id"));
DROP TABLE IF EXISTS "registration_blocked_domains";
CREATE TABLE "registration_blocked_domains" ("id" integer primary key autoincrement not null, "domain" varchar not null, "list" varchar not null default 'restricted_mails', "is_active" tinyint(1) not null default '1', "created_at" datetime, "updated_at" datetime);
DROP TABLE IF EXISTS "release_pages";
CREATE TABLE "release_pages" ("id" integer primary key autoincrement not null, "slug" varchar not null, "title" varchar not null, "subtitle" varchar, "section_title" varchar not null default 'Currently Shipping', "items" text, "is_published" tinyint(1) not null default '1', "created_at" datetime, "updated_at" datetime);
INSERT INTO "release_pages" ("id","slug","title","subtitle","section_title","items","is_published","created_at","updated_at") VALUES ('1','2026','Version 2026 Releases','Sage 300 release line 2026 · build 7.3','Currently Shipping','[{"code":"gg","name":"Gulf Utilities for Payroll 2026E","slogan":"The Missing Link For Sage 300 Payroll!","date":"March 6, 2026","icon":"\\/legacy\\/img\\/32\\/GG_s.jpg"},{"code":"cw","name":"CashWorks Pro & Lite 2026F","slogan":"Comprehensive Cash Management!","date":"February 20, 2026","icon":"\\/legacy\\/img\\/32\\/CW_s.jpg"},{"code":"jx","name":"PJC Security 2026B","slogan":"Advanced Security Solutions for PJC Contracts!","date":"February 9, 2026","icon":"\\/legacy\\/img\\/32\\/jx_s.jpg"},{"code":"rg","name":"Intercompany Utilities 2026F","slogan":"Consolidate Intercompany Information & Transact Across Multiple Companies!","date":"January 30, 2026","icon":"\\/legacy\\/img\\/32\\/rg_s.jpg"},{"code":"bu","name":"BACCPAC Pro & Lite 2026C","slogan":"An Accountant\\u2019s Tool For Sage 300 Backup!","date":"January 13, 2026","icon":"\\/legacy\\/img\\/32\\/BU_s.jpg"},{"code":"ks","name":"SYSTRONICS Stock Aging Report 2026C","slogan":"View And Print Aging Of Stock!","date":"December 12, 2025","icon":"\\/legacy\\/img\\/32\\/ks.bmp"},{"code":"ao","name":"AR-AP Settlements 2026H","slogan":"Settle A\\/R Transactions With A\\/P Transactions!","date":"November 28, 2025","icon":"\\/legacy\\/img\\/32\\/AO_s.jpg"},{"code":"da","name":"Document Attachment Applets 2026F","slogan":"Attach Scanned Documents & Rich Text To Multiple Sage 300 Transactions!","date":"November 28, 2025","icon":"\\/legacy\\/img\\/32\\/da_s.jpg"},{"code":"fe","name":"Field Extender Enterprise 2026F","slogan":"Add Fields & Files Anywhere In Sage 300!","date":"November 28, 2025","icon":"\\/legacy\\/img\\/32\\/fe_s.jpg"},{"code":"kf","name":"Cashflow Forecasting 2026H","slogan":"Your Insight Into Effective Cash Management!","date":"November 17, 2025","icon":"\\/legacy\\/img\\/32\\/KF_s.jpg"},{"code":"rd","name":"Revenue and Expense Deferrals 2026E","slogan":"Amortize Transactions Over Service Contract Periods!","date":"November 6, 2025","icon":"\\/legacy\\/img\\/32\\/RD_s.jpg"},{"code":"tp","name":"ToolPac\\u2013Subledger Reconciliation Toolsets 2026G","slogan":"Get Rid Of Incomplete Transactions In Your Daily Accounting!","date":"October 16, 2025","icon":"\\/legacy\\/img\\/32\\/tp_s.jpg"}]','1','2026-08-28 05:55:55','2026-08-28 05:55:55');
DROP TABLE IF EXISTS "role_has_permissions";
CREATE TABLE "role_has_permissions" ("permission_id" integer not null, "role_id" integer not null, foreign key("permission_id") references "permissions"("id") on delete cascade, foreign key("role_id") references "roles"("id") on delete cascade, primary key ("permission_id", "role_id"));
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('1','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('2','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('3','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('4','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('5','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('6','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('7','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('8','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('9','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('10','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('11','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('12','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('13','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('14','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('15','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('16','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('17','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('18','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('19','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('20','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('21','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('22','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('23','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('24','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('25','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('26','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('27','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('28','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('29','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('30','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('31','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('32','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('33','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('34','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('35','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('36','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('37','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('38','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('39','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('40','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('41','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('42','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('43','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('44','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('45','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('46','1');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('10','2');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('17','2');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('18','2');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('29','2');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('25','2');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('33','2');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('34','2');
INSERT INTO "role_has_permissions" ("permission_id","role_id") VALUES ('41','2');
DROP TABLE IF EXISTS "roles";
CREATE TABLE "roles" ("id" integer primary key autoincrement not null, "name" varchar not null, "guard_name" varchar not null, "created_at" datetime, "updated_at" datetime, "legacy_group_id" integer, "legacy_source" varchar);
INSERT INTO "roles" ("id","name","guard_name","created_at","updated_at","legacy_group_id","legacy_source") VALUES ('1','administrator','web','2026-08-28 05:56:32','2026-08-28 05:56:32','-1','accessgrp');
INSERT INTO "roles" ("id","name","guard_name","created_at","updated_at","legacy_group_id","legacy_source") VALUES ('2','partner','web','2026-08-28 05:56:32','2026-08-28 05:56:32','1','accessgrp');
DROP TABLE IF EXISTS "rollup_items";
CREATE TABLE "rollup_items" ("id" integer not null, "body" text not null, "is_published" tinyint(1) not null default '0', "sort_order" integer not null default '0', "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "sage_compatibilities";
CREATE TABLE "sage_compatibilities" ("id" integer not null, "product_prefix" varchar not null, "product_version" varchar, "sage_version" varchar, "is_currently_supported" tinyint(1) not null default '0', "is_configured" tinyint(1) not null default '0', "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "saleable_products";
CREATE TABLE "saleable_products" ("id" integer not null, "name" varchar not null, "line2" varchar, "prefix" varchar not null, "versions" varchar, "is_subscription_sku" tinyint(1) not null default '0', "legacy_updated_at" datetime, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "sessions";
CREATE 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"));
DROP TABLE IF EXISTS "settings";
CREATE TABLE "settings" ("id" integer primary key autoincrement not null, "group" varchar not null, "key" varchar not null, "value" text, "type" varchar not null default 'string', "created_at" datetime, "updated_at" datetime);
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('1','general','app_name','SYSTRONICS','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('2','general','support_email','support@systronics.com','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('3','general','timezone','UTC','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('4','email','from_address','noreply@systronics.com','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('5','email','from_name','SYSTRONICS','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('6','email','reply_to','support@systronics.com','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('7','application','users_page_size','25','int','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('8','application','session_note','Operations platform','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('9','analytics','mode','none','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('10','analytics','ga_property_id','','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('11','analytics','ga_embed_url','','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('12','analytics','retention_days','90','int','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('13','security','two_factor_note','Optional staff TOTP 2FA — enable feature flag two_factor_optional, then enroll under Profile → 2FA.','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('14','cutover','cutover_at','','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('15','cutover','hypercare_started_at','','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('16','cutover','hypercare_ends_at','','string','2026-08-28 05:56:32','2026-08-28 05:56:32');
INSERT INTO "settings" ("id","group","key","value","type","created_at","updated_at") VALUES ('17','cutover','legacy_redirects_enabled','1','bool','2026-08-28 05:56:32','2026-08-28 05:56:32');
DROP TABLE IF EXISTS "special_days";
CREATE TABLE "special_days" ("id" integer not null, "office_id" integer, "name" varchar, "date" varchar, "time_from" varchar, "time_to" varchar, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "subscription_editions";
CREATE TABLE "subscription_editions" ("id" integer primary key autoincrement not null, "product_id" integer, "sage_edition" varchar not null, "base_price" numeric not null default ('0'), "hidden" tinyint(1) not null default ('0'), "part_number" varchar, "legacy_updated_at" datetime, "created_at" datetime, "updated_at" datetime, "legacy_product_id" integer, "saleable_product_id" integer, foreign key("product_id") references products("id") on delete cascade on update no action, foreign key("saleable_product_id") references "saleable_products"("id") on delete set null);
DROP TABLE IF EXISTS "subscription_nudge_preferences";
CREATE TABLE "subscription_nudge_preferences" ("id" integer not null, "login" varchar not null, "user_id" integer, "last_notify_unix" integer not null default '0', "decision" integer not null default '0', "created_at" datetime, "updated_at" datetime, foreign key("user_id") references "users"("id") on delete set null, primary key ("id"));
DROP TABLE IF EXISTS "subscription_prices";
CREATE TABLE "subscription_prices" ("id" integer primary key autoincrement not null, "price_list_code" varchar not null, "subscription_edition_id" integer, "price" numeric not null default ('0'), "legacy_updated_at" datetime, "created_at" datetime, "updated_at" datetime, "legacy_id" integer, "legacy_subscription_edition_id" integer, foreign key("subscription_edition_id") references subscription_editions("id") on delete cascade on update no action, foreign key("price_list_code") references price_lists("code") on delete no action on update no action);
DROP TABLE IF EXISTS "support_attachments";
CREATE TABLE "support_attachments" ("id" integer primary key autoincrement not null, "support_ticket_id" integer not null, "storage_disk" varchar not null default 'local', "storage_path" varchar not null, "original_name" varchar not null, "size" integer not null default '0', "mime" varchar, "created_at" datetime, "updated_at" datetime, foreign key("support_ticket_id") references "support_tickets"("id") on delete cascade);
DROP TABLE IF EXISTS "support_tickets";
CREATE TABLE "support_tickets" ("id" integer not null, "user_id" integer, "login" varchar not null, "submitted_at" datetime, "is_project" tinyint(1) not null default '0', "product_name" varchar not null, "product_version" varchar, "submodules" varchar, "product_sp" varchar, "product_build" varchar not null default '', "sage_edition" varchar not null default '', "db_info" varchar not null, "os_info" varchar not null, "description" varchar, "sage_deployment" varchar not null default '', "contact_email" varchar not null, "third_party_apps" varchar, "sage_applications" varchar not null default '', "case_number" varchar, "contact_first_name" varchar not null default '', "contact_last_name" varchar not null default '', "end_user" varchar, "business_partner" varchar, "environment" text, "created_at" datetime, "updated_at" datetime, foreign key("user_id") references "users"("id") on delete set null, primary key ("id"));
DROP TABLE IF EXISTS "territories";
CREATE TABLE "territories" ("id" integer not null, "name" varchar not null, "legacy_cnt_id" varchar, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "territory_country";
CREATE TABLE "territory_country" ("territory_id" integer not null, "country_id" integer not null, foreign key("territory_id") references "territories"("id") on delete cascade, foreign key("country_id") references "countries"("id") on delete cascade, primary key ("territory_id", "country_id"));
DROP TABLE IF EXISTS "unsubscribes";
CREATE TABLE "unsubscribes" ("id" integer primary key autoincrement not null, "email" varchar not null, "user_id" integer, "source" varchar not null default 'link', "reason" varchar, "created_at" datetime, "updated_at" datetime, foreign key("user_id") references "users"("id") on delete set null);
DROP TABLE IF EXISTS "user_activities";
CREATE TABLE "user_activities" ("id" integer primary key autoincrement not null, "user_id" integer not null, "event" varchar not null, "ip_address" varchar, "user_agent" varchar, "created_at" datetime not null default CURRENT_TIMESTAMP, foreign key("user_id") references "users"("id") on delete cascade);
DROP TABLE IF EXISTS "user_products";
CREATE TABLE "user_products" ("id" integer primary key autoincrement not null, "user_id" integer not null, "product_id" integer not null, "created_at" datetime, "updated_at" datetime, foreign key("user_id") references "users"("id") on delete cascade, foreign key("product_id") references "products"("id") on delete cascade);
DROP TABLE IF EXISTS "users";
CREATE TABLE "users" ("id" integer primary key autoincrement not null, "name" varchar not null, "email" varchar, "email_verified_at" datetime, "password" varchar not null, "remember_token" varchar, "created_at" datetime, "updated_at" datetime, "legacy_partner_id" varchar, "legacy_source" varchar, "login" varchar, "email_alt1" varchar, "email_alt2" varchar, "first_name" varchar, "last_name" varchar, "phone" varchar, "company" varchar, "address" varchar, "city" varchar, "state" varchar, "postal_code" varchar, "country" varchar, "website" varchar, "partner_status" varchar, "account_state" varchar not null default ('active'), "legacy_group_id" integer, "nickname" varchar, "mailing_preference" varchar, "beta_opt_in" tinyint(1) not null default ('0'), "price_updates" tinyint(1) not null default ('0'), "approved_price_update" varchar, "from_mobile" tinyint(1) not null default ('0'), "auth_token" varchar, "joined_at" datetime, "last_login_at" datetime, "deleted_at" datetime, "two_factor_secret" text, "two_factor_confirmed_at" datetime);
DROP TABLE IF EXISTS "version_contents";
CREATE TABLE "version_contents" ("id" integer primary key autoincrement not null, "sage_compatibility_id" integer, "content_category_id" integer, "download_title" varchar, "download_link" varchar, "icon" varchar, "coordinates" varchar, "access_level" integer, "tooltip" varchar, "details" text, "created_at" datetime, "updated_at" datetime, "download_asset_id" integer, foreign key("content_category_id") references content_categories("id") on delete set null on update no action, foreign key("sage_compatibility_id") references sage_compatibilities("id") on delete set null on update no action, foreign key("download_asset_id") references "download_assets"("id") on delete set null);
DROP TABLE IF EXISTS "webinar_registrations";
CREATE TABLE "webinar_registrations" ("id" integer not null, "webinar_id" integer not null, "email" varchar not null, "first_name" varchar not null, "last_name" varchar not null, "phone" varchar, "fax" varchar, "company" varchar, "address" varchar, "city" varchar, "state" varchar, "zip" varchar, "country" varchar, "partner_status" varchar, "registered_at" datetime, "gtw_status" integer, "created_at" datetime, "updated_at" datetime, foreign key("webinar_id") references "webinars"("id") on delete cascade, primary key ("id"));
DROP TABLE IF EXISTS "webinar_requests";
CREATE TABLE "webinar_requests" ("id" integer not null, "first_name" varchar not null, "last_name" varchar not null, "email" varchar not null, "product" varchar not null, "details" text, "requested_at" datetime, "login" varchar, "timezone" varchar, "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "webinar_series";
CREATE TABLE "webinar_series" ("id" integer not null, "title" varchar not null default '', "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "webinar_settings";
CREATE TABLE "webinar_settings" ("id" integer not null, "archive_series_no" integer not null default '0', "show_webinars" tinyint(1) not null default '1', "created_at" datetime, "updated_at" datetime, primary key ("id"));
DROP TABLE IF EXISTS "webinars";
CREATE TABLE "webinars" ("id" integer not null, "description" varchar not null default '', "scheduled_date" integer not null default '0', "scheduled_time" integer not null default '0', "timezone" varchar, "duration" double, "url" varchar, "phone" varchar, "meeting_id" varchar, "phone_access_code" varchar, "meeting_password" varchar, "series_id" integer, "session_no" integer, "provider_webinar_id" varchar, "product" varchar, "presenter" varchar, "is_configured" tinyint(1) not null default '0', "youtube_link" varchar, "created_at" datetime, "updated_at" datetime, foreign key("series_id") references "webinar_series"("id") on delete set null, primary key ("id"));
COMMIT;
