feat: add license migration file

This commit is contained in:
LydiaMuaCai
2025-08-07 22:06:35 +08:00
parent a67dea5852
commit cfb6c6e3b7
3 changed files with 16 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
-- Drop license table
DROP TABLE IF EXISTS license;

View File

@@ -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);