Этот коммит содержится в:
Mattia Roccoberton
2020-09-01 11:12:40 +02:00
родитель 80b5b3d3f3
Коммит b89fc0f939
82 изменённых файлов: 1707 добавлений и 4 удалений

Просмотреть файл

@@ -0,0 +1,27 @@
# This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
def change
create_table :active_storage_blobs do |t|
t.string :key, null: false
t.string :filename, null: false
t.string :content_type
t.text :metadata
t.bigint :byte_size, null: false
t.string :checksum, null: false
t.datetime :created_at, null: false
t.index [ :key ], unique: true
end
create_table :active_storage_attachments do |t|
t.string :name, null: false
t.references :record, null: false, polymorphic: true, index: false
t.references :blob, null: false
t.datetime :created_at, null: false
t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
end
end

Просмотреть файл

@@ -0,0 +1,16 @@
class CreateActiveAdminComments < ActiveRecord::Migration[6.0]
def self.up
create_table :active_admin_comments do |t|
t.string :namespace
t.text :body
t.references :resource, polymorphic: true
t.references :author, polymorphic: true
t.timestamps
end
add_index :active_admin_comments, [:namespace]
end
def self.down
drop_table :active_admin_comments
end
end

Просмотреть файл

@@ -0,0 +1,13 @@
# frozen_string_literal: true
class CreateAuthors < ActiveRecord::Migration[5.2]
def change
create_table :authors do |t|
t.string :name
t.integer :age
t.string :email
t.timestamps
end
end
end

Просмотреть файл

@@ -0,0 +1,12 @@
# frozen_string_literal: true
class CreateProfiles < ActiveRecord::Migration[5.2]
def change
create_table :profiles do |t|
t.text :description
t.belongs_to :author, foreign_key: true
t.timestamps
end
end
end

Просмотреть файл

@@ -0,0 +1,11 @@
# frozen_string_literal: true
class CreateTags < ActiveRecord::Migration[5.2]
def change
create_table :tags do |t|
t.string :name
t.timestamps
end
end
end

Просмотреть файл

@@ -0,0 +1,12 @@
# frozen_string_literal: true
class CreatePostTags < ActiveRecord::Migration[5.2]
def change
create_table :post_tags do |t|
t.belongs_to :post, foreign_key: true
t.belongs_to :tag, foreign_key: true
t.timestamps
end
end
end

Просмотреть файл

@@ -0,0 +1,17 @@
# frozen_string_literal: true
class CreatePosts < ActiveRecord::Migration[5.2]
def change
create_table :posts do |t|
t.string :title
t.text :description
t.belongs_to :author, foreign_key: true
t.string :category
t.datetime :dt
t.float :position
t.boolean :published
t.timestamps
end
end
end