vania-dart / framework

Fast, simple, and powerful backend framework for Dart built with ❤️
https://vdart.dev
MIT License
155 stars 12 forks source link

[BUG] - Trying to set column uuid as primary key #88

Closed tihrasguinho closed 6 days ago

tihrasguinho commented 1 week ago

I'm trying to set a column uuid('id') as primary key passing primary('id') below the uuid line but nothing happens, I tried to put the primary method at the final, at the begining, above and below my uuid method but as I'm say nothing happens, am I making something wrog?

await createTable('tb_users', () {
  uuid('id', defaultValue: 'uuid_generate_v4()');
  primary('id');
  string('name', length: 255);
  string('username', length: 24);
  string('email', length: 255);
  string('password', length: 255);
  string('image', nullable: true, length: 255);
  string('bio', nullable: true, length: 255);
  string('website', nullable: true, length: 255);
  timeStamp('created_at', defaultValue: 'now()');
  timeStamp('updated_at', defaultValue: 'now()');
});
javad-zobeidi commented 1 week ago

Update to V0.3.3 and try

tihrasguinho commented 1 week ago

it worked, but now the uuid method create a char type column without defaultValue parameter, is it right?

javad-zobeidi commented 1 week ago

it's ok