Design scalable database schemas with tables, migrations, and relationships. Use for production-ready applications.
Table structure
id)created_at, updated_at)Relationships
Migrations
Schema constraints
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(150) UNIQUE NOT NULL,
password_hash TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);