This commit is contained in:
2026-03-23 14:04:53 +01:00
parent 528f12b065
commit 0f494d3abd
21 changed files with 515 additions and 264 deletions

View File

@@ -1,6 +1,6 @@
-- +goose Up
-- create routes table
CREATE TABLE IF NOT EXISTS b2b_tracker_routes (
CREATE TABLE IF NOT EXISTS b2b_routes (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL UNIQUE,
path VARCHAR(255) NULL,
@@ -13,11 +13,11 @@ CREATE TABLE IF NOT EXISTS b2b_tracker_routes (
CONSTRAINT fk_parent
FOREIGN KEY (parent_id)
REFERENCES b2b_tracker_routes(id)
REFERENCES b2b_routes(id)
ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT IGNORE INTO b2b_tracker_routes
INSERT IGNORE INTO b2b_routes
(name, path, component, layout, meta, is_active, sort_order, parent_id)
VALUES
('root', '', '', 'default', '{"trans": "route.root"}', 0, 0, 0),
@@ -30,5 +30,5 @@ VALUES
-- +goose Down
DROP TABLE IF EXISTS b2b_tracker_routes;
DROP TABLE IF EXISTS b2b_routes;