{"id":17044766,"url":"https://github.com/keredson/schema-evolve","last_synced_at":"2026-04-29T08:02:56.419Z","repository":{"id":224644960,"uuid":"763827621","full_name":"keredson/schema-evolve","owner":"keredson","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-06T04:08:43.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-25T13:42:42.419Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keredson.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":"2024-02-27T01:39:58.000Z","updated_at":"2024-03-05T23:59:57.000Z","dependencies_parsed_at":"2024-02-27T02:47:36.182Z","dependency_job_id":"25986408-eb9e-4d53-b99e-2e2d293af084","html_url":"https://github.com/keredson/schema-evolve","commit_stats":null,"previous_names":["keredson/schema_diff","keredson/schema-evolve"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/keredson/schema-evolve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keredson%2Fschema-evolve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keredson%2Fschema-evolve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keredson%2Fschema-evolve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keredson%2Fschema-evolve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keredson","download_url":"https://codeload.github.com/keredson/schema-evolve/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keredson%2Fschema-evolve/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32416146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-14T09:35:25.876Z","updated_at":"2026-04-29T08:02:56.402Z","avatar_url":"https://github.com/keredson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Schema Evolve\n=============\n\nThis is a schema evolution tool (currently only for sqlite).  It will diff schema changes between two databases or `.sql` files, and optionally apply them.\n\nWhy?\n----\n\nI mean, Sqlite3 has `sqldiff --schema` right?  Well, given...\n\n\n```\n$ sqlite3 schema1.db \"select sql from sqlite_schema\"\nCREATE TABLE tbl (\n  a text\n)\n$ sqlite3 schema2.db \"select sql from sqlite_schema\"\nCREATE TABLE tbl (\n  a text\n, b text\n)\n```\n\nThis works: 👏\n\n```\n$ sqldiff --schema schema1.db schema2.db \nALTER TABLE tbl ADD COLUMN b;\n```\n\nBut this is why I have trust issues... 🤯🤬\n\n```\n$ sqldiff --schema schema2.db schema1.db \nDROP TABLE tbl; -- due to schema mismatch\nCREATE TABLE tbl (\n  a text\n);\n```\n\nInstall\n-------\n```\n$ pip install schema-evolve\n```\n\nUsage\n-----\n```\n$ python -m schema_evolve data/schema1.db data/schema2.sql --apply\nExisting Database: data/schema1.db (to modify)\nTarget Schema: data/schema2.sql\nCalculated Changes:\n  ALTER TABLE \"tbl\" ADD COLUMN b text;\nApply changes? (y/n) y\nStarting Test Run: /tmp/tmpdr5vopek/test.db\n  ALTER TABLE \"tbl\" ADD COLUMN b text;\nSuccess!\nStarting Actual Run: data/schema1.db\n  in: 5... 4... 3... 2... 1... \n  ALTER TABLE \"tbl\" ADD COLUMN b text;\nSuccess!\n```\n\n```\n$ python schema_evolve.py \nSchema Diff Tool\nschema_evolve() missing 2 required positional arguments: 'existing_db' and 'schema_sql'\nusage: python schema_evolve.py \u003cexisting_db\u003e \u003cschema_sql\u003e [--dry_run] [--skip_dry_run] [--assume-yes] [--quiet]\n```\n\nRenaming\n--------\n\nTo rename a column, add a special comment on the same line specifying the old name.  Example:\n\n```\nCREATE TABLE users (\n  id INT PRIMARY KEY,\n  ip_address TEXT, -- AKA[ip]\n)\n```\n\nThis would rename the column `ip` to `ip_address`.\n\nFor tables:\n\n```\nCREATE TABLE clients ( -- AKA[users]\n  id INT PRIMARY KEY,\n  name TEXT\n)\n```\n\nThis would rename the `users` table to `clients`.\n\n\nTesting\n-------\n```\n$$ pytest test.py -vv\n============================================ test session starts ============================================\nplatform linux -- Python 3.11.6, pytest-7.4.0, pluggy-1.2.0 -- /usr/bin/python3\ncachedir: .pytest_cache\nrootdir: /home/derek/projects/schema_diff\nplugins: requests-mock-1.9.3\ncollected 38 items                                                                                          \n\ntest.py::test_add_table PASSED                                                                        [  2%]\ntest.py::test_drop_table PASSED                                                                       [  5%]\ntest.py::test_rename_table PASSED                                                                     [  7%]\ntest.py::test_rename_table2 PASSED                                                                    [ 10%]\ntest.py::test_add_column PASSED                                                                       [ 13%]\ntest.py::test_add_column_to_table_with_pk PASSED                                                      [ 15%]\ntest.py::test_add_column_to_multiple_uniques PASSED                                                   [ 18%]\ntest.py::test_add_pk PASSED                                                                           [ 21%]\ntest.py::test_add_column_to_renamed_table PASSED                                                      [ 23%]\ntest.py::test_delete_column_from_renamed_table PASSED                                                 [ 26%]\ntest.py::test_drop_column PASSED                                                                      [ 28%]\ntest.py::test_rename_column PASSED                                                                    [ 31%]\ntest.py::test_rename_two_columns PASSED                                                               [ 34%]\ntest.py::test_rename_table_and_column PASSED                                                          [ 36%]\ntest.py::test_rename_weird_spacing PASSED                                                             [ 39%]\ntest.py::test_ambiguous_rename_column PASSED                                                          [ 42%]\ntest.py::test_ambiguous_rename_table PASSED                                                           [ 44%]\ntest.py::test_change_column_def PASSED                                                                [ 47%]\ntest.py::test_add_not_null PASSED                                                                     [ 50%]\ntest.py::test_add_not_null_with_default PASSED                                                        [ 52%]\ntest.py::test_add_view PASSED                                                                         [ 55%]\ntest.py::test_drop_view PASSED                                                                        [ 57%]\ntest.py::test_drop_table_with_view PASSED                                                             [ 60%]\ntest.py::test_add_unique PASSED                                                                       [ 63%]\ntest.py::test_add_multi_column_unique PASSED                                                          [ 65%]\ntest.py::test_add_column_and_multi_column_unique PASSED                                               [ 68%]\ntest.py::test_drop_unique_no_apply PASSED                                                             [ 71%]\ntest.py::test_drop_unique PASSED                                                                      [ 73%]\ntest.py::test_parse_create_table PASSED                                                               [ 76%]\ntest.py::test_parse_create_table_with_comment PASSED                                                  [ 78%]\ntest.py::test_parse_create_table_with_comments PASSED                                                 [ 81%]\ntest.py::test_parse_create_table_with_table_comment PASSED                                            [ 84%]\ntest.py::test_parse_create_table_with_table_comment2 PASSED                                           [ 86%]\ntest.py::test_parse_create_table_with_inner_comment PASSED                                            [ 89%]\ntest.py::test_add_table2 PASSED                                                                       [ 92%]\ntest.py::test_json_column PASSED                                                                      [ 94%]\ntest.py::test_change_text_to_json PASSED                                                              [ 97%]\ntest.py::test_read_files PASSED                                                                       [100%]\n\n============================================ 38 passed in 0.07s =============================================\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeredson%2Fschema-evolve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeredson%2Fschema-evolve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeredson%2Fschema-evolve/lists"}