{"id":35015650,"url":"https://github.com/mdda/sqlalchemy-migrate-pylons","last_synced_at":"2026-05-19T20:31:23.787Z","repository":{"id":1072175,"uuid":"913204","full_name":"mdda/sqlalchemy-migrate-pylons","owner":"mdda","description":"Simple script to migrate SQLalchemy databases used by Pylons","archived":false,"fork":false,"pushed_at":"2011-05-15T21:54:36.000Z","size":104,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-28T19:05:38.111Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://platformedia.com/oss-blog/sqlalchemy-model-migration/","language":"Python","has_issues":true,"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/mdda.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2010-09-15T18:11:11.000Z","updated_at":"2013-10-07T16:17:46.000Z","dependencies_parsed_at":"2022-08-16T11:55:27.603Z","dependency_job_id":null,"html_url":"https://github.com/mdda/sqlalchemy-migrate-pylons","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mdda/sqlalchemy-migrate-pylons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Fsqlalchemy-migrate-pylons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Fsqlalchemy-migrate-pylons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Fsqlalchemy-migrate-pylons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Fsqlalchemy-migrate-pylons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdda","download_url":"https://codeload.github.com/mdda/sqlalchemy-migrate-pylons/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Fsqlalchemy-migrate-pylons/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33231529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T15:49:41.270Z","status":"ssl_error","status_checked_at":"2026-05-19T15:49:22.917Z","response_time":58,"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":"2025-12-27T05:19:28.747Z","updated_at":"2026-05-19T20:31:23.772Z","avatar_url":"https://github.com/mdda.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Stupidly simple SQLalchemy model migration\n==========================================\n\nThis simple script pulls in the relavant database and model parameters from pylons .INI\n\nIt relies on the ``migrate`` egg for the ``diff`` and ``applyModel`` functions, and also makes use of the ConfigParser embedded in ``paste.deploy.loadwsgi``.\n\n*It is most useful when rapidly developing / prototyping a Pylons application.*\n\nInstallation of required modules\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\neasy_install SQLAlchemy\neasy_install sqlalchemy-migrate\n\n\nSetup of MYPROKJ .INI files and model meta files\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n1. Within the Pylons .INI file, it looks for a section called [app] *(the typical value is [app:main])*\n\n2. The database URL is found from ``sqlalchemy.url`` :\n\n    ``sqlalchemy.url = sqlite:///%(here)s/development.db``\n\n3. The metadata for SQLalchemy is taken from a new entry : ``migrate.metadata`` :\n\n    ``migrate.metadata = MYPROJ.model.meta:metadata``\n \n \nWhere the file MYPROJ/model/meta.py contains the following : ::\n\n    from sqlalchemy import schema\n    metadata = schema.MetaData()\n\n    # The declarative DataBase base Object\n    Base = declarative_base(metadata=metadata)\n\nSyntax \n------\n\n    (python-local) $ python sqlalchemy-migrate-pylons.py --help\n\n    Usage: sqlalchemy-migrate-pylons.py [options] STANDALONE.ini \n\n    Options:\n      -h, --help     show this help message and exit\n      -a, --app      section to parse in ini file (default=app:main)\n      -c, --commit   Use diffs to update database (default=False)\n      -v, --verbose  Show debug messages\n\nNormal usage\n------------\n\n1. To check what needs to be changed: \n\n    ``python sqlalchemy-migrate-pylons.py development.ini`` \n\n2. To implement the changes and report back:\n\n    ``python sqlalchemy-migrate-pylons.py --commit development.ini`` \n\n\nKnown Issues\n------------\n* Changing a model from ``nullable=True`` to ``nullable=False`` can be a problem, since the migrate package doesn't seem to understand ``default=''`` \n\n* The script is dependent on sqlalchemy-migrate, so could be incorporated into that package\n\n* OTOH, it would probably sit better as a Paster-Pylons plug-in\n\n* Please let me know if there are any other problems.\n\n**As always : Back up your data before doing a migrate.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdda%2Fsqlalchemy-migrate-pylons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdda%2Fsqlalchemy-migrate-pylons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdda%2Fsqlalchemy-migrate-pylons/lists"}