Sha256: 9c7e15458274bbf16e60b0dc3bcd923065c554214b6de40b02ed968fbb9ca9d2

Contents?: true

Size: 895 Bytes

Versions: 21

Compression:

Stored size: 895 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 :meetings do |t|
        t.string :title
        # A `TIMESTAMP` column in Cloud Spanner contains a date/time value that designates a specific point in time. The
        # value is always stored in UTC. If you specify a date/time value in a different timezone, the value is
        # converted to UTC when saving it to the database. You can use a separate column to store the timezone of the
        # timestamp if that is vital for your application, and use that information when the timestamp is read back.
        t.datetime :meeting_time
        t.string   :meeting_timezone
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

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