Sha256: f97f3754c44c435cafcca2705664cfe4f4f16eaee189f097494a72f2b8f9b3ff

Contents?: true

Size: 739 Bytes

Versions: 21

Compression:

Stored size: 739 Bytes

Contents

# Copyright 2021 Google LLC
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.

class CreateTables < ActiveRecord::Migration[6.0]
  def change
    connection.ddl_batch do
      create_table :singers do |t|
        t.string :first_name, limit: 100
        t.string :last_name, null: false, limit: 200
        t.string :full_name, null: false, limit: 300, as: "COALESCE(first_name || ' ', '') || last_name", stored: true
        t.date :birth_date
        t.binary :picture
      end

      create_table :albums do |t|
        t.string :title
        t.date :release_date
        t.references :singer, index: false
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
activerecord-spanner-adapter-1.6.3 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.6.2 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.6.1 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.6.0 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.5.1 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.5.0 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.4.4 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.4.3 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.4.2 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.4.1 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.4.0 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.3.1 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.2.2 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.2.1 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.2.0 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.1.0 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.0.1 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-1.0.0 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-0.7.0 benchmarks/db/migrate/01_create_tables.rb
activerecord-spanner-adapter-0.6.0 benchmarks/db/migrate/01_create_tables.rb