Axium/migrations/20250128160204_create_todos_table.sql
2025-01-30 22:43:30 +01:00

6 lines
336 B
SQL

CREATE TABLE todos (
id SERIAL PRIMARY KEY, -- Auto-incrementing primary key
task TEXT NOT NULL, -- Task description, cannot be null
description TEXT, -- Optional detailed description
user_id INT NOT NULL REFERENCES users(id) -- Foreign key to link to users table
);