stablekernel / aqueduct

Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider.
https://aqueduct.io
BSD 2-Clause "Simplified" License
2.41k stars 279 forks source link

Unable to create column with type of list. #881

Open rdmorris opened 4 years ago

rdmorris commented 4 years ago

I am unable to upgrade the database with List<String> photos; in the class.

The generated migration file shows the type as null. Future upgrade() async { database.addColumn("_Listing", SchemaColumn("photos", null, isPrimaryKey: false, autoincrement: false, isIndexed: false, isNullable: false, isUnique: false)); }

I changed the class to specify the type. @Column(databaseType: ManagedPropertyType.list) List<String> photos;

but the migration file was the same.

I updated the migration file manually and still am unable to upgrade the database. Future upgrade() async { database.addColumn("_Listing", SchemaColumn("photos", ManagedPropertyType.list, isPrimaryKey: false, autoincrement: false, isIndexed: false, isNullable: false, isUnique: false)); }

Here is the error: ALTER TABLE _Listing ADD COLUMN photos null NOT NULL *** There was an issue. Reason: syntax error at or near "null". Table: null Column: null

rdmorris commented 4 years ago

Also am unable to create columns with the name 'full';