mirror of https://github.com/AMT-Cheif/drift.git
auto increment support for MariaDB
This commit is contained in:
parent
910e063ab8
commit
192472201f
|
@ -16,9 +16,19 @@ Map<SqlDialect, String> defaultConstraints(DriftColumn column) {
|
||||||
for (final feature in column.constraints) {
|
for (final feature in column.constraints) {
|
||||||
if (feature is PrimaryKeyColumn) {
|
if (feature is PrimaryKeyColumn) {
|
||||||
if (!wrotePkConstraint) {
|
if (!wrotePkConstraint) {
|
||||||
defaultConstraints.add(feature.isAutoIncrement
|
if (feature.isAutoIncrement) {
|
||||||
? 'PRIMARY KEY AUTOINCREMENT'
|
for (final dialect in SqlDialect.values) {
|
||||||
: 'PRIMARY KEY');
|
if (dialect == SqlDialect.mariadb) {
|
||||||
|
dialectSpecificConstraints[dialect]!
|
||||||
|
.add('PRIMARY KEY AUTO_INCREMENT');
|
||||||
|
} else {
|
||||||
|
dialectSpecificConstraints[dialect]!
|
||||||
|
.add('PRIMARY KEY AUTOINCREMENT');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
defaultConstraints.add('PRIMARY KEY');
|
||||||
|
}
|
||||||
|
|
||||||
wrotePkConstraint = true;
|
wrotePkConstraint = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue