19 lines
520 B
MySQL
19 lines
520 B
MySQL
|
|
-- migrations/0003_tablos.sql
|
||
|
|
-- Phase 3: Tablos CRUD
|
||
|
|
|
||
|
|
-- +goose Up
|
||
|
|
CREATE TABLE tablos (
|
||
|
|
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||
|
|
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||
|
|
title text NOT NULL,
|
||
|
|
description text,
|
||
|
|
color text,
|
||
|
|
created_at timestamptz NOT NULL DEFAULT now(),
|
||
|
|
updated_at timestamptz NOT NULL DEFAULT now()
|
||
|
|
);
|
||
|
|
|
||
|
|
CREATE INDEX tablos_user_id_idx ON tablos(user_id);
|
||
|
|
|
||
|
|
-- +goose Down
|
||
|
|
DROP TABLE IF EXISTS tablos;
|