Lines Matching refs:manager
1 def execute_safely(manager, statement): argument
3 manager.execute(statement)
8 def delete_duplicates(manager, table, first_id, second_id): argument
9 rows = manager.execute(
14 manager.execute('DELETE FROM %s '
22 def delete_invalid_foriegn_keys(manager, pivot_table, foreign_key_field, argument
24 manager.execute(
31 deleted_count = manager._database.rowcount
47 def create_unique_index(manager, pivot_table, first_field, second_field): argument
49 manager.execute('CREATE UNIQUE INDEX %s ON %s (%s, %s)' %
55 execute_safely(manager, 'DROP INDEX %s ON %s' %
59 def drop_unique_index(manager, pivot_table, first_field): argument
61 manager.execute('DROP INDEX %s ON %s' % (index_name, pivot_table))
64 manager.execute('CREATE INDEX %s ON %s (%s)' %
72 def create_foreign_key_constraint(manager, table, field, destination_table): argument
74 manager.execute('ALTER TABLE %s ADD CONSTRAINT %s FOREIGN KEY (%s) '
79 def drop_foreign_key_constraint(manager, table, field): argument
81 manager.execute('ALTER TABLE %s DROP FOREIGN KEY %s' % (table, key_name))
84 def cleanup_m2m_pivot(manager, pivot_table, first_field, first_table, argument
86 delete_duplicates(manager, pivot_table, first_field, second_field)
87 delete_invalid_foriegn_keys(manager, pivot_table, first_field, first_table)
88 delete_invalid_foriegn_keys(manager, pivot_table, second_field,
94 create_unique_index(manager, pivot_table, second_field, first_field)
96 create_foreign_key_constraint(manager, pivot_table, first_field,
98 create_foreign_key_constraint(manager, pivot_table, second_field,
102 def reverse_cleanup_m2m_pivot(manager, pivot_table, first_field, second_field, argument
104 drop_foreign_key_constraint(manager, pivot_table, second_field)
105 drop_foreign_key_constraint(manager, pivot_table, first_field)
107 drop_unique_index(manager, pivot_table, second_field)
124 def migrate_up(manager): argument
127 cleanup_m2m_pivot(manager, table, first_field, first_table,
131 def migrate_down(manager): argument
134 reverse_cleanup_m2m_pivot(manager, table, first_field, second_field,