First checkpoint
This commit is contained in:
11
migrations/20260604134433_create_datasets_table.sql
Normal file
11
migrations/20260604134433_create_datasets_table.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE datasets (
|
||||
id UUID PRIMARY KEY default gen_random_uuid(),
|
||||
name varchar(255),
|
||||
description text,
|
||||
created_at timestamp default now(),
|
||||
updated_at timestamp default now()
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE datasets;
|
||||
12
migrations/20260604141221_create_categories_table.sql
Normal file
12
migrations/20260604141221_create_categories_table.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE categories
|
||||
(
|
||||
id UUID PRIMARY KEY default gen_random_uuid(),
|
||||
name varchar(255),
|
||||
description text,
|
||||
created_at timestamp default now(),
|
||||
updated_at timestamp default now()
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE categories;
|
||||
22
migrations/20260604141656_create_files_table.sql
Normal file
22
migrations/20260604141656_create_files_table.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
-- +goose Up
|
||||
CREATE TYPE file_type AS ENUM ('vector_with_table', 'vector', 'raster');
|
||||
CREATE TYPE file_validation_status AS ENUM ('pending', 'valid', 'failed');
|
||||
|
||||
CREATE TABLE files (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
filename VARCHAR(255) NOT NULL,
|
||||
storage_key TEXT NOT NULL,
|
||||
file_type file_type NOT NULL,
|
||||
validation_status file_validation_status NOT NULL DEFAULT 'pending',
|
||||
validation_error TEXT,
|
||||
kato_column VARCHAR(255),
|
||||
crs VARCHAR(64),
|
||||
feature_count INTEGER,
|
||||
uploaded_at TIMESTAMP NOT NULL DEFAULT now(),
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE files;
|
||||
DROP TYPE file_validation_status;
|
||||
DROP TYPE file_type;
|
||||
Reference in New Issue
Block a user