0
I am developing an app, my problem is that with app updates I can use other tables that do not yet exist in the existing database. The solution that came to mind was always before entering a value check if the table already exists, but I’m having problems to do this.
Query:
await db.execute('''
CREATE TABLE IF NOT EXISTS Order (
id INT PRIMARY KEY,
order TEXT NOT NULL
)
''');
Error Received:
Exception has occurred.
SqfliteDatabaseException (DatabaseException(near "Order": syntax error (code 1): , while compiling: CREATE TABLE IF NOT EXISTS Order (
id INT PRIMARY KEY,
order TEXT NOT NULL
)) sql ' CREATE TABLE IF NOT EXISTS Order (
id INT PRIMARY KEY,
order TEXT NOT NULL
)
' args []})
Does the query have syntax errors or does Sqflite not support this type of approach? What I could do in this house?