360360 < ul class ="md-nav__list " data-md-component ="toc " data-md-scrollfix >
361361
362362 < li class ="md-nav__item ">
363- < a href ="#1-initialise -a-project " class ="md-nav__link ">
363+ < a href ="#1-create -a-env-file " class ="md-nav__link ">
364364 < span class ="md-ellipsis ">
365- 1. Initialise a project
365+ 1. Create a .env file
366366 </ span >
367367 </ a >
368368
369369</ li >
370370
371371 < li class ="md-nav__item ">
372- < a href ="#2-create -a-migration " class ="md-nav__link ">
372+ < a href ="#2-initialise -a-project " class ="md-nav__link ">
373373 < span class ="md-ellipsis ">
374- 2. Create a migration
374+ 2. Initialise a project
375375 </ span >
376376 </ a >
377377
378378</ li >
379379
380380 < li class ="md-nav__item ">
381- < a href ="#3-deploy-it " class ="md-nav__link ">
381+ < a href ="#3-create-a-migration " class ="md-nav__link ">
382382 < span class ="md-ellipsis ">
383- 3. Deploy it
383+ 3. Create a migration
384+ </ span >
385+ </ a >
386+
387+ </ li >
388+
389+ < li class ="md-nav__item ">
390+ < a href ="#4-deploy-it " class ="md-nav__link ">
391+ < span class ="md-ellipsis ">
392+ 4. Deploy it
384393 </ span >
385394 </ a >
386395
487496 < ul class ="md-nav__list " data-md-component ="toc " data-md-scrollfix >
488497
489498 < li class ="md-nav__item ">
490- < a href ="#1-initialise -a-project " class ="md-nav__link ">
499+ < a href ="#1-create -a-env-file " class ="md-nav__link ">
491500 < span class ="md-ellipsis ">
492- 1. Initialise a project
501+ 1. Create a .env file
493502 </ span >
494503 </ a >
495504
496505</ li >
497506
498507 < li class ="md-nav__item ">
499- < a href ="#2-create -a-migration " class ="md-nav__link ">
508+ < a href ="#2-initialise -a-project " class ="md-nav__link ">
500509 < span class ="md-ellipsis ">
501- 2. Create a migration
510+ 2. Initialise a project
502511 </ span >
503512 </ a >
504513
505514</ li >
506515
507516 < li class ="md-nav__item ">
508- < a href ="#3-deploy-it " class ="md-nav__link ">
517+ < a href ="#3-create-a-migration " class ="md-nav__link ">
509518 < span class ="md-ellipsis ">
510- 3. Deploy it
519+ 3. Create a migration
520+ </ span >
521+ </ a >
522+
523+ </ li >
524+
525+ < li class ="md-nav__item ">
526+ < a href ="#4-deploy-it " class ="md-nav__link ">
527+ < span class ="md-ellipsis ">
528+ 4. Deploy it
511529 </ span >
512530 </ a >
513531
533551
534552
535553< h1 id ="usage "> 🛠️ Usage</ h1 >
536- < h2 id ="1-initialise-a-project "> 1. Initialise a project</ h2 >
537- < div class ="highlight "> < pre > < span > </ span > < code > iko< span class ="w "> </ span > init< span class ="w "> </ span > --target< span class ="w "> </ span > db:pg://user:pass@postgres/dbname< span class ="w "> </ span > myapp
554+ < h2 id ="1-create-a-env-file "> 1. Create a < code > .env</ code > file</ h2 >
555+ < div class ="highlight "> < pre > < span > </ span > < code > < span class ="nb "> echo</ span > < span class ="w "> </ span > < span class ="s1 "> 'PG_URI=pg://user:pass@postgres/app'</ span > < span class ="w "> </ span > >< span class ="w "> </ span > .env
556+ </ code > </ pre > </ div >
557+ < h2 id ="2-initialise-a-project "> 2. Initialise a project</ h2 >
558+ < div class ="highlight "> < pre > < span > </ span > < code > iko< span class ="w "> </ span > init< span class ="w "> </ span > --target< span class ="w "> </ span > < span class ="s1 "> '$PG_URI'</ span > < span class ="w "> </ span > myapp
538559</ code > </ pre > </ div >
539- < p > This creates a new project with a < code > sqitch.plan</ code > , ready for migrations.</ p >
540- < h2 id ="2-create-a-migration "> 2. Create a migration</ h2 >
560+ < p > This creates a new Sqitch project in a < code > migrations</ code > directory. The target is
561+ set to an environment variable, so it stays portable across dev, CI, and
562+ production environments.</ p >
563+ < h2 id ="3-create-a-migration "> 3. Create a migration</ h2 >
541564< div class ="highlight "> < pre > < span > </ span > < code > iko< span class ="w "> </ span > create_schema< span class ="w "> </ span > api
542565</ code > </ pre > </ div >
543566< div class ="highlight "> < pre > < span > </ span > < code > Created deploy/create_schema_api.sql
@@ -552,8 +575,8 @@ <h2 id="2-create-a-migration">2. Create a migration</h2>
552575< li > The change was added to sqitch.plan.</ li >
553576< li > The deploy script was output for your review.</ li >
554577</ ul >
555- < h2 id ="3 -deploy-it "> 3 . Deploy it</ h2 >
556- < p > Make sure your database is running, then:</ p >
578+ < h2 id ="4 -deploy-it "> 4 . Deploy it</ h2 >
579+ < p > Ensure your Postgres server is running, then:</ p >
557580< div class ="highlight "> < pre > < span > </ span > < code > iko< span class ="w "> </ span > deploy
558581</ code > </ pre > </ div >
559582
0 commit comments