-
Notifications
You must be signed in to change notification settings - Fork 12
Sepehr/step one #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Sepehr-Sobhani
wants to merge
6
commits into
button-inc:main
Choose a base branch
from
Sepehr-Sobhani:Sepehr/step_one
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Sepehr/step one #30
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
55f2a1c
Create .gitignore
Sepehr-Sobhani 7b239ff
Initialize sqitch configuration
Sepehr-Sobhani c6fc4c1
Add sqitch migration for creating the todo_app schema
Sepehr-Sobhani f458541
Set default deployment target and always verify
Sepehr-Sobhani ef4d70f
Add tasks table
Sepehr-Sobhani e995007
Add task seed data
Sepehr-Sobhani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| *.xml | ||
| *.idea | ||
| *.iml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| -- Deploy todo_app:insert_seed_task to pg | ||
| -- requires: tasks | ||
| -- requires: todo_appschema | ||
|
|
||
| BEGIN; | ||
|
|
||
| INSERT INTO | ||
| todo_app.tasks (task, completed) | ||
| VALUES | ||
| ('Buy milk', false), | ||
| ('Buy eggs', false), | ||
| ('Buy bread', true), | ||
| ('Buy coffee', false), | ||
| ('Buy tea', true), | ||
| ('Buy chocolate', false); | ||
|
|
||
| COMMIT; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| -- Deploy todo_app:tasks to pg | ||
| -- requires: todo_appschema | ||
|
|
||
| BEGIN; | ||
|
|
||
| CREATE TABLE todo_app.tasks ( | ||
| id SERIAL PRIMARY KEY, | ||
| task TEXT NOT NULL, | ||
| completed BOOLEAN NOT NULL DEFAULT FALSE, | ||
| date_created TIMESTAMP NOT NULL DEFAULT NOW(), | ||
| date_updated TIMESTAMP NOT NULL DEFAULT NOW() | ||
| ); | ||
|
|
||
| COMMIT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| -- Deploy todo_app:todo_appschema to pg | ||
|
|
||
| BEGIN; | ||
|
|
||
| CREATE SCHEMA todo_app; | ||
|
|
||
| COMMIT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| -- Revert todo_app:insert_seed_task from pg | ||
|
|
||
| BEGIN; | ||
|
|
||
| TRUNCATE TABLE todo_app.tasks ; | ||
|
|
||
| COMMIT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| -- Revert todo_app:tasks from pg | ||
|
|
||
| BEGIN; | ||
|
|
||
| DROP TABLE IF EXISTS todo_app.tasks; | ||
|
|
||
| COMMIT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| -- Revert todo_app:todo_appschema from pg | ||
|
|
||
| BEGIN; | ||
|
|
||
| DROP SCHEMA todo_app; | ||
|
|
||
| COMMIT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| [core] | ||
| engine = pg | ||
| # plan_file = sqitch.plan | ||
| # top_dir = . | ||
| # [engine "pg"] | ||
| # target = db:pg: | ||
| # registry = sqitch | ||
| # client = psql | ||
| [target "todo_app"] | ||
| uri = db:pg:todo_app | ||
| [engine "pg"] | ||
| target = todo_app | ||
| [deploy] | ||
| verify = true | ||
| [rebase] | ||
| verify = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| %syntax-version=1.0.0 | ||
| %project=todo_app | ||
| %uri=https://github.com/Sepehr-Sobhani/button-onboarding | ||
|
|
||
| todo_appschema 2022-04-06T21:11:50Z Sepehr Sobhani <sobhani.sepehr@gmail.com> # Add Schema for all todo app objects. | ||
| tasks [todo_appschema] 2022-04-07T18:34:52Z Sepehr Sobhani <sobhani.sepehr@gmail.com> # Creates table to track tasks. | ||
| insert_seed_task [tasks todo_appschema] 2022-04-07T20:37:04Z Sepehr Sobhani <sobhani.sepehr@gmail.com> # Create seed data for tasks table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| -- Verify todo_app:insert_seed_task on pg | ||
|
|
||
| BEGIN; | ||
|
|
||
| SELECT id, task, completed, date_created, date_updated FROM todo_app.tasks; | ||
|
|
||
| ROLLBACK; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| -- Verify todo_app:tasks on pg | ||
|
|
||
| BEGIN; | ||
|
|
||
| SELECT id, task, completed, date_created, date_updated FROM todo_app.tasks WHERE FALSE; | ||
|
|
||
| ROLLBACK; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| -- Verify todo_app:todo_appschema on pg | ||
|
|
||
| BEGIN; | ||
|
|
||
| DO $$ | ||
| BEGIN | ||
| ASSERT(SELECT pg_catalog.has_schema_privilege('todo_app', 'usage')); | ||
| END $$; | ||
|
|
||
|
|
||
| ROLLBACK; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the team uses lowercase SQL as a coding standard