I tried to add a 'postgres uuid' column by using rake db:migarate
```ruby
Sequel.migration do
up do
alter_table(:comments) do
add_column :child_id, uuid
end
end
down do
alter_table(:comments) do
drop_column :child_id
end
end
end
```
It errors:
NameError: undefined local variable or method `uuid' for
<Sequel::Postgres::AlterTableGenerator:0x007fbe40c90080>
However it works when using create_table
```ruby
Sequel.migration do
up do
run 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp"'
create_table(:comments) do
uuid :id, default: Sequel.function(:uuid_generate_v4), primary_key:
true
uuid :feed_id, null: false
uuid :sender_id, null: false
uuid :reciever_id
String :content, size: 500, null: false
DateTime :deleted_at
DateTime :created_at, null: false, default: Sequel::CURRENT_TIMESTAMP
DateTime :updated_at, null: false, default: Sequel::CURRENT_TIMESTAMP
end
add_index :comments, :feed_id, where: "deleted_at IS NULL"
add_index :comments, :sender_id, where: "deleted_at IS NULL"
add_index :comments, :reciever_id, where: "deleted_at IS NULL"
end
down do
drop_table(:comments)
end
end
```
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.