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

Version Path
souls-0.24.2 apps/api/db/migrate/20200714215521_create_articles.rb
souls-0.24.2 apps/worker/db/migrate/20200714215521_create_articles.rb
souls-0.24.1 apps/api/db/migrate/20200714215521_create_articles.rb
souls-0.24.1 apps/worker/db/migrate/20200714215521_create_articles.rb
souls-0.22.8 hoy/db/migrate/20200714215521_create_articles.rb
souls-0.22.7 hoy/db/migrate/20200714215521_create_articles.rb