feat: add cameleer-license-minter dependency and V002 migration
Adds Ed25519 license minting library, signing_keys table, renames tiers (LOW→STARTER, MID→TEAM, HIGH→BUSINESS, BUSINESS→ENTERPRISE), adds label + grace_period_days to licenses, drops features column. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
34
src/main/resources/db/migration/V002__license_minter.sql
Normal file
34
src/main/resources/db/migration/V002__license_minter.sql
Normal file
@@ -0,0 +1,34 @@
|
||||
-- V002: License minter integration
|
||||
-- Ed25519 signing keys for license minting
|
||||
CREATE TABLE signing_keys (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
public_key_b64 TEXT NOT NULL,
|
||||
private_key_b64 TEXT NOT NULL,
|
||||
active BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Rename tiers: LOW→STARTER, MID→TEAM, HIGH→BUSINESS, BUSINESS→ENTERPRISE
|
||||
-- Single CASE pass to avoid double-rename
|
||||
UPDATE tenants SET tier = CASE tier
|
||||
WHEN 'LOW' THEN 'STARTER'
|
||||
WHEN 'MID' THEN 'TEAM'
|
||||
WHEN 'HIGH' THEN 'BUSINESS'
|
||||
WHEN 'BUSINESS' THEN 'ENTERPRISE'
|
||||
ELSE tier
|
||||
END WHERE tier IN ('LOW', 'MID', 'HIGH', 'BUSINESS');
|
||||
|
||||
UPDATE licenses SET tier = CASE tier
|
||||
WHEN 'LOW' THEN 'STARTER'
|
||||
WHEN 'MID' THEN 'TEAM'
|
||||
WHEN 'HIGH' THEN 'BUSINESS'
|
||||
WHEN 'BUSINESS' THEN 'ENTERPRISE'
|
||||
ELSE tier
|
||||
END WHERE tier IN ('LOW', 'MID', 'HIGH', 'BUSINESS');
|
||||
|
||||
-- Add new license columns for Ed25519 model
|
||||
ALTER TABLE licenses ADD COLUMN label VARCHAR(255);
|
||||
ALTER TABLE licenses ADD COLUMN grace_period_days INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
-- Drop features column (server enforces caps, not feature flags)
|
||||
ALTER TABLE licenses DROP COLUMN features;
|
||||
Reference in New Issue
Block a user