Sha256: c048c4a15de7d46203160fd9a99c6fd5c6a223de1827a52f581348fcda4d45b7

Contents?: true

Size: 937 Bytes

Versions: 1

Compression:

Stored size: 937 Bytes

Contents

require "active_record"

I18n.enforce_available_locales = true

ActiveRecord::Base.establish_connection(
  adapter: "sqlite3",
  database: File.expand_path("test_app/db/db.sqlite", File.dirname(__FILE__)),
  verbosity: "quiet"
)

class TestMigration < ActiveRecord::Migration
  def self.up
    create_table :posts, force: true do |t|
      t.integer :user_id
      t.column :title, :string
      t.column :image_id, :string
      t.column :document_id, :string
      t.column :document_filename, :string
      t.column :document_content_type, :string
      t.column :document_size, :integer
    end

    create_table :users, force: true

    create_table :documents, force: true do |t|
      t.belongs_to :post, null: false
      t.column :file_id, :string, null: false
      t.column :file_filename, :string
      t.column :file_content_type, :string
      t.column :file_size, :integer, null: false
    end
  end
end

TestMigration.up

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
leifcr-refile-0.6.3 spec/refile/active_record_helper.rb