@@ -1,10 +0,0 @@ | |||||
class CreatePosts < ActiveRecord::Migration[8.0] | |||||
def change | |||||
create_table :posts do |t| | |||||
t.string :title | |||||
t.text :body | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,9 @@ | |||||
class CreateIpAddresses < ActiveRecord::Migration[7.0] | |||||
def change | |||||
create_table :ip_addresses do |t| | |||||
t.binary :ip_adress, limit: 16, null: false | |||||
t.boolean :banned, default: false, null: false | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,9 @@ | |||||
class CreateNicoTagRelations < ActiveRecord::Migration[7.0] | |||||
def change | |||||
create_table :nico_tag_relations do |t| | |||||
t.references :nico_tag, null: false, foreign_key: { to_table: :tags } | |||||
t.references :tag, null: false, foreign_key: { to_table: :tags } | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,11 @@ | |||||
class CreatePostTags < ActiveRecord::Migration[7.0] | |||||
def change | |||||
create_table :post_tags do |t| | |||||
t.references :post, null: false, foreign_key: { to_table: :posts } | |||||
t.references :tag, null: false, foreign_key: { to_table: :tags } | |||||
t.references :created_by, foreign_key: { to_table: :users } | |||||
t.references :deleted_by, foreign_key: { to_table: :users } | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,12 @@ | |||||
class CreatePosts < ActiveRecord::Migration[7.0] | |||||
def change | |||||
create_table :posts do |t| | |||||
t.string :url, limit: 2000, null: false | |||||
t.string :thumbnail, limit: 255, null: false | |||||
t.string :thumbnail_base, limit: 2000, null: false | |||||
t.references :post, foreign_key: { to_table: :posts } | |||||
t.references :uploaded_by, foreign_key: { to_table: :users } | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,10 @@ | |||||
class CreateSettings < ActiveRecord::Migration[7.0] | |||||
def change | |||||
create_table :settings do |t| | |||||
t.references :user, null: false, foreign_key: { to_table: :users } | |||||
t.string :key, limit: 255, null: false | |||||
t.json :value, null: false | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,9 @@ | |||||
class CreateTagAliases < ActiveRecord::Migration[7.0] | |||||
def change | |||||
create_table :tag_aliases do |t| | |||||
t.references :tag, null: false, foreign_key: { to_table: :tags } | |||||
t.string :name, limit: 255, null: false | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,9 @@ | |||||
class CreateTags < ActiveRecord::Migration[7.0] | |||||
def change | |||||
create_table :tags do |t| | |||||
t.string :name, limit: 255, null: false | |||||
t.string :category, limit: 255, null: false, default: 'general' | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,10 @@ | |||||
class CreateUserIps < ActiveRecord::Migration[7.0] | |||||
def change | |||||
create_table :user_ips do |t| | |||||
t.references :user, null: false, foreign_key: { to_table: :users } | |||||
t.references :ip_address, null: false, | |||||
foreign_key: { to_table: :ip_addresses } | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,10 @@ | |||||
class CreateUserPostViews < ActiveRecord::Migration[7.0] | |||||
def change | |||||
create_table :user_post_views do |t| | |||||
t.references :user, null: false, foreign_key: { to_table: :users } | |||||
t.references :post, null: false, foreign_key: { to_table: :posts } | |||||
t.boolean :viewed, default: false, null: false | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,11 @@ | |||||
class CreateUsers < ActiveRecord::Migration[7.0] | |||||
def change | |||||
create_table :users do |t| | |||||
t.string :name, limit: 255 | |||||
t.string :inheritance_code, limit: 64, null: false | |||||
t.string :role, limit: 255, null: false | |||||
t.boolean :banned, default: false, null: false | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,11 @@ | |||||
class CreateWikiPages < ActiveRecord::Migration[7.0] | |||||
def change | |||||
create_table :wiki_pages do |t| | |||||
t.string :title, limit: 255, null: false | |||||
t.references :tag, foreign_key: { to_table: :tags } | |||||
t.references :created_by, null: false, foreign_key: { to_table: :users } | |||||
t.references :updated_by, null: false, foreign_key: { to_table: :users } | |||||
t.timestamps | |||||
end | |||||
end | |||||
end |