Closed isaacfi closed 5 years ago
I think your first attempt of removing the constraint of the number of annotations per fields looks better. The way the annotations are structured seems like they are trying to do too much for the sake of not having multiple annotations per field.
I would expect that the features which are common to every column are encapsulated discretely inside Column annotation and that the Column annotation is only supplied where it needs to be overridden as required as they all have sensible defaults. i.e. changing the name of the column. This would also mean that auto incrementing is no longer in Column.
class Model {
@PrimaryKey(auto: false)
@Column(name: "model_id")
int id;
}
@isaacfi Thanks for the PR: I will review it and merge it.
@JamesMcIntosh I agree. Can you please create a new issue for that please?
Created an issue here: https://github.com/Jaguar-dart/jaguar_orm/issues/136
Hi @tejainece and @JamesMcIntosh
In the newer version this fix has lost I think that you changed the parser structure, and again, a column cannot be primary key and foreign key at the same time. Can you review this issue again please?
I made some changes to add isPrimary property to ForeingKey and BelongsTo annotations and support the foreing-primary key columns as my request #121
Evaluate it and pull it as soon as posible, and ignore the change on this file: generator/pubspec.yaml