Sha256: d3c65e9552668f4f84f656ca654d3b1d9e092296e3c87894e56254cd88a9b3d6

Contents?: true

Size: 733 Bytes

Versions: 5

Compression:

Stored size: 733 Bytes

Contents

class CreateNotes < ActiveRecord::Migration[5.0]
  def up
    return if ActiveRecord::Base.connection.table_exists? :notes

    create_table 'notes' do |t|
      t.string   'title',                         null: false
      t.text     'body',                          null: false
      t.integer  'user_id',                       null: false
      t.integer  'word_count',    default: 0,     null: false
      t.integer  'changes_count', default: 0,     null: false
      t.boolean  'publish',       default: false
      t.datetime 'created_at'
      t.datetime 'updated_at'
    end

    add_index 'notes', ['user_id'], name: 'index_notes_on_user_id', using: :btree
  end

  def down
    drop_table :notes, if_exists: true
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
homeland-note-0.2.2 db/migrate/20170321074447_create_notes.rb
homeland-note-0.2.1 db/migrate/20170321074447_create_notes.rb
homeland-note-0.2.0 db/migrate/20170321074447_create_notes.rb
homeland-note-0.1.3 db/migrate/20170321074447_create_notes.rb
homeland-note-0.1.2 db/migrate/20170321074447_create_notes.rb