rag/internal/migrations/20240714155720_create_library.sql

12 lines
590 B
MySQL
Raw Normal View History

2024-07-14 15:58:32 +00:00
-- +goose Up
-- create "libraries" table
CREATE TABLE "libraries" ("id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, "name" character varying NOT NULL, "user_id" bigint NOT NULL, "created_at" timestamptz NOT NULL, "updated_at" timestamptz NOT NULL, PRIMARY KEY ("id"));
-- create index "library_name_user_id" to table: "libraries"
CREATE INDEX "library_name_user_id" ON "libraries" ("name", "user_id");
-- +goose Down
-- reverse: create index "library_name_user_id" to table: "libraries"
DROP INDEX "library_name_user_id";
-- reverse: create "libraries" table
DROP TABLE "libraries";