You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cartodb/db/migrate/20110118160935_user_tables.rb

30 lines
724 B

4 years ago
class UserTablesMigration < Sequel::Migration
def up
create_table :user_tables do
primary_key :id
Integer :user_id, :null => false, :index => true
String :name, :null => false
Integer :privacy, :null => false
DateTime :updated_at, :null => false
String :tags, :text => true
String :geometry_columns
Integer :rows_counted
Integer :rows_estimated
end
alter_table(:user_tables) do
add_index [:user_id, :privacy]
add_index [:name, :user_id], :unique => true
set_column_default :privacy, 0
set_column_default :rows_counted, 0
set_column_default :rows_estimated, 0
end
end
def down
drop_table :user_tables
end
end