Skip to content

Commit 77d78e3

Browse files
committed
added license tables
1 parent d040e10 commit 77d78e3

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

liquibase/changelog.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,5 @@
7575
<include file="changes/feat_1057.sql" relativeToChangelogFile="true"/>
7676
<!-- Recreate or refresh dependent materialized view FeedSearch to use the relation instead of scanning gtfsdataset.latest -->
7777
<include file="changes/feat_1057_view.sql" relativeToChangelogFile="true"/>
78+
<include file="changes/feat_1343.sql" relativeToChangelogFile="true"/>
7879
</databaseChangeLog>

liquibase/changes/feat_1343.sql

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
CREATE TABLE license (
2+
id TEXT PRIMARY KEY,
3+
type TEXT NOT NULL CHECK (type IN ('standard', 'custom')),
4+
is_spdx BOOLEAN NOT NULL DEFAULT FALSE,
5+
name TEXT NOT NULL,
6+
url TEXT,
7+
description TEXT,
8+
content_txt TEXT,
9+
content_html TEXT,
10+
created_at TIMESTAMP,
11+
updated_at TIMESTAMP
12+
);
13+
14+
-- Unified rules table
15+
CREATE TABLE rules (
16+
name TEXT PRIMARY KEY,
17+
label TEXT NOT NULL,
18+
description TEXT,
19+
type TEXT NOT NULL CHECK (type IN ('permission', 'condition', 'limitation'))
20+
);
21+
22+
-- Join table for license-rule mappings
23+
CREATE TABLE license_rules (
24+
license_id TEXT REFERENCES license(id) ON DELETE CASCADE,
25+
rule_id TEXT REFERENCES rules(name) ON DELETE CASCADE,
26+
PRIMARY KEY (license_id, rule_id)
27+
);

0 commit comments

Comments
 (0)