rust_forum/migrations/20241213232937_contact.up.sql
2025-01-28 22:38:14 +03:00

7 lines
281 B
SQL

-- Add up migration script here
CREATE TABLE IF NOT EXISTS "contact"(
contact_id BIGSERIAL PRIMARY KEY NOT NULL UNIQUE,
name VARCHAR(32) NOT NULL UNIQUE
);
INSERT INTO "contact"(contact_id, name) VALUES (0, 'Email') ON CONFLICT(contact_id) DO UPDATE SET "name" = 'Email';