fix(editor): Change the underlying data store db column types to support decimal numbers (#18549)

This commit is contained in:
Jaakko Husso
2025-08-20 14:06:56 +02:00
committed by GitHub
parent afaa0bec71
commit 25d6636711
4 changed files with 67 additions and 8 deletions

View File

@@ -9,7 +9,8 @@ export class Column {
| 'json'
| 'timestamptz'
| 'timestamp'
| 'uuid';
| 'uuid'
| 'double';
private isGenerated = false;
@@ -39,6 +40,11 @@ export class Column {
return this;
}
get double() {
this.type = 'double';
return this;
}
varchar(length?: number) {
this.type = 'varchar';
this.length = length ?? 'auto';
@@ -162,6 +168,14 @@ export class Column {
if (isMysql) options.type = 'varchar(36)';
// we haven't been defining length on "uuid" varchar on sqlite
if (isSqlite) options.type = 'varchar';
} else if (type === 'double') {
if (isPostgres) {
options.type = 'double precision';
} else if (isMysql) {
options.type = 'double';
} else if (isSqlite) {
options.type = 'real';
}
}
if (