{"id":18482968,"url":"https://github.com/denismurphy/schema-duplicator","last_synced_at":"2025-04-08T18:32:07.770Z","repository":{"id":190055965,"uuid":"608855970","full_name":"denismurphy/schema-duplicator","owner":"denismurphy","description":"Schema Duplicator","archived":true,"fork":false,"pushed_at":"2024-08-14T14:40:10.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T20:06:16.676Z","etag":null,"topics":["duplicate","mysql","procedure","schema","sql","tables"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denismurphy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-03-02T21:58:25.000Z","updated_at":"2024-12-10T09:55:30.000Z","dependencies_parsed_at":"2024-11-06T12:38:34.115Z","dependency_job_id":null,"html_url":"https://github.com/denismurphy/schema-duplicator","commit_stats":null,"previous_names":["denismurphy/mysql-schema-duplicator","denismurphy/schema-duplicator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismurphy%2Fschema-duplicator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismurphy%2Fschema-duplicator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismurphy%2Fschema-duplicator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismurphy%2Fschema-duplicator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denismurphy","download_url":"https://codeload.github.com/denismurphy/schema-duplicator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247623009,"owners_count":20968574,"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":["duplicate","mysql","procedure","schema","sql","tables"],"created_at":"2024-11-06T12:32:34.122Z","updated_at":"2025-04-08T18:32:02.759Z","avatar_url":"https://github.com/denismurphy.png","language":null,"readme":"# 🔄 Schema Duplicator\n\nThis SQL script duplicates a schema without referential integrity. It creates a copy of the schema by iterating over all tables in the source schema, creating and inserting them into the target schema. The copy process does not include foreign key constraints.\n\n## 📋 Prerequisites\n\n- 🐬 MySQL\n- 🔑 Administrative privileges\n\n## 🚀 Usage\n\nTo use this script, simply call the `duplicate_schema` stored procedure and pass in the source and target schema names as parameters. For example:\n\n```sql\nCALL duplicate_schema('source_schema', 'target_schema');\n```\n\n## 📝 Procedure Steps\n\n1. 📍 Declare cursor and handler\n2. 🏗️ Create target schema if it doesn't exist\n3. 📜 Get a list of tables in the source schema\n4. 🔁 Loop through the tables and create and insert into corresponding tables in the target schema\n5. 🗑️ Drop any foreign key constraints on the new table\n6. 📤 Output to SQL\n7. 🚪 Close the cursor\n\n## ⚠️ Limitations\n\nThis script does not copy foreign key constraints between tables. Therefore, the target schema will not have the same referential integrity as the source schema.\n\n## 📄 License\n\nThis script is licensed under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenismurphy%2Fschema-duplicator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenismurphy%2Fschema-duplicator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenismurphy%2Fschema-duplicator/lists"}