Josh Feinberg
10/10/2023, 4:03 AMJosh Feinberg
10/10/2023, 4:04 AMMain.sq file
CREATE TABLE holding (
accountId TEXT NOT NULL,
securityId TEXT NOT NULL,
costBasis REAL NOT NULL
)
i then created a migration 1.sqm file that has
ALTER TABLE holding ADD COLUMN timestamp INTEGER AS Instant NOT NULL DEFAULT 0;
however i get a compile errorJosh Feinberg
10/10/2023, 4:04 AMderiveSchemaFromMigrations set to true, i get an error in the .sq that "Table already defined with name holding"Josh Feinberg
10/10/2023, 4:05 AMfalse then i get an error in the .sqm that "No table found with name holding"hfhbd
10/10/2023, 5:36 AMRafs
10/10/2023, 6:51 AMno such table error when I try to execute the selectAll query.dhia chemingui
10/10/2023, 12:43 PMdhia chemingui
10/10/2023, 12:44 PMJosh Feinberg
10/10/2023, 3:51 PMtimestamp to the sq file but i still get those errors. will try to move all table definitions to 0.sqm but not sure if thats a great fixdhia chemingui
10/10/2023, 4:13 PMRafs
10/10/2023, 4:14 PM1.sqm and adding the other queries into my .sq fileJosh Feinberg
10/10/2023, 4:15 PMRafs
10/10/2023, 4:15 PMIF NOT EXISTS will skip table creation if it existsdhia chemingui
10/10/2023, 4:16 PMRafs
10/10/2023, 4:16 PM1.sqmdhia chemingui
10/10/2023, 4:17 PMdhia chemingui
10/10/2023, 4:18 PMhfhbd
10/10/2023, 7:59 PMIF NOT EXISTS, you should just conditionally run the schema.create function (or use pragma version).Josh Feinberg
10/10/2023, 8:02 PMhfhbd
10/10/2023, 8:04 PMJosh Feinberg
10/10/2023, 8:11 PMhockeyPlayer in the docs in defined in Player.sq then the alter function is defined in 1.sqm which is exactly what i'm trying to do so it seems like you are saying that is wrong?