Tables, indexes and schema changes
Create application tables and indexes, then evolve their schema.
Example
Section titled “Example”CREATE TABLE docs_schema_tasks (id BIGINT PRIMARY KEY, status TEXT);CREATE INDEX docs_schema_tasks_status ON docs_schema_tasks (status);ALTER TABLE docs_schema_tasks ADD COLUMN title TEXT;INSERT INTO docs_schema_tasks VALUES (1, 'pending', 'Review');SELECT id, status, title FROM docs_schema_tasks;Behavior
Section titled “Behavior”Schema changes affect application queries and clients. Test migrations on representative data and plan a recovery path. Use IF EXISTS or IF NOT EXISTS only when the intended result is unambiguous. Check transactional DDL support for the exact command rather than assuming every schema change rolls back.
Related
Section titled “Related”This site uses Google Analytics cookies to count visits. Privacy · License