{"id":17044793,"url":"https://github.com/keredson/deseb","last_synced_at":"2026-05-01T17:32:16.243Z","repository":{"id":11238059,"uuid":"13633067","full_name":"keredson/deseb","owner":"keredson","description":"Django External Schema Evolution Branch","archived":false,"fork":false,"pushed_at":"2014-06-26T14:56:54.000Z","size":312,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T05:41:37.130Z","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":null,"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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-16T22:33:27.000Z","updated_at":"2014-06-26T14:56:55.000Z","dependencies_parsed_at":"2022-07-12T15:04:15.979Z","dependency_job_id":null,"html_url":"https://github.com/keredson/deseb","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/keredson%2Fdeseb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keredson%2Fdeseb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keredson%2Fdeseb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keredson%2Fdeseb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keredson","download_url":"https://codeload.github.com/keredson/deseb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245047608,"owners_count":20552401,"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":[],"created_at":"2024-10-14T09:35:31.548Z","updated_at":"2026-05-01T17:32:16.197Z","avatar_url":"https://github.com/keredson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Django External Schema Evolution Branch\n=======================================\n\nThis project allows you to make Django model changes without having to\ndrop and re-add tables.  This project started as a Google Summer\nof Code project in 2006.\n\nQuick Start\n===========\nTo start using deseb, add the `import deseb` line after you set `DJANGO_SETTINGS_MODULE`\nin your `manage.py`.  Like this:\n\n```python\n#!/usr/bin/env python\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n    os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"myproject.settings\")\n    import deseb    # \u003c-- ADD THIS LINE\n    from django.core.management import execute_from_command_line\n\n    execute_from_command_line(sys.argv)\n```\n\n\nHow it Works\n============\nLet's say I have the following model:\n\n```python\nclass Review(models.Model):\n  when = models.DateTimeField(default=datetime.datetime.now)\n  text = models.TextField(blank=True, null=True)\n  rating = models.IntegerField(default=0)\n  appt = models.ForeignKey(Appointment)\n  user = models.ForeignKey(User)\n  uuid = UUIDField(version=4)\n```\n\nAnd I want to add a new column `response`:\n\n```python\nclass Review(models.Model):\n  when = models.DateTimeField(default=datetime.datetime.now)\n  text = models.TextField(blank=True, null=True)\n  response = models.TextField(blank=True, null=True)\n  rating = models.IntegerField(default=0)\n  appt = models.ForeignKey(Appointment)\n  user = models.ForeignKey(User)\n  uuid = UUIDField(version=4)\n```\n\nIf I run `./manage.py evolvedb`, I'll see:\n\n```sql\n$ ./manage.py evolvedb\nappthub: the following schema upgrade is available:\nALTER TABLE `appthub_review` ADD COLUMN `response` longtext;\ndo you want to run the preceeding commands?\ntype 'yes' to continue, or 'no' to cancel: yes\nschema upgrade executed\n```\n\nNow suppose I changed my mind on what that column should be called - it should be `response_text`:\n\n```python\nclass Review(models.Model):\n  when = models.DateTimeField(default=datetime.datetime.now)\n  text = models.TextField(blank=True, null=True)\n  response_text = models.TextField(blank=True, null=True, aka='response')\n  rating = models.IntegerField(default=0)\n  appt = models.ForeignKey(Appointment)\n  user = models.ForeignKey(User)\n  uuid = UUIDField(version=4)\n```\n\nNow I run `./manage.py evolvedb` again:\n\n```sql\n$ ./manage.py evolvedb\nappthub: the following schema upgrade is available:\nALTER TABLE `appthub_review` CHANGE COLUMN `response` `response_text` longtext NULL;\ndo you want to run the preceeding commands?\ntype 'yes' to continue, or 'no' to cancel: yes\nschema upgrade executed\n```\n\nNow supposed I thought this was a bad idea to begin with, so I change my model back to its original form:\n\n```python\nclass Review(models.Model):\n  when = models.DateTimeField(default=datetime.datetime.now)\n  text = models.TextField(blank=True, null=True)\n  rating = models.IntegerField(default=0)\n  appt = models.ForeignKey(Appointment)\n  user = models.ForeignKey(User)\n  uuid = UUIDField(version=4)\n```\n\nNow run `./manage.py evolvedb` again:\n\n```sql\n$ ./manage.py evolvedb\nappthub: the following schema upgrade is available:\n-- warning: the following may cause data loss\nALTER TABLE `appthub_review` DROP COLUMN `response_text`;\n-- end warning\ndo you want to run the preceeding commands?\ntype 'yes' to continue, or 'no' to cancel: yes\nschema upgrade executed\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeredson%2Fdeseb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeredson%2Fdeseb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeredson%2Fdeseb/lists"}