Skip to content

Create triggers for tables in unmigrated apps when run_syncdb is specified #112

Open

Description

@danifus

Django can create tables without migrations if an app is left 'unmigrated' (doesn't have a migrations package in the app) and the run_syncdb option is provided to the migrate command. By default tests are run with run_syncdb=True so unmigrated apps are created in the database. Django's tests use this feature extensively as it simplifies the testing workflow (changes to test models are immediately reflected in the test db without having to run makemigrations).

I would like to enhance django-pgtrigger so that triggers are created for unmigrated apps when run_syncdb=True

Here's the part of django's migrate command that creates the tables of unmigrated apps when run_syncdb option is set:

https://github.com/django/django/blob/1a7b6909ac030d2c4dae2664b08ee0bce9c4c915/django/core/management/commands/migrate.py#L321

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions