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)
Exemple #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)
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
Exemple #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
Exemple #5
0
class Migration(migrations.Migration):

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

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