{"id":20636814,"url":"https://github.com/tombenner/heroku-schemas","last_synced_at":"2025-10-31T08:44:38.726Z","repository":{"id":12205429,"uuid":"14811301","full_name":"tombenner/heroku-schemas","owner":"tombenner","description":"Run many apps on a single database","archived":false,"fork":false,"pushed_at":"2013-11-30T01:00:53.000Z","size":136,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T21:48:45.982Z","etag":null,"topics":["heroku","heroku-plug-in","postgres","postgresql"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/tombenner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-29T22:28:30.000Z","updated_at":"2022-03-28T13:03:58.000Z","dependencies_parsed_at":"2022-08-20T23:10:24.000Z","dependency_job_id":null,"html_url":"https://github.com/tombenner/heroku-schemas","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/tombenner%2Fheroku-schemas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombenner%2Fheroku-schemas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombenner%2Fheroku-schemas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombenner%2Fheroku-schemas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tombenner","download_url":"https://codeload.github.com/tombenner/heroku-schemas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249161104,"owners_count":21222468,"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","heroku-plug-in","postgres","postgresql"],"created_at":"2024-11-16T15:12:13.220Z","updated_at":"2025-10-31T08:44:33.687Z","avatar_url":"https://github.com/tombenner.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Heroku Schemas\n==============\nRun many apps on a single database\n\nDescription\n-----------\n\nHeroku Schemas lets you run multiple Heroku apps on top of a single Heroku Postgres database. A Postgres database can have multiple \"schemas\" (basically Postgres's word for database \"namespaces\"), and Heroku Schemas simply makes each app use its own schema within a single, shared database.\n\nFor example, if you have five apps with small levels of traffic, instead of using five databases, you can now just use one database with five schemas to serve all of them.\n\nInstallation\n------------\n\nInstall the plugin:\n\n```sh\nheroku plugins:install git://github.com/tombenner/heroku-schemas.git\n```\n\nUsage\n-----\n\nTo make an app use a schema named `my_schema` in the database of an app called `my-other-app`:\n\n```sh\ncd path/to/my-app\nheroku schemas:use my-other-app:my_schema\n```\n\nThis copies the app's database into the new schema and makes the app use it. You can then remove the original database from your plan.\n\nHeroku Schemas also lets you see what database/schema the current app is using (`show`) and drop schemas (`drop`).\n\nCommands\n--------\n\n### Use\n\nMake the app in the current directory use a new database/schema. If the app has an existing database, it is copied to the target database/schema. \n\nThe following command makes my-app use the schema `my_schema` in the default database of my-other-app:\n\n```sh\nheroku schemas:use my-other-app:my_schema\n```\n\nIf my-other-app has more than one database, you can specify which database the schema should be in: \n```sh\nheroku schemas:use my-other-app:HEROKU_POSTGRESQL_BLUE_URL:my_schema\n```\n\n(\"`BLUE`\"\" in `HEROKU_POSTGRESQL_BLUE_URL` should be replaced with the color name in the database's name.)\n\n### Show\n\nShow which database/schema is currently being used by the app.\n\n```sh\nheroku schemas:show\n=\u003e my-other-app:HEROKU_POSTGRESQL_BLUE_URL:my_schema\n```\n\n### Drop\n\nDrop (delete) the schema that is currently being used by the app. This is irreversible, so please be sure that you're dropping the intended schema.\n\n```sh\nheroku schemas:drop\n=\u003e Dropped schema my-other-app:HEROKU_POSTGRESQL_BLUE_URL:my_schema\n```\n\nTests\n-----\n\nThe feature tests create and manipulate two Heroku apps; to run them, you'll need to:\n\n```sh\ncp features/support/config.example.yml features/support/config.yml\n```\n\nAnd then edit config.yml to include your Heroku API key and a prefix for the app names (choose something unique to avoid naming conflicts with other people who are running these tests).\n\nNotes\n-----\n\nA shared database may not be wise for significant, production apps, but it may be worthwhile if you have multiple small apps or apps that are in development.\n\nHeroku Schemas is for educational purposes. The author assumes no liability for anything that happens to your data or your Heroku account while using Heroku Schemas.\n\nLicense\n-------\n\nHeroku Schemas is released under the MIT License. Please see the MIT-LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombenner%2Fheroku-schemas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftombenner%2Fheroku-schemas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombenner%2Fheroku-schemas/lists"}