u
This commit is contained in:
@@ -19,7 +19,7 @@ function parseSchema(source) {
|
|||||||
const initName = initMatch[1];
|
const initName = initMatch[1];
|
||||||
const sqlBlock = initMatch[2];
|
const sqlBlock = initMatch[2];
|
||||||
|
|
||||||
const createRegex = /CREATE TABLE\s+(\w+)\s*\(([\s\S]*?)\);/gi;
|
const createRegex = /CREATE TABLE\s+\[?(\w+)\]?\s*\(([\s\S]*?)\);/gi;
|
||||||
let createMatch;
|
let createMatch;
|
||||||
|
|
||||||
while ((createMatch = createRegex.exec(sqlBlock)) !== null) {
|
while ((createMatch = createRegex.exec(sqlBlock)) !== null) {
|
||||||
@@ -89,7 +89,7 @@ function parseSchema(source) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const alterAddColumnRegex =
|
const alterAddColumnRegex =
|
||||||
/ALTER TABLE\s+(\w+)\s+ADD\s+(\w+)\s+([\w]+(?:\([^)]*\))?)(?:\s+(NOT NULL|NULL))?\s*;/gi;
|
/ALTER TABLE\s+\[?(\w+)\]?\s+ADD\s+\[?(\w+)\]?\s+([\w]+(?:\([^)]*\))?)(?:\s+(NOT NULL|NULL))?\s*;/gi;
|
||||||
let alterColumnMatch;
|
let alterColumnMatch;
|
||||||
|
|
||||||
while ((alterColumnMatch = alterAddColumnRegex.exec(sqlBlock)) !== null) {
|
while ((alterColumnMatch = alterAddColumnRegex.exec(sqlBlock)) !== null) {
|
||||||
@@ -105,7 +105,7 @@ function parseSchema(source) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const alterFkRegex =
|
const alterFkRegex =
|
||||||
/ALTER TABLE\s+(\w+)\s+ADD CONSTRAINT\s+(\w+)\s+FOREIGN KEY\s*\(([^)]+)\)\s+REFERENCES\s+\[?(\w+)\]?\(([^)]+)\)(?:\s+ON DELETE\s+([\w\s]+?))?\s*;/gi;
|
/ALTER TABLE\s+\[?(\w+)\]?\s+ADD CONSTRAINT\s+(\w+)\s+FOREIGN KEY\s*\(([^)]+)\)\s+REFERENCES\s+\[?(\w+)\]?\(([^)]+)\)(?:\s+ON DELETE\s+([\w\s]+?))?\s*;/gi;
|
||||||
let alterMatch;
|
let alterMatch;
|
||||||
|
|
||||||
while ((alterMatch = alterFkRegex.exec(sqlBlock)) !== null) {
|
while ((alterMatch = alterFkRegex.exec(sqlBlock)) !== null) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
1426
schema-graph.svg
1426
schema-graph.svg
File diff suppressed because it is too large
Load Diff
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 203 KiB |
Reference in New Issue
Block a user