diff --git a/internal/repository/projects.go b/internal/repository/projects.go index 35563fd..4de7726 100644 --- a/internal/repository/projects.go +++ b/internal/repository/projects.go @@ -21,6 +21,10 @@ type ProjectData struct { // CreateProject adds a new projects to the database func CreateProject(ctx context.Context, db *sql.DB, data *ProjectData) error { + query := ` + INSERT INTO projects + (uuid, name, slug, ) + ` return nil } diff --git a/migrations/20260518193048_projects_init.up.sql b/migrations/20260518193048_projects_init.up.sql index 60d8bf0..3a670b1 100644 --- a/migrations/20260518193048_projects_init.up.sql +++ b/migrations/20260518193048_projects_init.up.sql @@ -1,14 +1,15 @@ CREATE TABLE projects ( id UUID PRIMARY KEY, name VARCHAR(120) NOT NULL, - slug VARCHAR(120) NOT NULL UNIQUE, + slug VARCHAR(120) NOT NULL UNIQUE + CHECK ( + slug ~ '^[a-z0-9]+(?:-[a-z0-9]+)*$' + ), description TEXT, owner_user_id UUID NOT NULL, archived_at TIMESTAMP NULL, closed_at TIMESTAMP NULL, billing_account_id UUID NULL, - max_clusters INTEGER DEFAULT 10, - max_nodes INTEGER DEFAULT 100, created_at TIMESTAMP NOT NULL DEFAULT now(), updated_at TIMESTAMP NOT NULL DEFAULT now(), created_by UUID NOT NULL,