Example #1
0
def add_trigger_function():
    """Used for older versions of Postres, or test runs where there are no
        migrations.
    """
    cursor = connection.cursor()
    sql = open(_join_with_project_path("trigger-function.sql")).read()
    cursor.execute(sql)
Example #2
0
def add_trigger_function():
    """Used for older versions of Postres, or test runs where there are no
        migrations.
    """
    cursor = connection.cursor()
    sql = open(_join_with_project_path("trigger-function.sql")).read()
    cursor.execute(sql)
Example #3
0
def change_detect(model):
    """Enable change detection on the requested model.
    """
    cursor = connection.cursor()
    sql = open(_join_with_project_path("trigger-attach.sql")).read()
    sql = sql.format(db_table=model._meta.db_table)
    cursor.execute(sql)
    return sql
Example #4
0
def change_detect(model):
    """Enable change detection on the requested model.
    """
    cursor = connection.cursor()
    sql = open(_join_with_project_path("trigger-attach.sql")).read()
    sql = sql.format(db_table=model._meta.db_table)
    cursor.execute(sql)
    return sql
Example #5
0
class Migration(migrations.Migration):

    dependencies = [
        ('pubsubpull', '0002_auto_20150513_0130'),
    ]

    operations = [
        migrations.RunSQL(
            open(_join_with_project_path("trigger-function.sql")).read()),
    ]