Merge branch '8784-dir-listings'
[arvados.git] / services / api / db / migrate / 20130425024459_create_keep_disks.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 class CreateKeepDisks < ActiveRecord::Migration
6   def change
7     create_table :keep_disks do |t|
8       t.string :uuid, :null => false
9       t.string :owner, :null => false
10       t.string :modified_by_client
11       t.string :modified_by_user
12       t.datetime :modified_at
13       t.string :ping_secret, :null => false
14       t.string :node_uuid
15       t.string :filesystem_uuid
16       t.integer :bytes_total
17       t.integer :bytes_free
18       t.boolean :is_readable, :null => false, :default => true
19       t.boolean :is_writable, :null => false, :default => true
20       t.datetime :last_read_at
21       t.datetime :last_write_at
22       t.datetime :last_ping_at
23
24       t.timestamps
25     end
26     add_index :keep_disks, :uuid, :unique => true
27     add_index :keep_disks, :filesystem_uuid
28     add_index :keep_disks, :node_uuid
29     add_index :keep_disks, :last_ping_at
30   end
31 end