168 | | sql_file_name = os.path.join(app_dir, opts.module_name + '.sql') |
| 168 | from django.core import db |
| 169 | |
| 170 | # Get the sql file name for the init data for the current database engine |
| 171 | db_engine_sql_file_name = os.path.join(app_dir, opts.module_name + '.' + db.DATABASE_ENGINE.lower() + '.sql') |
| 172 | |
| 173 | # Check if the data specific file exists |
| 174 | if os.path.exists(db_engine_sql_file_name): |
| 175 | sql_file_name = db_engine_sql_file_name |
| 176 | # if the database specific file doesn't exist, use the database agnostic version |
| 177 | else: |
| 178 | sql_file_name = os.path.join(app_dir, opts.module_name + '.sql') |
| 179 | |