Sha256: aff369739155c2dda1c5ad0669cc916f4007a6b7cb7178c4e280da84e877e4c3

Contents?: true

Size: 1.74 KB

Versions: 3

Compression:

Stored size: 1.74 KB

Contents

class BasicSchema < ActiveRecord::Migration
  def change
    create_table "microposts", force: :cascade do |t|
      t.text     "content", null: false
      t.integer  "user_id", null: false
      t.integer  "likes", null: false, default: 0
      t.integer  "reposts", null: false, default: 0
      t.integer  "status", null: false, default: 0

      t.timestamps null: false

      t.index ["user_id"], name: "index_microposts_on_user_id", using: :btree
    end

    create_table "relationships", force: :cascade do |t|
      t.integer  "follower_id"
      t.integer  "followed_id"

      t.timestamps null: false

      t.index ["followed_id"], name: "index_relationships_on_followed_id", using: :btree
      t.index ["follower_id", "followed_id"], name: "index_relationships_on_follower_id_and_followed_id", unique: true, using: :btree
      t.index ["follower_id"], name: "index_relationships_on_follower_id", using: :btree
    end

    create_table "users", force: :cascade do |t|
      t.string   "name"
      t.string   "email", null: false
      t.boolean  "admin", default: false
      t.boolean  "verified", default: false
      t.string   "token", null: false
      t.integer  "microposts_count", default: 0, null: false
      t.integer  "followers_count", default: 0, null: false
      t.integer  "followings_count", default: 0, null: false

      t.timestamps null: false

      t.index ["email"], name: "index_users_on_email", unique: true, using: :btree
    end

    create_table :addresses do |t|
      t.string :street
      t.string :city
      t.string :country
      t.integer :user_id

      t.timestamps
      t.index ["user_id"], name: "index_addresses_on_user_id", unique: true, using: :btree
    end

    add_foreign_key "microposts", "users"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_hash_relation-1.4.1 spec/db/migrate/001_basic_schema.rb
active_hash_relation-1.4.0 spec/db/migrate/001_basic_schema.rb
active_hash_relation-1.2.0 spec/db/migrate/001_basic_schema.rb