rsnext/examples/with-postgres/migrations/000-todos.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
323 B
JavaScript
Raw Permalink Normal View History

exports.up = async function (sql) {
await sql`
CREATE TABLE IF NOT EXISTS todos (
id SERIAL PRIMARY KEY NOT NULL,
text CHARACTER VARYING(255) NOT NULL,
done BOOLEAN NOT NULL DEFAULT FALSE
)
`;
};
exports.down = async function (sql) {
await sql`
DROP TABLE IF EXISTS todos
`;
};