Sha256: af4a0eb824595330de77844db800ea1857b641d804fadf9725c002d111841441

Contents?: true

Size: 782 Bytes

Versions: 44

Compression:

Stored size: 782 Bytes

Contents

Sequel.migration do
    up do
        create_table(:values) do
            primary_key :id
            Integer :system_id, null: false
            Integer :timestamp, null: false
            String  :metric, null: false
            Float   :num_value
            String  :str_value

            # a covering index is used so no secondary lookups are required
            # when querying for all metric values for a system. queries are
            # constrained on system_id only. using timestamp as the second
            # component of the index implicitly sorts the rows by timestamp
            # satisfying `order by timestamp'.
            index [:system_id, :timestamp, :metric, :num_value, :str_value]
        end
    end

    down do
        drop_table(:values)
    end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
perus-0.1.23 lib/perus/server/migrations/003_create_values.rb
perus-0.1.22 lib/perus/server/migrations/003_create_values.rb
perus-0.1.21 lib/perus/server/migrations/003_create_values.rb
perus-0.1.20 lib/perus/server/migrations/003_create_values.rb
perus-0.1.19 lib/perus/server/migrations/003_create_values.rb
perus-0.1.18 lib/perus/server/migrations/003_create_values.rb
perus-0.1.17 lib/perus/server/migrations/003_create_values.rb
perus-0.1.16 lib/perus/server/migrations/003_create_values.rb
perus-0.1.15 lib/perus/server/migrations/003_create_values.rb
perus-0.1.14 lib/perus/server/migrations/003_create_values.rb
perus-0.1.13 lib/perus/server/migrations/003_create_values.rb
perus-0.1.12 lib/perus/server/migrations/003_create_values.rb
perus-0.1.11 lib/perus/server/migrations/003_create_values.rb
perus-0.1.10 lib/perus/server/migrations/003_create_values.rb
perus-0.1.9 lib/perus/server/migrations/003_create_values.rb
perus-0.1.8 lib/perus/server/migrations/003_create_values.rb
perus-0.1.7 lib/perus/server/migrations/003_create_values.rb
perus-0.1.6 lib/perus/server/migrations/003_create_values.rb
perus-0.1.5 lib/perus/server/migrations/003_create_values.rb
perus-0.1.4 lib/perus/server/migrations/003_create_values.rb