From 4e24495b159df0dbc4f503843c08ccd452af616a Mon Sep 17 00:00:00 2001
From: cel 🌸 <cel@blos.sm>
Date: Tue, 30 May 2023 21:48:26 +0100
Subject: WIP: blog

---
 migrations/20230218162011_blossom.sql | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

(limited to 'migrations/20230218162011_blossom.sql')

diff --git a/migrations/20230218162011_blossom.sql b/migrations/20230218162011_blossom.sql
index 188bbf8..c8ed09d 100644
--- a/migrations/20230218162011_blossom.sql
+++ b/migrations/20230218162011_blossom.sql
@@ -33,10 +33,18 @@ create table articles (
     foreign key (post_id) references posts(id)
 );
 
+create table text_formats (
+    name varchar(16) not null primary key
+);
+
+insert into text_formats (name) values ('plaintext'), ('markdown'), ('html');
+
 create table notes (
     post_id integer not null,
-    content text,
-    foreign key (post_id) references posts(id)
+    text_format varchar(16) not null default ('plaintext');
+    text_content text,
+    foreign key (post_id) references posts(id),
+    foreign key (text_format) references text_formats(name)
 );
 
 create table media_types (
@@ -58,4 +66,4 @@ create table notes_media (
     foreign key (note_id) references notes(note_id),
     foreign key (media_id) references media(id),
     primary key (note_id, media_id)
-);
\ No newline at end of file
+);
-- 
cgit 

