{"id":22779188,"url":"https://github.com/platzi-master-c8/automation-database","last_synced_at":"2025-03-30T14:14:01.360Z","repository":{"id":116140178,"uuid":"451511032","full_name":"Platzi-Master-C8/automation-database","owner":"Platzi-Master-C8","description":"This is how was created the database for Automation cell in Heroku-Postgres 🚀🛢️","archived":false,"fork":false,"pushed_at":"2022-02-15T02:45:00.000Z","size":1023,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-05T15:50:45.033Z","etag":null,"topics":["heroku-postgres","postgres","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Platzi-Master-C8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-24T15:04:40.000Z","updated_at":"2022-02-05T16:20:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2c88e51-c8cc-4149-b908-f8acb62fc3af","html_url":"https://github.com/Platzi-Master-C8/automation-database","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Platzi-Master-C8%2Fautomation-database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Platzi-Master-C8%2Fautomation-database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Platzi-Master-C8%2Fautomation-database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Platzi-Master-C8%2Fautomation-database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Platzi-Master-C8","download_url":"https://codeload.github.com/Platzi-Master-C8/automation-database/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246326791,"owners_count":20759439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["heroku-postgres","postgres","sql"],"created_at":"2024-12-11T20:07:58.735Z","updated_at":"2025-03-30T14:14:01.354Z","avatar_url":"https://github.com/Platzi-Master-C8.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deployment of a PostgreSQL Database in Heroku \n\nThis is how was created the database for Automation Cell in Heroku-Postgres.\n\nIs written as instructions in order to replicate the process if necessary:\n\n## 1 Set a Postgres Database\n1. Create a new Heroku app.\n\t![new_app](assets/new_app.png)\n2. Add a PostgreSQL database:\n\t*  Navigate to the Resources tab in the header of your newly created app's dahsboard. \n\t*  Then type Heroku Postgres into the Add-ons search field.When shown, select the suggested Heroku Postgres add-on from the dropdown.\n\t![heroku_postgres](assets/heroku_postgres.png)\n\t*  The next popup asks you to choose a pricing plan for the database. Select the Hobby Dev - Free plan and click Provision.\n3. Access the database credentials (and connection URL)\n\t* Navigate to the Resources tab in your app's dashboard again and select the Heroku Postgres resource.\n\t* Now select the Settings tab in the header of that screen.\n\t* Here, you can click the View Credentials button to see the credentials of your PostgreSQL database.\n\t![credentials](assets/credentials.png)\n\n## 2 Configure Heroku CLI\n\nThe Heroku Command Line Interface (CLI) makes it easy to create and manage your Heroku apps directly from the terminal. \nIt’s an essential part of using Heroku.\n\n* In case you dont have installed follow the instructons from Heroku site](https://devcenter.heroku.com/articles/heroku-cli)\n* Login in your terminal.\n\t```\n\theroku login\n\t```\n* To test the conection you should introduce credentials:\n\t```\n\theroku pg:psql postgresql-solid-19555 --app name_app\n\t```\n\t![connection_test](assets/test_connection.jpg)\n\n## 3. Write a Postgres script to create the database schema.\n\nAccording to ER diagmam write the sentences to create the database schema. ➡️ [create_schema.sql](SQL_scripts/create_schema.sql)\n\n![Database ER Diagram](assets/Automation_ER.png)\n\n## 4. Send database schemas to Heroku from terminal\n\n* Introduce the sentences to create the database tables:\n\n```\nheroku pg:psql --app automation-db \u003c create_schema.sql \n```\nHere you have a database in Heroku and it's ready to store data.\n\n![tables](assets/schema.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatzi-master-c8%2Fautomation-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplatzi-master-c8%2Fautomation-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatzi-master-c8%2Fautomation-database/lists"}