From 66ac5c365191d7515f7f796e95a754f6882cda8e Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 5 Jul 2025 11:12:37 +0200 Subject: Code simplification --- src/dbx/sql/000-genesis.sql | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'src/dbx/sql') diff --git a/src/dbx/sql/000-genesis.sql b/src/dbx/sql/000-genesis.sql index 56ae7c3..c16c6ae 100644 --- a/src/dbx/sql/000-genesis.sql +++ b/src/dbx/sql/000-genesis.sql @@ -7,30 +7,26 @@ CREATE TABLE migration ( INSERT INTO migration (id, latest) VALUES (1, -1); CREATE TABLE mintages_s ( - country CHAR(2) NOT NULL COLLATE BINARY + country CHAR(2) NOT NULL COLLATE BINARY CHECK(length(country) = 2), - type INTEGER NOT NULL -- Codes correspond to contants in mintages.go + -- Codes correspond to contants in mintages.go + type INTEGER NOT NULL CHECK(type BETWEEN 0 AND 2), - year INTEGER NOT NULL, - mintmark TEXT, - [€0,01] INTEGER, - [€0,02] INTEGER, - [€0,05] INTEGER, - [€0,10] INTEGER, - [€0,20] INTEGER, - [€0,50] INTEGER, - [€1,00] INTEGER, - [€2,00] INTEGER, - reference TEXT + year INTEGER NOT NULL, + denomination REAL NOT NULL, + mintmark TEXT, + mintage INTEGER, + reference TEXT ); CREATE TABLE mintages_c ( country CHAR(2) NOT NULL COLLATE BINARY CHECK(length(country) = 2), - type INTEGER NOT NULL -- Codes correspond to contants in mintages.go + -- Codes correspond to contants in mintages.go + type INTEGER NOT NULL CHECK(type BETWEEN 0 AND 2), - name TEXT NOT NULL, year INTEGER NOT NULL, + name TEXT NOT NULL, number INTEGER NOT NULL, mintmark TEXT, mintage INTEGER, -- cgit v1.2.3