Initial commit

This commit is contained in:
2023-01-27 22:55:09 +11:00
commit 833f3ea8b2
130 changed files with 5637 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
# frozen_string_literal: true
ROM::SQL.migration do
change do
create_table :posts do
primary_key :id
column :name, :text, null: false, default: ""
column :content, :text, null: false
column :published_at, :timestamp
end
end
end

View File

@@ -0,0 +1,9 @@
# frozen_string_literal: true
ROM::SQL.migration do
change do
alter_table :posts do
add_column :slug, :text, null: false
end
end
end

View File

@@ -0,0 +1,9 @@
# frozen_string_literal: true
ROM::SQL.migration do
change do
alter_table :posts do
add_unique_constraint :slug
end
end
end

View File

@@ -0,0 +1,13 @@
# frozen_string_literal: true
ROM::SQL.migration do
change do
create_table :bookmarks do
primary_key :id
column :url, :text, null: false
column :name, :text, null: false
column :content, :text, null: false, default: ""
column :published_at, :timestamp
end
end
end

View File

@@ -0,0 +1,9 @@
# frozen_string_literal: true
ROM::SQL.migration do
change do
alter_table :bookmarks do
add_column :slug, :text, null: false, unique: true
end
end
end

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
ROM::SQL.migration do
change do
create_table :tags do
primary_key :id
column :label, :text, null: false, unique: true
column :slug, :text, null: false, unique: true
end
create_table :post_tags do
foreign_key :post_id, :posts, null: false
foreign_key :tag_id, :tags, null: false
end
end
end

View File

@@ -0,0 +1,11 @@
# frozen_string_literal: true
ROM::SQL.migration do
change do
drop_table :bookmarks
alter_table :posts do
add_column :url, :text
add_column :post_type, :text
end
end
end

View File

@@ -0,0 +1,9 @@
# frozen_string_literal: true
ROM::SQL.migration do
change do
alter_table :posts do
set_column_allow_null :content
end
end
end

View File

@@ -0,0 +1,9 @@
# frozen_string_literal: true
ROM::SQL.migration do
change do
alter_table :posts do
set_column_allow_null :name
end
end
end