Hello everyone,
First question in here ![]()
does anyone know how to deal efficiently with apps that share the same model.
Does it always go back to handling the migration files manually, just copying the common model class between two models.py files.
It results either in data loss on database level or one of the table is not even created :
app1_modelnameX , app2_modelnameX ![]()
Django creates the migrations but does not apply it.
an example of the initial migrations in the new app that django ignored or considered it done.
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Species',
fields=[
('species_id', models.SmallIntegerField(primary_key=True, serialize=False)),
('scientific_name', models.CharField(blank=True, max_length=50, null=True)),
('species_date', models.SmallIntegerField(blank=True, null=True)),
('version', models.CharField(blank=True, max_length=50, null=True)),
('species_name', models.CharField(max_length=50)),
('link_ucsc', models.CharField(blank=True, max_length=10, null=True)),
('link_ncbi', models.IntegerField(blank=True, null=True)),
('link_ensembl', models.CharField(blank=True, max_length=50, null=True)),
('order_id', models.SmallIntegerField(unique=True)),
('islowcov', models.SmallIntegerField(default=0)),
],
),
]