sql-up will apply the migration after lasted-non applied magic marker -- sql-up in the SQL file.
-- sql-up
-- Create table
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL
);
-- sql-up
ALTER TABLE users ADD COLUMN email TEXT NULL;
-- sql-up
ALTER TABLE users ADD COLUMN address TEXT NULL;
sql-up does that by creating a new table sql_up in the database to store the last applied file content and compare with the input file content to determine the migration. This mean the SQL file must be append-only.