You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have read some issues related to this but I can't fix it while using the latest version. There is this column in my pgSQL server and the following query was successfully run.
Relevant log output
sql\queries\feeds.sql:17:1: column reference "last_fetched_at" not found: if you want to skip this validation, set'strict_order_by' to false
Database schema
-- +goose UpCREATETABLEfeeds(
id UUID PRIMARY KEY,
created_at TIMESTAMPNOT NULL,
updated_at TIMESTAMPNOT NULL,
name TEXTNOT NULL,
url TEXT UNIQUE NOT NULL,
user_id UUID NOT NULLREFERENCES users(id) ON DELETE CASCADE
);
-- +goose DownDROPTABLE feeds;
-- +goose upALTERTABLE feeds ADD COLUMN last_fetched_at TIMESTAMP;
-- +goose downALTERTABLE feeds DROP COLUMN last_fetched_at;
Does the migration part related to adding/dropping last_fetched_at is in the same file? Also, maybe the --- +goose Up/Down somehow differ from --- +goose up/down? Try to maybe split these in two different files, and ensure that goose comments are written in the same way, maybe it's gonna help
🙈
@G1tQuality Yep, it's like @snowtoslow said. I had exactly the same problem. It's about the typos in goose up & down tags.
Your last migration tags are lower case, it should be like "+goose Up".
Postgres can handle multiple migrations in a same file, that's not a problem. I think only sqlite doesn't support that. This will work:
-- +goose Up
ALTER TABLE feeds ADD COLUMN last_fetched_at TIMESTAMP;
-- +goose Down
ALTER TABLE feeds DROP COLUMN last_fetched_at;
Version
1.28.0
What happened?
I have read some issues related to this but I can't fix it while using the latest version. There is this column in my pgSQL server and the following query was successfully run.
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
No response
What operating system are you using?
Windows
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: