Sha256: 919183e969be5a159b504fe69e4e45fb7fbe8e427616be94466c123acc466daf

Contents?: true

Size: 635 Bytes

Versions: 2

Compression:

Stored size: 635 Bytes

Contents

ActiveRecord::Base.establish_connection(
  :adapter  => "sqlite3",
  :database => ":memory:",
)

class Schema < ActiveRecord::Migration[5.0]

  def change
    create_table :projects do |t|
      t.string :name
    end

    create_table :tickets do |t|
      t.belongs_to :project
      t.string :name
      t.string :state
      t.text :message
      t.datetime :created_at
      t.datetime :updated_at
      t.boolean :resolved
      t.integer :position
      t.float :rating
    end
  end
end

Schema.new.change

class Project < ActiveRecord::Base
  has_many :tickets
end

class Ticket < ActiveRecord::Base
  belongs_to :project
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
parelation-1.0.0 spec/support/db.rb
parelation-0.2.0 spec/support/db.rb