From cfb6c6e3b7bf96a1b0214ff09bbfad2f10921f88 Mon Sep 17 00:00:00 2001 From: LydiaMuaCai Date: Thu, 7 Aug 2025 22:06:35 +0800 Subject: [PATCH] feat: add license migration file --- .../migration/000015_create_license_table.down.sql | 2 ++ .../migration/000015_create_license_table.up.sql | 13 +++++++++++++ backend/pro | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 backend/migration/000015_create_license_table.down.sql create mode 100644 backend/migration/000015_create_license_table.up.sql diff --git a/backend/migration/000015_create_license_table.down.sql b/backend/migration/000015_create_license_table.down.sql new file mode 100644 index 0000000..354d45d --- /dev/null +++ b/backend/migration/000015_create_license_table.down.sql @@ -0,0 +1,2 @@ +-- Drop license table +DROP TABLE IF EXISTS license; diff --git a/backend/migration/000015_create_license_table.up.sql b/backend/migration/000015_create_license_table.up.sql new file mode 100644 index 0000000..91af2e5 --- /dev/null +++ b/backend/migration/000015_create_license_table.up.sql @@ -0,0 +1,13 @@ +-- Create license table +CREATE TABLE IF NOT EXISTS license ( + id SERIAL PRIMARY KEY, + type VARCHAR(10) NOT NULL, + data BYTEA, + code VARCHAR(255), + created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP +); + +-- Create indexes +CREATE INDEX IF NOT EXISTS idx_license_type ON license (type); +CREATE INDEX IF NOT EXISTS idx_license_code ON license (code); +CREATE INDEX IF NOT EXISTS idx_license_created_at ON license (created_at); diff --git a/backend/pro b/backend/pro index 6320fb5..50ed941 160000 --- a/backend/pro +++ b/backend/pro @@ -1 +1 @@ -Subproject commit 6320fb59825885e6e26800249f8622aed69533cd +Subproject commit 50ed94198b9108364184239b9ffec0c98a623c69