38087-vm/fix_seeder_table.py
2026-02-05 06:00:46 +00:00

16 lines
428 B
Python

import re
file_path = 'backend/src/db/seeders/20200430130760-user-roles.js'
with open(file_path, 'r') as f:
content = f.read()
# Replace create table with create table if not exists
pattern = 'create table "rolesPermissionsPermissions"'
replacement = 'create table if not exists "rolesPermissionsPermissions"'
new_content = content.replace(pattern, replacement)
with open(file_path, 'w') as f:
f.write(new_content)