First checkpoint

This commit is contained in:
2026-06-04 19:26:38 +05:00
commit b08e71b3bb
43 changed files with 1252 additions and 0 deletions

View 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;

View 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;

View 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;