Page 2 of 2

Seeding Data

Proper also supports database seeding for test data or initial configuration. Add seed configuration to your proper.json:

proper.json
{
  "database": "sqlite",
  "sqlite": {
    "database": "./data/app.sqlite"
  },
  "migration_folder": "migrations",
  "migration_table": "proper_migrations",
  "seed": {
    "folder": "seeds",
    "table": "proper_seeds"
  }
}

Seed Files

Seed files follow the same up/down pattern as migrations:

seeds/001_sample_users.up.sql
-- seeds/001_sample_users.up.sql
INSERT INTO users (email, password_hash) VALUES
  ('admin@example.com', '$2b$10$...'),
  ('user@example.com', '$2b$10$...');
seeds/001_sample_users.down.sql
-- seeds/001_sample_users.down.sql
DELETE FROM users WHERE email IN ('admin@example.com', 'user@example.com');

Apply Seeds

terminal
npx proper seed up

Rollback Seeds

terminal
npx proper seed down

Command Reference

CommandDescription
npx proper create <name>Create a new migration with the given name
npx proper upApply all pending migrations
npx proper downRollback the last applied migration
npx proper resetRollback all migrations and reapply them
npx proper statusShow migration status and pending migrations
npx proper seed upRun all pending seed files
npx proper seed downRollback the last applied seed

Typical Workflow

1

Create a migration

npx proper create add_posts_table
2

Write the up and down SQL

Edit the generated .up.sql and .down.sql files

3

Apply the migration

npx proper up
4

Verify with status

npx proper status
5

Commit the migration files

Add migration files to version control

Page 2 of 2
NoEgo

© 2025 NoEgo. All rights reserved.