-- +goose Up
-- create routes table
CREATE TABLE tracker_routes (
  id          SERIAL PRIMARY KEY,
  name        VARCHAR NOT NULL UNIQUE,
  path        VARCHAR NULL,
  component   VARCHAR NOT NULL,  -- path to component file
  layout      VARCHAR DEFAULT 'default',  -- 'default' | 'empty'
  meta        JSONB DEFAULT '{}',
  is_active   BOOLEAN DEFAULT true,
  sort_order  INT DEFAULT 0,
  parent_id INT NULL
);

INSERT INTO "public"."tracker_routes" ("name", "path", "component", "layout", "meta", "is_active", "sort_order", "parent_id") VALUES 
('root', '', '', 'default', '{"trans": "route.root"}', false, 0, 0),
('home', '', '@/views/HomeView.vue', 'default', '{"trans": "route.home"}', true, 0, 0),
('login', 'login', '@/views/LoginView.vue', 'empty', '{"guest":true}', true, 2, NULL),
('register', 'register', '@/views/RegisterView.vue', 'empty', '{"guest":true}', true, 3, NULL),
('password-recovery', 'password-recovery', '@/views/PasswordRecoveryView.vue', 'empty', '{"guest":true}', true, 4, NULL),
('reset-password', 'reset-password', '@/views/ResetPasswordView.vue', 'empty', '{"guest":true}', true, 5, NULL),
('verify-email', 'verify-email', '@/views/VerifyEmailView.vue', 'empty', '{"guest":true}', true, 6, NULL);


-- +goose Down

DROP TABLE IF EXISTS "public"."tracker_routes";

