Migrating the database from legacy flask app to django

Viewed 40

Hello i have an existing app developed by Flask. It consists of a simple database but it doesn't have migrations (flask-migrate) ever since and the data grows more. If i enable the migrations on Django, could it screw the datas?

And in case if I disable the migrations, can Django writes up like the old existing ones? Currently hosted in postgresql db

Here's my old db model (Flask)

from database.db import db
class users(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    name = db.Column(db.String(255), unique=True)
    project = db.Column(db.String(255))
    reason = db.Column(db.String(255))
    timestamp = db.Column(db.DateTime, default=now)

And this is my new one (Django)

from django.db import models as db
class users(db.Model):
    class Meta:
        managed = False
    
    id = db.AutoField(primary_key=True)
    name = db.CharField(max_length=255, unique=True)
    project = db.CharField(max_length=255)
    reason = db.CharField(max_length=255)
    timestamp = db.DateTimeField(auto_now_add=True)
0 Answers
Related