Django MySql:如何为每个模型选择存储引擎

MySQL provides various storage engines for its tables as below:

MyISAM数据

InnoDB的

合并

记忆(HEAP)

ARCHIVE

CSV

FEDERATED

how to use MyISAM for modelA and InnoDB for ModelB ?

class ModelA(models.Model):
    first_name = models.CharField(max_length=50)
    last_name = models.CharField(max_length=50)
    instrument = models.CharField(max_length=100)

class ModelB(models.Model):
    artist = models.ForeignKey(Musician, on_delete=models.CASCADE)
    name = models.CharField(max_length=100)
    release_date = models.DateField()
    num_stars = models.IntegerField()

回答(0)