mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +02:00
parent
640faaadb9
commit
42e8f86dae
51 changed files with 1619 additions and 53 deletions
27
db/migrate/20181212105100_create_auctions.rb
Normal file
27
db/migrate/20181212105100_create_auctions.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
class CreateAuctions < ActiveRecord::Migration
|
||||
def up
|
||||
execute <<-SQL
|
||||
CREATE TYPE auction_status AS ENUM (
|
||||
'open',
|
||||
'closed_without_winner',
|
||||
'closed_with_winner',
|
||||
'payment_received'
|
||||
);
|
||||
SQL
|
||||
|
||||
create_table :auctions do |t|
|
||||
t.string :domain, null: false
|
||||
t.column :status, :auction_status, null: false
|
||||
t.uuid :uuid, default: 'gen_random_uuid()', null: false
|
||||
t.datetime :created_at, null: false
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
execute <<-SQL
|
||||
DROP type auction_status;
|
||||
SQL
|
||||
|
||||
drop_table :auctions
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue