Files
go-http-server/sql/schema/002_chirps.sql
2025-03-11 19:08:34 +02:00

11 lines
314 B
SQL

-- +goose Up
CREATE TABLE chirps(
id UUID PRIMARY KEY,
created_at TIMESTAMP not null DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP not null DEFAULT CURRENT_TIMESTAMP,
body TEXT not null UNIQUE,
user_id UUID not null REFERENCES users(id) ON DELETE CASCADE
);
-- +goose Down
DROP TABLE chirps;