mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
Sql: REFERENCES in .sch now can be preset by Sql (prerequisite for introspection)
git-svn-id: svn://ultimatepp.org/upp/trunk@4174 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
9293301a76
commit
d14fa94a36
6 changed files with 24 additions and 1 deletions
|
|
@ -59,9 +59,12 @@
|
|||
"drop index IDX_@x;")
|
||||
#define UNIQUE ATTRIBUTE("create unique index UNQ_@x on @t(@c);", \
|
||||
"drop index UNQ_@x;")
|
||||
|
||||
#ifndef REFERENCES
|
||||
#define REFERENCES(x) ATTRIBUTE("alter table @t add constraint FK_@x foreign key "\
|
||||
"(@c) references @s" #x ";",\
|
||||
"alter table @t drop constraint FK_@x;")
|
||||
#endif
|
||||
|
||||
#define TIMESTAMP(ts) SCHEMA("-- " ts "\n\n", NULL)
|
||||
|
||||
|
|
|
|||
|
|
@ -46,9 +46,12 @@
|
|||
"alter table @t drop index IDX_@x;")
|
||||
#define UNIQUE ATTRIBUTE("alter table @t add unique UNQ_@x (@c);", \
|
||||
"alter table @t drop index UNQ_@x;")
|
||||
|
||||
#ifndef REFERENCES
|
||||
#define REFERENCES(x) ATTRIBUTE("alter table @t add (constraint FK_@x foreign key "\
|
||||
"(@c) references " #x ");",\
|
||||
"alter table @t drop constraint FK_@x;")
|
||||
#endif
|
||||
|
||||
#define TIMESTAMP(ts) SCHEMA("-- " ts "\n\n", NULL)
|
||||
|
||||
|
|
|
|||
|
|
@ -62,16 +62,19 @@
|
|||
"(@c) references " #x ");",\
|
||||
"alter table @t drop constraint FK_@x;")
|
||||
#endif
|
||||
|
||||
#ifndef REFERENCES_CASCADE
|
||||
#define REFERENCES_CASCADE(x) ATTRIBUTE("alter table @t add (constraint FK_@x foreign key "\
|
||||
"(@c) references " #x " on delete cascade);",\
|
||||
"alter table @t drop constraint FK_@x;")
|
||||
#endif
|
||||
|
||||
#ifndef REFERENCES_
|
||||
#define REFERENCES_(n, x) ATTRIBUTE("alter table @t add (constraint FK_@x$" #n " foreign key "\
|
||||
"(@c) references " #x ");",\
|
||||
"alter table @t drop constraint FK_@x$" #n ";")
|
||||
#endif
|
||||
|
||||
#ifndef REFERENCES_CASCADE_
|
||||
#define REFERENCES_CASCADE_(n, x) ATTRIBUTE("alter table @t add (constraint FK_@x$" #n " foreign key "\
|
||||
"(@c) references " #x " on delete cascade);",\
|
||||
|
|
|
|||
|
|
@ -82,16 +82,19 @@
|
|||
"(@c) references " #x ";",\
|
||||
"alter table @t drop constraint FK_@x;")
|
||||
#endif
|
||||
|
||||
#ifndef REFERENCES_CASCADE
|
||||
#define REFERENCES_CASCADE(x) ATTRIBUTE("alter table @t add constraint FK_@x foreign key "\
|
||||
"(@c) references " #x " on delete cascade;",\
|
||||
"alter table @t drop constraint FK_@x;")
|
||||
#endif
|
||||
|
||||
#ifndef REFERENCES_
|
||||
#define REFERENCES_(n, x) ATTRIBUTE("alter table @t add constraint FK_@x$" #n " foreign key "\
|
||||
"(@c) references " #x ";",\
|
||||
"alter table @t drop constraint FK_@x$" #n ";")
|
||||
#endif
|
||||
|
||||
#ifndef REFERENCES_CASCADE_
|
||||
#define REFERENCES_CASCADE_(n, x) ATTRIBUTE("alter table @t add constraint FK_@x$" #n " foreign key "\
|
||||
"(@c) references " #x " on delete cascade;",\
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ void WorkspaceWork::SavePackage()
|
|||
for(int i = 0; i < actual.GetCount(); i++) {
|
||||
String f = actual[i];
|
||||
if(ToLower(GetFileExt(f)) == ".icpp")
|
||||
init << "#define BLITZ_INDEX__ " << "F" + MD5String(init + f) << "\r\n"
|
||||
init << "#define BLITZ_INDEX__ " << "F" << MD5String(init + f) << "\r\n"
|
||||
<< "#include \"" << f << "\"\r\n"
|
||||
<< "#undef BLITZ_INDEX__\r\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,10 +48,21 @@
|
|||
#define UNIQUE ATTRIBUTE("create unique index IDX_@x on @t(@c);", \
|
||||
"drop index IDX_@x;")
|
||||
|
||||
#ifndef REFERENCES
|
||||
#define REFERENCES(x)
|
||||
#endif
|
||||
|
||||
#ifndef REFERENCES_CASCADE
|
||||
#define REFERENCES_CASCADE(x)
|
||||
#endif
|
||||
|
||||
#ifndef REFERENCES_
|
||||
#define REFERENCES_(n, x)
|
||||
#endif
|
||||
|
||||
#ifndef REFERENCES_CASCADE_
|
||||
#define REFERENCES_CASCADE_(n, x)
|
||||
#endif
|
||||
|
||||
#define DUAL_PRIMARY_KEY(k1, k2) INLINE_ATTRIBUTE(", primary key (" #k1 ", " #k2 ")")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue