INSERT INTO gb_posts (title, content)
SELECT 'Hello, Gazebo!', 'First demo post for your Gazebo CMS.'
UNION ALL
SELECT 'A CMS experiment project', 'Second demo post for your Gazebo CMS.'
UNION ALL
SELECT 'Inspired by WordPress', 'Third demo post for your Gazebo CMS.'
WHERE NOT EXISTS (SELECT id FROM gb_posts WHERE title IN ('Hello, Gazebo!', 'A CMS experiment project', 'Inspired by WordPress'))
RETURNING id;
An example on how to create a migrations file:
sqlx migrate add -r create_gb_posts_table
Inside the files that get created we can add some SQL command
*In `_up.sql`**
*In `_down.sql`**
Then to add default "posts", create a new pair of files:
sqlx migrate add -r create_gb_posts_add_default_posts_table
*In `_up.sql`**