From 8e07daac66445f90617f4996e243abf6f30233af Mon Sep 17 00:00:00 2001 From: Marek Goc Date: Fri, 20 Mar 2026 14:57:50 +0100 Subject: [PATCH] fix migrations --- i18n/migrations/20260302163100_routes.sql | 14 +++++++------- i18n/migrations/20260302163122_create_tables.sql | 7 ------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/i18n/migrations/20260302163100_routes.sql b/i18n/migrations/20260302163100_routes.sql index 6369d6a..a2f41a7 100644 --- a/i18n/migrations/20260302163100_routes.sql +++ b/i18n/migrations/20260302163100_routes.sql @@ -6,16 +6,16 @@ CREATE TABLE IF NOT EXISTS b2b_tracker_routes ( path VARCHAR(255) NULL, component VARCHAR(255) NOT NULL COMMENT 'path to component file', layout VARCHAR(50) DEFAULT 'default' COMMENT "'default' | 'empty'", - meta JSON DEFAULT '{}' , + meta JSON DEFAULT '{}', is_active BOOLEAN DEFAULT TRUE, sort_order INT DEFAULT 0, - parent_id INT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + parent_id INT NULL, -ALTER TABLE b2b_tracker_routes - ADD CONSTRAINT fk_parent - FOREIGN KEY (parent_id) REFERENCES b2b_tracker_routes(id) - ON DELETE SET NULL; + CONSTRAINT fk_parent + FOREIGN KEY (parent_id) + REFERENCES b2b_tracker_routes(id) + ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; INSERT IGNORE INTO b2b_tracker_routes (name, path, component, layout, meta, is_active, sort_order, parent_id) diff --git a/i18n/migrations/20260302163122_create_tables.sql b/i18n/migrations/20260302163122_create_tables.sql index 168b7e8..6113dfe 100644 --- a/i18n/migrations/20260302163122_create_tables.sql +++ b/i18n/migrations/20260302163122_create_tables.sql @@ -113,13 +113,6 @@ CREATE UNIQUE INDEX IF NOT EXISTS uk_refresh_tokens_token_hash ON b2b_refresh_to CREATE INDEX IF NOT EXISTS idx_refresh_tokens_customer_id ON b2b_refresh_tokens (customer_id); --- insert sample admin user admin@ma-al.com/Maal12345678 - -INSERT IGNORE INTO b2b_customers (id, email, password, first_name, last_name, role, provider, provider_id, avatar_url, is_active, email_verified, email_verification_token, email_verification_expires, password_reset_token, password_reset_expires, last_password_reset_request, last_login_at, lang_id, country_id, created_at, updated_at, deleted_at) -VALUES - (1, 'admin@ma-al.com', '$2a$10$Owy9DjrS0l3Fz4XoOvh5pulgmOMqdwXmb7hYE9BovnSuWS2plGr82', 'Super', 'Admin', 'admin', 'local', '', '', 1, 1, NULL, NULL, '', NULL, NULL, NULL, 1, 1, '2026-03-02 16:55:10.252740', '2026-03-02 16:55:10.252740', NULL); -ALTER TABLE b2b_customers AUTO_INCREMENT = 1; - -- countries CREATE TABLE IF NOT EXISTS b2b_countries ( id INT AUTO_INCREMENT PRIMARY KEY,