achubb_website/schema.sql

27 lines
697 B
MySQL
Raw Normal View History

DO $$
2025-03-04 07:43:08 -05:00
BEGIN
CREATE TYPE link_type as ENUM ('article', 'blog');
EXCEPTION
WHEN duplicate_object THEN null;
END
2025-03-04 07:43:08 -05:00
$$;
CREATE TABLE IF NOT EXISTS articles (
reference varchar(20) not null,
title varchar(50) not null,
previous varchar(20),
next varchar(20),
description text,
content text not null,
date date not null,
id serial primary key);
CREATE TABLE IF NOT EXISTS links (
url varchar(100) not null,
date_added date not null,
description text,
title text not null,
author varchar(50) not null,
link_type link_type not null,
id serial primary key);