Just to close the loop on this, the solution as you say and easiest was to recreate tables. The quickest and safest way for me
- Delete all migration files in apps
- Change schema name in settings.py
- Makemigrations and migrate
- importing was a problem as table structures had changed from previous, so SQL inserts had to be precise and took a while. Not sure if there is a better way around it
one table example SQL insert as below ; and many others but just to be careful with the inserts and constraints as table structure has changed since you are making it from fresh
insert into trackemupgrade.UploadExcel_historicalactionitems
(id,StudyActionNo,StudyName,Facility,ProjectPhase,Cause,Safeguard,Consequence,Recommendations,InitialRisk,ResidualRisk,Response,Organisation,
Disipline,Subdisipline,FutureAction,DueDate,QueSeries,QueSeriesTarget,Guidewords,Deviation,Revision,DateCreated,history_id,history_date,
history_change_reason,history_type,history_user_id)
select
trackem.UploadExcel_historicalactionitems.id, trackem.UploadExcel_historicalactionitems.StudyActionNo, trackem.UploadExcel_historicalactionitems.StudyName, trackem.UploadExcel_historicalactionitems.Facility, trackem.UploadExcel_historicalactionitems.ProjectPhase, trackem.UploadExcel_historicalactionitems.Cause, trackem.UploadExcel_historicalactionitems.Safeguard, trackem.UploadExcel_historicalactionitems.Consequence, trackem.UploadExcel_historicalactionitems.Recommendations, trackem.UploadExcel_historicalactionitems.InitialRisk, trackem.UploadExcel_historicalactionitems.ResidualRisk, trackem.UploadExcel_historicalactionitems.Response, trackem.UploadExcel_historicalactionitems.Organisation, trackem.UploadExcel_historicalactionitems.Disipline, trackem.UploadExcel_historicalactionitems.Subdisipline, trackem.UploadExcel_historicalactionitems.FutureAction, trackem.UploadExcel_historicalactionitems.DueDate, trackem.UploadExcel_historicalactionitems.QueSeries, trackem.UploadExcel_historicalactionitems.QueSeriesTarget, trackem.UploadExcel_historicalactionitems.Guidewords, trackem.UploadExcel_historicalactionitems.Deviation, trackem.UploadExcel_historicalactionitems.Revision, trackem.UploadExcel_historicalactionitems.DateCreated, trackem.UploadExcel_historicalactionitems.history_id, trackem.UploadExcel_historicalactionitems.history_date, trackem.UploadExcel_historicalactionitems.history_change_reason, trackem.UploadExcel_historicalactionitems.history_type, trackem.UploadExcel_historicalactionitems.history_user_id
from trackem.UploadExcel_historicalactionitems;