Replace individual Rust migration modules with a define_sql_migrations macro that reads up/down SQL files via include_str!. Consolidate all legacy single-file SQL into per-table directories and add full schema migration coverage for 90+ tables.
36 lines
1.4 KiB
SQL
36 lines
1.4 KiB
SQL
create table if not exists project_skill
|
|
(
|
|
id bigserial
|
|
primary key,
|
|
project_uuid uuid not null,
|
|
slug varchar(255) not null,
|
|
name varchar(255) not null,
|
|
description text,
|
|
source varchar(20) default 'manual'::character varying not null,
|
|
repo_id uuid,
|
|
content text default ''::text not null,
|
|
metadata jsonb default '{}'::jsonb not null,
|
|
enabled boolean default true not null,
|
|
created_by uuid,
|
|
created_at timestamp with time zone default now() not null,
|
|
updated_at timestamp with time zone default now() not null,
|
|
commit_sha varchar(40),
|
|
blob_hash varchar(40),
|
|
unique (project_uuid, slug)
|
|
);
|
|
|
|
create index if not exists idx_project_skill_project
|
|
on project_skill (project_uuid);
|
|
|
|
create index if not exists idx_project_skill_slug
|
|
on project_skill (slug);
|
|
|
|
create index if not exists idx_project_skill_source
|
|
on project_skill (source);
|
|
|
|
create index if not exists idx_project_skill_commit_sha
|
|
on project_skill (commit_sha);
|
|
|
|
create index if not exists idx_project_skill_blob_hash
|
|
on project_skill (blob_hash);
|