Add test to verify migrations are not renaming columns or tables (mysql & postgre)
This commit is contained in:
1 parent
3b7d567d72
commit
47ca788d5b
1 file changed
+6
@@ -18,6 +18,12 @@ class MigrationLinter:
|
|||||||
}, {
|
}, {
|
||||||
'fn': lambda sql: re.search('ADD COLUMN .* DEFAULT', sql),
|
'fn': lambda sql: re.search('ADD COLUMN .* DEFAULT', sql),
|
||||||
'err_msg': 'ADD columns with default'
|
'err_msg': 'ADD columns with default'
|
||||||
|
}, {
|
||||||
|
'fn': lambda sql: re.search('ALTER TABLE .* CHANGE', sql) or re.search('ALTER TABLE .* RENAME COLUMN', sql), # mysql or postgre
|
||||||
|
'err_msg': 'RENAMING columns'
|
||||||
|
}, {
|
||||||
|
'fn': lambda sql: re.search('RENAME TABLE', sql) or re.search('ALTER TABLE .* RENAME TO', sql), # mysql or postgre
|
||||||
|
'err_msg': 'RENAMING tables'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user