Sha256: c2b5344526d9cc1a25649a3e46a254beebfec144f8e9ce1d0cd8c8f7761fcfad
Contents?: true
Size: 860 Bytes
Versions: 6
Compression:
Stored size: 860 Bytes
Contents
class CreateArticles < ActiveRecord::Migration[6.1] def change create_table :articles do |t| t.belongs_to :user t.string :title, null: false, unique: true t.text :body, null: false, default: "" t.string :thumnail_url, null: false, default: "" t.datetime :public_date, null: false, default: Time.now + 30.days t.belongs_to :article_category, null: false t.boolean :is_public, default: false, null: false t.boolean :just_created, default: true, null: false t.string :slag, null: false, unique: true t.text :tags, array: true, default: [] t.boolean :is_deleted, null: false, default: false t.timestamps end add_index :articles, :slag, unique: true add_index :articles, :title, unique: true add_index :articles, :is_public add_index :articles, :is_deleted end end
Version data entries
6 entries across 4 versions & 1 rubygems