text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
/* chinese simplified (China) charsets: */
/* GBT (GB12345) */
/* ======================================================================= */
static sal_uInt16 const aImplDBCSToUniTab_GBT_B0[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x554A, 0x963F, 0x57C3, 0x6328, 0x54CE, 0x5509, 0x54C0, /* 0xA0 */
0x769A, 0x764C, 0x85F9, 0x77EE, 0x827E, 0x7919, 0x611B, 0x9698, /* 0xA0 */
0x978D, 0x6C28, 0x5B89, 0x4FFA, 0x6309, 0x6697, 0x5CB8, 0x80FA, /* 0xB0 */
0x6848, 0x9AAF, 0x6602, 0x76CE, 0x51F9, 0x6556, 0x71AC, 0x7FF1, /* 0xB0 */
0x8956, 0x50B2, 0x5965, 0x61CA, 0x6FB3, 0x82AD, 0x634C, 0x6252, /* 0xC0 */
0x53ED, 0x5427, 0x7B06, 0x516B, 0x75A4, 0x5DF4, 0x62D4, 0x8DCB, /* 0xC0 */
0x9776, 0x628A, 0x8019, 0x58E9, 0x9738, 0x7F77, 0x7238, 0x767D, /* 0xD0 */
0x67CF, 0x767E, 0x64FA, 0x4F70, 0x6557, 0x62DC, 0x7A17, 0x6591, /* 0xD0 */
0x73ED, 0x642C, 0x6273, 0x822C, 0x9812, 0x677F, 0x7248, 0x626E, /* 0xE0 */
0x62CC, 0x4F34, 0x74E3, 0x534A, 0x8FA6, 0x7D46, 0x90A6, 0x5E6B, /* 0xE0 */
0x6886, 0x699C, 0x8180, 0x7D81, 0x68D2, 0x78C5, 0x868C, 0x938A, /* 0xF0 */
0x508D, 0x8B17, 0x82DE, 0x80DE, 0x5305, 0x8912, 0x5265 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_B1[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8584, 0x96F9, 0x4FDD, 0x5821, 0x98FD, 0x5BF6, 0x62B1, /* 0xA0 */
0x5831, 0x66B4, 0x8C79, 0x9B91, 0x7206, 0x676F, 0x7891, 0x60B2, /* 0xA0 */
0x5351, 0x5317, 0x8F29, 0x80CC, 0x8C9D, 0x92C7, 0x500D, 0x72FD, /* 0xB0 */
0x5099, 0x618A, 0x7119, 0x88AB, 0x5954, 0x82EF, 0x672C, 0x7B28, /* 0xB0 */
0x5D29, 0x7DB3, 0x752D, 0x6CF5, 0x8E66, 0x8FF8, 0x903C, 0x9F3B, /* 0xC0 */
0x6BD4, 0x9119, 0x7B46, 0x5F7C, 0x78A7, 0x84D6, 0x853D, 0x7562, /* 0xC0 */
0x6583, 0x6BD6, 0x5E63, 0x5E87, 0x75F9, 0x9589, 0x655D, 0x5F0A, /* 0xD0 */
0x5FC5, 0x8F9F, 0x58C1, 0x81C2, 0x907F, 0x965B, 0x97AD, 0x908A, /* 0xD0 */
0x7DE8, 0x8CB6, 0x6241, 0x4FBF, 0x8B8A, 0x535E, 0x8FA8, 0x8FAF, /* 0xE0 */
0x8FAE, 0x904D, 0x6A19, 0x5F6A, 0x8198, 0x8868, 0x9C49, 0x618B, /* 0xE0 */
0x522B, 0x765F, 0x5F6C, 0x658C, 0x7015, 0x6FF1, 0x8CD3, 0x64EF, /* 0xF0 */
0x5175, 0x51B0, 0x67C4, 0x4E19, 0x79C9, 0x9905, 0x70B3 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_B2[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x75C5, 0x5E76, 0x73BB, 0x83E0, 0x64AD, 0x64A5, 0x9262, /* 0xA0 */
0x6CE2, 0x535A, 0x52C3, 0x640F, 0x9251, 0x7B94, 0x4F2F, 0x5E1B, /* 0xA0 */
0x8236, 0x8116, 0x818A, 0x6E24, 0x6CCA, 0x99C1, 0x6355, 0x535C, /* 0xB0 */
0x54FA, 0x88DC, 0x57E0, 0x4E0D, 0x5E03, 0x6B65, 0x7C3F, 0x90E8, /* 0xB0 */
0x6016, 0x64E6, 0x731C, 0x88C1, 0x6750, 0x624D, 0x8CA1, 0x776C, /* 0xC0 */
0x8E29, 0x91C7, 0x5F69, 0x83DC, 0x8521, 0x9910, 0x53C3, 0x8836, /* 0xC0 */
0x6B98, 0x615A, 0x6158, 0x71E6, 0x84BC, 0x8259, 0x5009, 0x6EC4, /* 0xD0 */
0x85CF, 0x64CD, 0x7CD9, 0x69FD, 0x66F9, 0x8349, 0x53A0, 0x7B56, /* 0xD0 */
0x5074, 0x518C, 0x6E2C, 0x5C64, 0x8E6D, 0x63D2, 0x53C9, 0x832C, /* 0xE0 */
0x8336, 0x67E5, 0x78B4, 0x643D, 0x5BDF, 0x5C94, 0x5DEE, 0x8A6B, /* 0xE0 */
0x62C6, 0x67F4, 0x8C7A, 0x6519, 0x647B, 0x87EC, 0x995E, 0x8B92, /* 0xF0 */
0x7E8F, 0x93DF, 0x7523, 0x95E1, 0x986B, 0x660C, 0x7316 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_B3[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5834, 0x5617, 0x5E38, 0x9577, 0x511F, 0x8178, 0x5EE0, /* 0xA0 */
0x655E, 0x66A2, 0x5531, 0x5021, 0x8D85, 0x6284, 0x9214, 0x671D, /* 0xA0 */
0x5632, 0x6F6E, 0x5DE2, 0x5435, 0x7092, 0x8ECA, 0x626F, 0x64A4, /* 0xB0 */
0x63A3, 0x5FB9, 0x6F88, 0x90F4, 0x81E3, 0x8FB0, 0x5875, 0x6668, /* 0xB0 */
0x5FF1, 0x6C89, 0x9673, 0x8D81, 0x896F, 0x6491, 0x7A31, 0x57CE, /* 0xC0 */
0x6A59, 0x6210, 0x5448, 0x4E58, 0x7A0B, 0x61F2, 0x6F84, 0x8AA0, /* 0xC0 */
0x627F, 0x901E, 0x9A01, 0x79E4, 0x5403, 0x75F4, 0x6301, 0x5319, /* 0xD0 */
0x6C60, 0x9072, 0x5F1B, 0x99B3, 0x803B, 0x9F52, 0x4F88, 0x5C3A, /* 0xD0 */
0x8D64, 0x7FC5, 0x65A5, 0x71BE, 0x5145, 0x885D, 0x87F2, 0x5D07, /* 0xE0 */
0x5BF5, 0x62BD, 0x916C, 0x7587, 0x8E8A, 0x7A20, 0x6101, 0x7C4C, /* 0xE0 */
0x4EC7, 0x7DA2, 0x7785, 0x919C, 0x81ED, 0x521D, 0x51FA, 0x6A71, /* 0xF0 */
0x53A8, 0x8E87, 0x92E4, 0x96DB, 0x6EC1, 0x9664, 0x695A /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_B4[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x790E, 0x5132, 0x77D7, 0x6410, 0x89F8, 0x8655, 0x63E3, /* 0xA0 */
0x5DDD, 0x7A7F, 0x693D, 0x50B3, 0x8239, 0x5598, 0x4E32, 0x7621, /* 0xA0 */
0x7A97, 0x5E62, 0x5E8A, 0x95D6, 0x5275, 0x5439, 0x708A, 0x6376, /* 0xB0 */
0x9318, 0x5782, 0x6625, 0x693F, 0x9187, 0x5507, 0x6DF3, 0x7D14, /* 0xB0 */
0x8822, 0x6233, 0x7DBD, 0x75B5, 0x8328, 0x78C1, 0x96CC, 0x8FAD, /* 0xC0 */
0x6148, 0x74F7, 0x8A5E, 0x6B64, 0x523A, 0x8CDC, 0x6B21, 0x8070, /* 0xC0 */
0x8471, 0x56F1, 0x5306, 0x5F9E, 0x53E2, 0x51D1, 0x7C97, 0x918B, /* 0xD0 */
0x7C07, 0x4FC3, 0x8EA5, 0x7BE1, 0x7AC4, 0x6467, 0x5D14, 0x50AC, /* 0xD0 */
0x8106, 0x7601, 0x7CB9, 0x6DEC, 0x7FE0, 0x6751, 0x5B58, 0x5BF8, /* 0xE0 */
0x78CB, 0x64AE, 0x6413, 0x63AA, 0x632B, 0x932F, 0x642D, 0x9054, /* 0xE0 */
0x7B54, 0x7629, 0x6253, 0x5927, 0x5446, 0x6B79, 0x50A3, 0x6234, /* 0xF0 */
0x5E36, 0x6B86, 0x4EE3, 0x8CB8, 0x888B, 0x5F85, 0x902E /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_B5[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x6020, 0x803D, 0x64D4, 0x4E39, 0x55AE, 0x9132, 0x64A3, /* 0xA0 */
0x81BD, 0x65E6, 0x6C2E, 0x4F46, 0x619A, 0x6DE1, 0x8A95, 0x5F48, /* 0xA0 */
0x86CB, 0x7576, 0x64CB, 0x9EE8, 0x8569, 0x6A94, 0x5200, 0x6417, /* 0xB0 */
0x8E48, 0x5012, 0x5CF6, 0x79B1, 0x5C0E, 0x5230, 0x7A3B, 0x60BC, /* 0xB0 */
0x9053, 0x76D7, 0x5FB7, 0x5F97, 0x7684, 0x8E6C, 0x71C8, 0x767B, /* 0xC0 */
0x7B49, 0x77AA, 0x51F3, 0x9127, 0x5824, 0x4F4E, 0x6EF4, 0x8FEA, /* 0xC0 */
0x6575, 0x7B1B, 0x72C4, 0x6ECC, 0x7FDF, 0x5AE1, 0x62B5, 0x5E95, /* 0xD0 */
0x5730, 0x8482, 0x7B2C, 0x5E1D, 0x5F1F, 0x905E, 0x7DE0, 0x985B, /* 0xD0 */
0x6382, 0x6EC7, 0x7898, 0x9EDE, 0x5178, 0x975B, 0x588A, 0x96FB, /* 0xE0 */
0x4F43, 0x7538, 0x5E97, 0x60E6, 0x5960, 0x6FB1, 0x6BBF, 0x7889, /* 0xE0 */
0x53FC, 0x96D5, 0x51CB, 0x5201, 0x6389, 0x540A, 0x91E3, 0x8ABF, /* 0xF0 */
0x8DCC, 0x7239, 0x789F, 0x8776, 0x8FED, 0x8ADC, 0x758A /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_B6[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x4E01, 0x76EF, 0x53EE, 0x91D8, 0x9802, 0x9F0E, 0x9320, /* 0xA0 */
0x5B9A, 0x8A02, 0x4E22, 0x6771, 0x51AC, 0x8463, 0x61C2, 0x52D5, /* 0xA0 */
0x68DF, 0x4F97, 0x606B, 0x51CD, 0x6D1E, 0x515C, 0x6296, 0x9B25, /* 0xB0 */
0x9661, 0x8C46, 0x9017, 0x75D8, 0x90FD, 0x7763, 0x6BD2, 0x72A2, /* 0xB0 */
0x7368, 0x8B80, 0x5835, 0x7779, 0x8CED, 0x675C, 0x934D, 0x809A, /* 0xC0 */
0x5EA6, 0x6E21, 0x5992, 0x7AEF, 0x77ED, 0x935B, 0x6BB5, 0x65B7, /* 0xC0 */
0x7DDE, 0x5806, 0x5151, 0x968A, 0x5C0D, 0x58A9, 0x5678, 0x8E72, /* 0xD0 */
0x6566, 0x9813, 0x56E4, 0x920D, 0x76FE, 0x9041, 0x6387, 0x54C6, /* 0xD0 */
0x591A, 0x596A, 0x579B, 0x8EB2, 0x6735, 0x8DFA, 0x8235, 0x5241, /* 0xE0 */
0x60F0, 0x58AE, 0x86FE, 0x5CE8, 0x9D5D, 0x4FC4, 0x984D, 0x8A1B, /* 0xE0 */
0x5A25, 0x60E1, 0x5384, 0x627C, 0x904F, 0x9102, 0x9913, 0x6069, /* 0xF0 */
0x800C, 0x5152, 0x8033, 0x723E, 0x990C, 0x6D31, 0x4E8C /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_B7[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8CB3, 0x767C, 0x7F70, 0x7B4F, 0x4F10, 0x4E4F, 0x95A5, /* 0xA0 */
0x6CD5, 0x73D0, 0x85E9, 0x5E06, 0x756A, 0x7FFB, 0x6A0A, 0x792C, /* 0xA0 */
0x91E9, 0x7E41, 0x51E1, 0x7169, 0x53CD, 0x8FD4, 0x7BC4, 0x8CA9, /* 0xB0 */
0x72AF, 0x98EF, 0x6CDB, 0x574A, 0x82B3, 0x65B9, 0x80AA, 0x623F, /* 0xB0 */
0x9632, 0x59A8, 0x4EFF, 0x8A2A, 0x7D21, 0x653E, 0x83F2, 0x975E, /* 0xC0 */
0x5561, 0x98DB, 0x80A5, 0x532A, 0x8AB9, 0x5420, 0x80BA, 0x5EE2, /* 0xC0 */
0x6CB8, 0x8CBB, 0x82AC, 0x915A, 0x5429, 0x6C1B, 0x5206, 0x7D1B, /* 0xD0 */
0x58B3, 0x711A, 0x6C7E, 0x7C89, 0x596E, 0x4EFD, 0x5FFF, 0x61A4, /* 0xD0 */
0x7CDE, 0x8C50, 0x5C01, 0x6953, 0x8702, 0x5CF0, 0x92D2, 0x98A8, /* 0xE0 */
0x760B, 0x70FD, 0x9022, 0x99AE, 0x7E2B, 0x8AF7, 0x5949, 0x9CF3, /* 0xE0 */
0x4F5B, 0x5426, 0x592B, 0x6577, 0x819A, 0x5B75, 0x6276, 0x62C2, /* 0xF0 */
0x8F3B, 0x5E45, 0x6C1F, 0x7B26, 0x4F0F, 0x4FD8, 0x670D /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_B8[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x6D6E, 0x6DAA, 0x798F, 0x88B1, 0x5F17, 0x752B, 0x64AB, /* 0xA0 */
0x8F14, 0x4FEF, 0x91DC, 0x65A7, 0x812F, 0x8151, 0x5E9C, 0x8150, /* 0xA0 */
0x8D74, 0x526F, 0x8986, 0x8CE6, 0x5FA9, 0x5085, 0x4ED8, 0x961C, /* 0xB0 */
0x7236, 0x8179, 0x8CA0, 0x5BCC, 0x8A03, 0x9644, 0x5A66, 0x7E1B, /* 0xB0 */
0x5490, 0x5676, 0x560E, 0x8A72, 0x6539, 0x6982, 0x9223, 0x84CB, /* 0xC0 */
0x6E89, 0x5E79, 0x7518, 0x6746, 0x67D1, 0x7AFF, 0x809D, 0x8D95, /* 0xC0 */
0x611F, 0x79C6, 0x6562, 0x8D1B, 0x5CA1, 0x525B, 0x92FC, 0x7F38, /* 0xD0 */
0x809B, 0x7DB1, 0x5D17, 0x6E2F, 0x6760, 0x7BD9, 0x768B, 0x9AD8, /* 0xD0 */
0x818F, 0x7F94, 0x7CD5, 0x641E, 0x93AC, 0x7A3F, 0x544A, 0x54E5, /* 0xE0 */
0x6B4C, 0x64F1, 0x6208, 0x9D3F, 0x80F3, 0x7599, 0x5272, 0x9769, /* 0xE0 */
0x845B, 0x683C, 0x86E4, 0x95A3, 0x9694, 0x927B, 0x500B, 0x5404, /* 0xF0 */
0x7D66, 0x6839, 0x8DDF, 0x8015, 0x66F4, 0x5E9A, 0x7FB9 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_B9[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x57C2, 0x803F, 0x6897, 0x5DE5, 0x653B, 0x529F, 0x606D, /* 0xA0 */
0x9F94, 0x4F9B, 0x8EAC, 0x516C, 0x5BAB, 0x5F13, 0x978F, 0x6C5E, /* 0xA0 */
0x62F1, 0x8CA2, 0x5171, 0x920E, 0x52FE, 0x6E9D, 0x82DF, 0x72D7, /* 0xB0 */
0x57A2, 0x69CB, 0x8CFC, 0x591F, 0x8F9C, 0x83C7, 0x5495, 0x7B8D, /* 0xB0 */
0x4F30, 0x6CBD, 0x5B64, 0x59D1, 0x9F13, 0x53E4, 0x8831, 0x9AA8, /* 0xC0 */
0x8C37, 0x80A1, 0x6545, 0x9867, 0x56FA, 0x96C7, 0x522E, 0x74DC, /* 0xC0 */
0x526E, 0x5BE1, 0x6302, 0x8902, 0x4E56, 0x62D0, 0x602A, 0x68FA, /* 0xD0 */
0x95DC, 0x5B98, 0x51A0, 0x89C0, 0x7BA1, 0x9928, 0x7F50, 0x6163, /* 0xD0 */
0x704C, 0x8CAB, 0x5149, 0x5EE3, 0x901B, 0x7470, 0x898F, 0x572D, /* 0xE0 */
0x7845, 0x6B78, 0x9F9C, 0x95A8, 0x8ECC, 0x9B3C, 0x8A6D, 0x7678, /* 0xE0 */
0x6842, 0x6AC3, 0x8DEA, 0x8CB4, 0x528A, 0x8F25, 0x6EDA, 0x68CD, /* 0xF0 */
0x934B, 0x90ED, 0x570B, 0x679C, 0x88F9, 0x904E, 0x54C8 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_BA[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9AB8, 0x5B69, 0x6D77, 0x6C26, 0x4EA5, 0x5BB3, 0x99ED, /* 0xA0 */
0x9163, 0x61A8, 0x90AF, 0x97D3, 0x542B, 0x6DB5, 0x5BD2, 0x51FD, /* 0xA0 */
0x558A, 0x7F55, 0x7FF0, 0x64BC, 0x634D, 0x65F1, 0x61BE, 0x608D, /* 0xB0 */
0x710A, 0x6C57, 0x6F22, 0x592F, 0x676D, 0x822A, 0x58D5, 0x568E, /* 0xB0 */
0x8C6A, 0x6BEB, 0x90DD, 0x597D, 0x8017, 0x865F, 0x6D69, 0x5475, /* 0xC0 */
0x559D, 0x8377, 0x83CF, 0x6838, 0x79BE, 0x548C, 0x4F55, 0x5408, /* 0xC0 */
0x76D2, 0x8C89, 0x95A1, 0x6CB3, 0x6DB8, 0x8D6B, 0x8910, 0x9DB4, /* 0xD0 */
0x8CC0, 0x563F, 0x9ED1, 0x75D5, 0x5F88, 0x72E0, 0x6068, 0x54FC, /* 0xD0 */
0x4EA8, 0x6A2A, 0x8861, 0x6052, 0x8F5F, 0x54C4, 0x70D8, 0x8679, /* 0xE0 */
0x9D3B, 0x6D2A, 0x5B8F, 0x5F18, 0x7D05, 0x5589, 0x4FAF, 0x7334, /* 0xE0 */
0x543C, 0x539A, 0x5019, 0x5F8C, 0x547C, 0x4E4E, 0x5FFD, 0x745A, /* 0xF0 */
0x58FA, 0x846B, 0x80E1, 0x8774, 0x72D0, 0x7CCA, 0x6E56 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_BB[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5F27, 0x864E, 0x552C, 0x8B77, 0x4E92, 0x6EEC, 0x6237, /* 0xA0 */
0x82B1, 0x5629, 0x83EF, 0x733E, 0x6ED1, 0x756B, 0x5283, 0x5316, /* 0xA0 */
0x8A71, 0x69D0, 0x5F8A, 0x61F7, 0x6DEE, 0x58DE, 0x6B61, 0x74B0, /* 0xB0 */
0x6853, 0x9084, 0x7DE9, 0x63DB, 0x60A3, 0x559A, 0x7613, 0x8C62, /* 0xB0 */
0x7165, 0x6E19, 0x5BA6, 0x5E7B, 0x8352, 0x614C, 0x9EC4, 0x78FA, /* 0xC0 */
0x8757, 0x7C27, 0x7687, 0x51F0, 0x60F6, 0x714C, 0x6643, 0x5E4C, /* 0xC0 */
0x604D, 0x8B0A, 0x7070, 0x63EE, 0x8F1D, 0x5FBD, 0x6062, 0x86D4, /* 0xD0 */
0x56DE, 0x6BC1, 0x6094, 0x6167, 0x5349, 0x60E0, 0x6666, 0x8CC4, /* 0xD0 */
0x7A62, 0x6703, 0x71F4, 0x532F, 0x8AF1, 0x8AA8, 0x7E6A, 0x8477, /* 0xE0 */
0x660F, 0x5A5A, 0x9B42, 0x6E3E, 0x6DF7, 0x8C41, 0x6D3B, 0x4F19, /* 0xE0 */
0x706B, 0x7372, 0x6216, 0x60D1, 0x970D, 0x8CA8, 0x798D, 0x64CA, /* 0xF0 */
0x573E, 0x57FA, 0x6A5F, 0x7578, 0x7A3D, 0x7A4D, 0x7B95 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_BC[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x808C, 0x9951, 0x8FF9, 0x6FC0, 0x8B4F, 0x9DC4, 0x59EC, /* 0xA0 */
0x7E3E, 0x7DDD, 0x5409, 0x6975, 0x68D8, 0x8F2F, 0x7C4D, 0x96C6, /* 0xA0 */
0x53CA, 0x6025, 0x75BE, 0x6C72, 0x5373, 0x5AC9, 0x7D1A, 0x64E0, /* 0xB0 */
0x5E7E, 0x810A, 0x5DF1, 0x858A, 0x6280, 0x5180, 0x5B63, 0x4F0E, /* 0xB0 */
0x796D, 0x5291, 0x60B8, 0x6FDF, 0x5BC4, 0x5BC2, 0x8A08, 0x8A18, /* 0xC0 */
0x65E2, 0x5FCC, 0x969B, 0x5993, 0x7E7C, 0x7D00, 0x5609, 0x67B7, /* 0xC0 */
0x593E, 0x4F73, 0x5BB6, 0x52A0, 0x83A2, 0x9830, 0x8CC8, 0x7532, /* 0xD0 */
0x9240, 0x5047, 0x7A3C, 0x50F9, 0x67B6, 0x99D5, 0x5AC1, 0x6BB2, /* 0xD0 */
0x76E3, 0x5805, 0x5C16, 0x7B8B, 0x9593, 0x714E, 0x517C, 0x80A9, /* 0xE0 */
0x8271, 0x5978, 0x7DD8, 0x7E6D, 0x6AA2, 0x67EC, 0x78B1, 0x9E7C, /* 0xE0 */
0x63C0, 0x64BF, 0x7C21, 0x5109, 0x526A, 0x51CF, 0x85A6, 0x6ABB, /* 0xF0 */
0x9452, 0x8E10, 0x8CE4, 0x898B, 0x9375, 0x7BAD, 0x4EF6 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_BD[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5065, 0x8266, 0x528D, 0x991E, 0x6F38, 0x6FFA, 0x6F97, /* 0xA0 */
0x5EFA, 0x50F5, 0x59DC, 0x5C07, 0x6F3F, 0x6C5F, 0x7586, 0x8523, /* 0xA0 */
0x69F3, 0x596C, 0x8B1B, 0x5320, 0x91AC, 0x964D, 0x8549, 0x6912, /* 0xB0 */
0x7901, 0x7126, 0x81A0, 0x4EA4, 0x90CA, 0x6F86, 0x9A55, 0x5B0C, /* 0xB0 */
0x56BC, 0x652A, 0x9278, 0x77EF, 0x50E5, 0x811A, 0x72E1, 0x89D2, /* 0xC0 */
0x9903, 0x7E73, 0x7D5E, 0x527F, 0x6559, 0x9175, 0x8F4E, 0x8F03, /* 0xC0 */
0x53EB, 0x7A96, 0x63ED, 0x63A5, 0x7686, 0x79F8, 0x8857, 0x968E, /* 0xD0 */
0x622A, 0x52AB, 0x7BC0, 0x6854, 0x6770, 0x6377, 0x776B, 0x7AED, /* 0xD0 */
0x6F54, 0x7D50, 0x89E3, 0x59D0, 0x6212, 0x85C9, 0x82A5, 0x754C, /* 0xE0 */
0x501F, 0x4ECB, 0x75A5, 0x8AA1, 0x5C4A, 0x5DFE, 0x7B4B, 0x65A4, /* 0xE0 */
0x91D1, 0x4ECA, 0x6D25, 0x895F, 0x7DCA, 0x9326, 0x50C5, 0x8B39, /* 0xF0 */
0x9032, 0x9773, 0x6649, 0x7981, 0x8FD1, 0x71FC, 0x6D78 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_BE[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x76E1, 0x52C1, 0x8346, 0x5162, 0x8396, 0x775B, 0x6676, /* 0xA0 */
0x9BE8, 0x4EAC, 0x9A5A, 0x7CBE, 0x7CB3, 0x7D93, 0x4E95, 0x8B66, /* 0xA0 */
0x666F, 0x9838, 0x975C, 0x5883, 0x656C, 0x93E1, 0x5F91, 0x75D9, /* 0xB0 */
0x9756, 0x7ADF, 0x7AF6, 0x51C8, 0x70AF, 0x7A98, 0x63EA, 0x7A76, /* 0xB0 */
0x7CFE, 0x7396, 0x97ED, 0x4E45, 0x7078, 0x4E5D, 0x9152, 0x53A9, /* 0xC0 */
0x6551, 0x820A, 0x81FC, 0x8205, 0x548E, 0x5C31, 0x759A, 0x97A0, /* 0xC0 */
0x62D8, 0x72D9, 0x75BD, 0x5C45, 0x99D2, 0x83CA, 0x5C40, 0x5480, /* 0xD0 */
0x77E9, 0x8209, 0x6CAE, 0x805A, 0x62D2, 0x64DA, 0x5DE8, 0x5177, /* 0xD0 */
0x8DDD, 0x8E1E, 0x92F8, 0x4FF1, 0x53E5, 0x61FC, 0x70AC, 0x5287, /* 0xE0 */
0x6350, 0x9D51, 0x5A1F, 0x5026, 0x7737, 0x5377, 0x7D79, 0x6485, /* 0xE0 */
0x652B, 0x6289, 0x6398, 0x5014, 0x7235, 0x89BA, 0x51B3, 0x8A23, /* 0xF0 */
0x7D76, 0x5747, 0x83CC, 0x921E, 0x8ECD, 0x541B, 0x5CFB /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_BF[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x4FCA, 0x7AE3, 0x6D5A, 0x90E1, 0x99FF, 0x5580, 0x5496, /* 0xA0 */
0x5361, 0x54AF, 0x958B, 0x63E9, 0x6977, 0x51F1, 0x6168, 0x520A, /* 0xA0 */
0x582A, 0x52D8, 0x574E, 0x780D, 0x770B, 0x5EB7, 0x6177, 0x7CE0, /* 0xB0 */
0x625B, 0x6297, 0x4EA2, 0x7095, 0x8003, 0x62F7, 0x70E4, 0x9760, /* 0xB0 */
0x5777, 0x82DB, 0x67EF, 0x68F5, 0x78D5, 0x9846, 0x79D1, 0x6BBB, /* 0xC0 */
0x54B3, 0x53EF, 0x6E34, 0x514B, 0x523B, 0x5BA2, 0x8AB2, 0x80AF, /* 0xC0 */
0x5543, 0x58BE, 0x61C7, 0x5751, 0x542D, 0x7A7A, 0x6050, 0x5B54, /* 0xD0 */
0x63A7, 0x6473, 0x53E3, 0x6263, 0x5BC7, 0x67AF, 0x54ED, 0x7A9F, /* 0xD0 */
0x82E6, 0x9177, 0x5EAB, 0x8932, 0x8A87, 0x57AE, 0x630E, 0x8DE8, /* 0xE0 */
0x80EF, 0x584A, 0x7B77, 0x5108, 0x5FEB, 0x5BEC, 0x6B3E, 0x5321, /* 0xE0 */
0x7B50, 0x72C2, 0x6846, 0x7926, 0x7736, 0x66E0, 0x51B5, 0x8667, /* 0xF0 */
0x76D4, 0x5DCB, 0x7ABA, 0x8475, 0x594E, 0x9B41, 0x5080 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_C0[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x994B, 0x6127, 0x6F70, 0x5764, 0x6606, 0x6346, 0x56F0, /* 0xA0 */
0x62EC, 0x64F4, 0x5ED3, 0x95CA, 0x5783, 0x62C9, 0x5587, 0x881F, /* 0xA0 */
0x81D8, 0x8FA3, 0x5566, 0x840A, 0x4F86, 0x8CF4, 0x85CD, 0x5A6A, /* 0xB0 */
0x6B04, 0x6514, 0x7C43, 0x95CC, 0x862D, 0x703E, 0x8B95, 0x652C, /* 0xB0 */
0x89BD, 0x61F6, 0x7E9C, 0x721B, 0x6FEB, 0x7405, 0x6994, 0x72FC, /* 0xC0 */
0x5ECA, 0x90CE, 0x6717, 0x6D6A, 0x6488, 0x52DE, 0x7262, 0x8001, /* 0xC0 */
0x4F6C, 0x59E5, 0x916A, 0x70D9, 0x6F87, 0x52D2, 0x6A02, 0x96F7, /* 0xD0 */
0x9433, 0x857E, 0x78CA, 0x7D2F, 0x5121, 0x58D8, 0x64C2, 0x808B, /* 0xD0 */
0x985E, 0x6CEA, 0x68F1, 0x695E, 0x51B7, 0x5398, 0x68A8, 0x7281, /* 0xE0 */
0x9ECE, 0x7C6C, 0x72F8, 0x96E2, 0x7055, 0x7406, 0x674E, 0x88CF, /* 0xE0 */
0x9BC9, 0x79AE, 0x8389, 0x8354, 0x540F, 0x6817, 0x9E97, 0x53B2, /* 0xF0 */
0x52F5, 0x792B, 0x6B77, 0x5229, 0x5088, 0x4F8B, 0x4FD0 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_C1[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x75E2, 0x7ACB, 0x7C92, 0x701D, 0x96B8, 0x529B, 0x7483, /* 0xA0 */
0x54E9, 0x5006, 0x806F, 0x84EE, 0x9023, 0x942E, 0x5EC9, 0x6190, /* 0xA0 */
0x6F23, 0x7C3E, 0x6582, 0x81C9, 0x93C8, 0x6200, 0x7149, 0x7DF4, /* 0xB0 */
0x7CE7, 0x51C9, 0x6881, 0x7CB1, 0x826F, 0x5169, 0x8F1B, 0x91CF, /* 0xB0 */
0x667E, 0x4EAE, 0x8AD2, 0x64A9, 0x804A, 0x50DA, 0x7642, 0x71CE, /* 0xC0 */
0x5BE5, 0x907C, 0x6F66, 0x4E86, 0x6482, 0x9410, 0x5ED6, 0x6599, /* 0xC0 */
0x5217, 0x88C2, 0x70C8, 0x52A3, 0x7375, 0x7433, 0x6797, 0x78F7, /* 0xD0 */
0x9716, 0x81E8, 0x9130, 0x9C57, 0x6DCB, 0x51DB, 0x8CC3, 0x541D, /* 0xD0 */
0x62CE, 0x73B2, 0x83F1, 0x96F6, 0x9F61, 0x9234, 0x4F36, 0x7F9A, /* 0xE0 */
0x51CC, 0x9748, 0x9675, 0x5DBA, 0x9818, 0x53E6, 0x4EE4, 0x6E9C, /* 0xE0 */
0x7409, 0x69B4, 0x786B, 0x993E, 0x7559, 0x5289, 0x7624, 0x6D41, /* 0xF0 */
0x67F3, 0x516D, 0x9F8D, 0x807E, 0x56A8, 0x7C60, 0x7ABF /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_C2[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9686, 0x58DF, 0x650F, 0x96B4, 0x6A13, 0x5A41, 0x645F, /* 0xA0 */
0x7C0D, 0x6F0F, 0x964B, 0x8606, 0x76E7, 0x9871, 0x5EEC, 0x7210, /* 0xA0 */
0x64C4, 0x6EF7, 0x865C, 0x9B6F, 0x9E93, 0x788C, 0x9732, 0x8DEF, /* 0xB0 */
0x8CC2, 0x9E7F, 0x6F5E, 0x7984, 0x9332, 0x9678, 0x622E, 0x9A62, /* 0xB0 */
0x5415, 0x92C1, 0x4FA3, 0x65C5, 0x5C65, 0x5C62, 0x7E37, 0x616E, /* 0xC0 */
0x6C2F, 0x5F8B, 0x7387, 0x6FFE, 0x7DD1, 0x5DD2, 0x6523, 0x5B7F, /* 0xC0 */
0x7064, 0x5375, 0x4E82, 0x63A0, 0x7565, 0x6384, 0x8F2A, 0x502B, /* 0xD0 */
0x4F96, 0x6DEA, 0x7DB8, 0x8AD6, 0x863F, 0x87BA, 0x7F85, 0x908F, /* 0xD0 */
0x947C, 0x7C6E, 0x9A3E, 0x88F8, 0x843D, 0x6D1B, 0x99F1, 0x7D61, /* 0xE0 */
0x5ABD, 0x9EBB, 0x746A, 0x78BC, 0x879E, 0x99AC, 0x99E1, 0x561B, /* 0xE0 */
0x55CE, 0x57CB, 0x8CB7, 0x9EA5, 0x8CE3, 0x9081, 0x8109, 0x779E, /* 0xF0 */
0x9945, 0x883B, 0x6EFF, 0x8513, 0x66FC, 0x6162, 0x6F2B /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_C3[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8B3E, 0x8292, 0x832B, 0x76F2, 0x6C13, 0x5FD9, 0x83BD, /* 0xA0 */
0x732B, 0x8305, 0x9328, 0x6BDB, 0x77DB, 0x925A, 0x536F, 0x8302, /* 0xA0 */
0x5192, 0x5E3D, 0x8C8C, 0x8CBF, 0x9EBD, 0x73AB, 0x679A, 0x6885, /* 0xB0 */
0x9176, 0x9709, 0x7164, 0x6CA1, 0x7709, 0x5A92, 0x9382, 0x6BCF, /* 0xB0 */
0x7F8E, 0x6627, 0x5BD0, 0x59B9, 0x5A9A, 0x9580, 0x60B6, 0x5011, /* 0xC0 */
0x840C, 0x8499, 0x6AAC, 0x76DF, 0x9333, 0x731B, 0x5922, 0x5B5F, /* 0xC0 */
0x772F, 0x919A, 0x9761, 0x7CDC, 0x8FF7, 0x8B0E, 0x5F4C, 0x7C73, /* 0xD0 */
0x79D8, 0x8993, 0x6CCC, 0x871C, 0x5BC6, 0x5E42, 0x68C9, 0x7720, /* 0xD0 */
0x7DBF, 0x5195, 0x514D, 0x52C9, 0x5A29, 0x7DEC, 0x9762, 0x82D7, /* 0xE0 */
0x63CF, 0x7784, 0x85D0, 0x79D2, 0x6E3A, 0x5EDF, 0x5999, 0x8511, /* 0xE0 */
0x6EC5, 0x6C11, 0x62BF, 0x76BF, 0x654F, 0x61AB, 0x95A9, 0x660E, /* 0xF0 */
0x879F, 0x9CF4, 0x9298, 0x540D, 0x547D, 0x8B2C, 0x6478 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_C4[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x6479, 0x8611, 0x6A21, 0x819C, 0x78E8, 0x6469, 0x9B54, /* 0xA0 */
0x62B9, 0x672B, 0x83AB, 0x58A8, 0x9ED8, 0x6CAB, 0x6F20, 0x5BDE, /* 0xA0 */
0x964C, 0x8B00, 0x725F, 0x67D0, 0x62C7, 0x7261, 0x755D, 0x59C6, /* 0xB0 */
0x6BCD, 0x5893, 0x66AE, 0x5E55, 0x52DF, 0x6155, 0x6728, 0x76EE, /* 0xB0 */
0x7766, 0x7267, 0x7A46, 0x62FF, 0x54EA, 0x5450, 0x9209, 0x90A3, /* 0xC0 */
0x5A1C, 0x7D0D, 0x6C16, 0x4E43, 0x5976, 0x8010, 0x5948, 0x5357, /* 0xC0 */
0x7537, 0x96E3, 0x56CA, 0x6493, 0x8166, 0x60F1, 0x9B27, 0x6DD6, /* 0xD0 */
0x5462, 0x9912, 0x5185, 0x5AE9, 0x80FD, 0x59AE, 0x9713, 0x502A, /* 0xD0 */
0x6CE5, 0x5C3C, 0x64EC, 0x4F60, 0x533F, 0x81A9, 0x9006, 0x6EBA, /* 0xE0 */
0x852B, 0x62C8, 0x5E74, 0x78BE, 0x6506, 0x637B, 0x5FF5, 0x5A18, /* 0xE0 */
0x91C0, 0x9CE5, 0x5C3F, 0x634F, 0x8076, 0x5B7D, 0x5699, 0x9477, /* 0xF0 */
0x93B3, 0x6D85, 0x60A8, 0x6AB8, 0x7370, 0x51DD, 0x5BE7 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_C5[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x64F0, 0x6FD8, 0x725B, 0x626D, 0x9215, 0x7D10, 0x81BF, /* 0xA0 */
0x6FC3, 0x8FB2, 0x5F04, 0x5974, 0x52AA, 0x6012, 0x5973, 0x6696, /* 0xA0 */
0x8650, 0x7627, 0x632A, 0x61E6, 0x7CEF, 0x8AFE, 0x54E6, 0x6B50, /* 0xB0 */
0x9DD7, 0x6BC6, 0x85D5, 0x5614, 0x5076, 0x6F1A, 0x556A, 0x8DB4, /* 0xB0 */
0x722C, 0x5E15, 0x6015, 0x7436, 0x62CD, 0x6392, 0x724C, 0x5F98, /* 0xC0 */
0x6E43, 0x6D3E, 0x6500, 0x6F58, 0x76E4, 0x78D0, 0x76FC, 0x7554, /* 0xC0 */
0x5224, 0x53DB, 0x4E53, 0x9F90, 0x65C1, 0x802A, 0x80D6, 0x629B, /* 0xD0 */
0x5486, 0x5228, 0x70AE, 0x888D, 0x8DD1, 0x6CE1, 0x5478, 0x80DA, /* 0xD0 */
0x57F9, 0x88F4, 0x8CE0, 0x966A, 0x914D, 0x4F69, 0x6C9B, 0x5674, /* 0xE0 */
0x76C6, 0x7830, 0x62A8, 0x70F9, 0x6F8E, 0x5F6D, 0x84EC, 0x68DA, /* 0xE0 */
0x787C, 0x7BF7, 0x81A8, 0x670B, 0x9D6C, 0x6367, 0x78B0, 0x576F, /* 0xF0 */
0x7812, 0x9739, 0x6279, 0x62AB, 0x5288, 0x7435, 0x6BD7 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_C6[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5564, 0x813E, 0x75B2, 0x76AE, 0x5339, 0x75DE, 0x50FB, /* 0xA0 */
0x5C41, 0x8B6C, 0x7BC7, 0x504F, 0x7247, 0x9A19, 0x98C4, 0x6F02, /* 0xA0 */
0x74E2, 0x7968, 0x6487, 0x77A5, 0x62FC, 0x983B, 0x8CA7, 0x54C1, /* 0xB0 */
0x8058, 0x4E52, 0x576A, 0x860B, 0x840D, 0x5E73, 0x6191, 0x74F6, /* 0xB0 */
0x8A55, 0x5C4F, 0x5761, 0x6F51, 0x9817, 0x5A46, 0x7834, 0x9B44, /* 0xC0 */
0x8FEB, 0x7C95, 0x5256, 0x64B2, 0x92EA, 0x50D5, 0x8386, 0x8461, /* 0xC0 */
0x83E9, 0x84B2, 0x57D4, 0x6A38, 0x5703, 0x666E, 0x6D66, 0x8B5C, /* 0xD0 */
0x66DD, 0x7011, 0x671F, 0x6B3A, 0x68F2, 0x621A, 0x59BB, 0x4E03, /* 0xD0 */
0x51C4, 0x6F06, 0x67D2, 0x6C8F, 0x5176, 0x68CB, 0x5947, 0x6B67, /* 0xE0 */
0x7566, 0x5D0E, 0x81CD, 0x9F4A, 0x65D7, 0x7948, 0x7941, 0x9A0E, /* 0xE0 */
0x8D77, 0x8C48, 0x4E5E, 0x4F01, 0x5553, 0x5951, 0x780C, 0x5668, /* 0xF0 */
0x6C23, 0x8FC4, 0x68C4, 0x6C7D, 0x6CE3, 0x8A16, 0x6390 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_C7[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x6070, 0x6D3D, 0x727D, 0x6266, 0x91FA, 0x925B, 0x5343, /* 0xA0 */
0x9077, 0x7C3D, 0x4EDF, 0x8B19, 0x4E7E, 0x9ED4, 0x9322, 0x9257, /* 0xA0 */
0x524D, 0x6F5B, 0x9063, 0x6DFA, 0x8B74, 0x5879, 0x5D4C, 0x6B20, /* 0xB0 */
0x6B49, 0x69CD, 0x55C6, 0x8154, 0x7F8C, 0x58BB, 0x8594, 0x5F3A, /* 0xB0 */
0x6436, 0x6A47, 0x936C, 0x6572, 0x6084, 0x6A4B, 0x77A7, 0x55AC, /* 0xC0 */
0x50D1, 0x5DE7, 0x9798, 0x64AC, 0x7FF9, 0x5CED, 0x4FCF, 0x7AC5, /* 0xC0 */
0x5207, 0x8304, 0x4E14, 0x602F, 0x7ACA, 0x6B3D, 0x4FB5, 0x89AA, /* 0xD0 */
0x79E6, 0x7434, 0x52E4, 0x82B9, 0x64D2, 0x79BD, 0x5BE2, 0x6C81, /* 0xD0 */
0x9752, 0x8F15, 0x6C2B, 0x50BE, 0x537F, 0x6E05, 0x64CE, 0x6674, /* 0xE0 */
0x6C30, 0x60C5, 0x9803, 0x8ACB, 0x6176, 0x74CA, 0x7AAE, 0x79CB, /* 0xE0 */
0x4E18, 0x90B1, 0x7403, 0x6C42, 0x56DA, 0x914B, 0x6CC5, 0x8DA8, /* 0xF0 */
0x5340, 0x86C6, 0x66F2, 0x8EC0, 0x5C48, 0x9A45, 0x6E20 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_C8[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x53D6, 0x5A36, 0x9F72, 0x8DA3, 0x53BB, 0x5708, 0x9874, /* 0xA0 */
0x6B0A, 0x919B, 0x6CC9, 0x5168, 0x75CA, 0x62F3, 0x72AC, 0x5238, /* 0xA0 */
0x52F8, 0x7F3A, 0x7094, 0x7638, 0x5374, 0x9D72, 0x69B7, 0x78BA, /* 0xB0 */
0x96C0, 0x88D9, 0x7FA4, 0x7136, 0x71C3, 0x5189, 0x67D3, 0x74E4, /* 0xB0 */
0x58E4, 0x6518, 0x56B7, 0x8B93, 0x9952, 0x64FE, 0x7E5E, 0x60F9, /* 0xC0 */
0x71B1, 0x58EC, 0x4EC1, 0x4EBA, 0x5FCD, 0x97CC, 0x4EFB, 0x8A8D, /* 0xC0 */
0x5203, 0x598A, 0x7D09, 0x6254, 0x4ECD, 0x65E5, 0x620E, 0x8338, /* 0xD0 */
0x84C9, 0x69AE, 0x878D, 0x7194, 0x6EB6, 0x5BB9, 0x7D68, 0x5197, /* 0xD0 */
0x63C9, 0x67D4, 0x8089, 0x8339, 0x8815, 0x5112, 0x5B7A, 0x5982, /* 0xE0 */
0x8FB1, 0x4E73, 0x6C5D, 0x5165, 0x8925, 0x8EDF, 0x962E, 0x854A, /* 0xE0 */
0x745E, 0x92ED, 0x958F, 0x6F64, 0x82E5, 0x5F31, 0x6492, 0x7051, /* 0xF0 */
0x85A9, 0x816E, 0x9C13, 0x585E, 0x8CFD, 0x4E09, 0x53C1 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_C9[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5098, 0x6563, 0x6851, 0x55D3, 0x55AA, 0x6414, 0x9A37, /* 0xA0 */
0x6383, 0x5AC2, 0x745F, 0x8272, 0x6F80, 0x68EE, 0x50E7, 0x838E, /* 0xA0 */
0x7802, 0x6BBA, 0x5239, 0x6C99, 0x7D17, 0x50BB, 0x5565, 0x715E, /* 0xB0 */
0x7BE9, 0x66EC, 0x73CA, 0x82EB, 0x6749, 0x5C71, 0x5220, 0x717D, /* 0xB0 */
0x886B, 0x9583, 0x965D, 0x64C5, 0x8D0D, 0x81B3, 0x5584, 0x6C55, /* 0xC0 */
0x6247, 0x7E55, 0x5892, 0x50B7, 0x5546, 0x8CDE, 0x664C, 0x4E0A, /* 0xC0 */
0x5C1A, 0x88F3, 0x68A2, 0x634E, 0x7A0D, 0x71D2, 0x828D, 0x52FA, /* 0xD0 */
0x97F6, 0x5C11, 0x54E8, 0x90B5, 0x7D39, 0x5962, 0x8CD2, 0x86C7, /* 0xD0 */
0x820C, 0x6368, 0x8D66, 0x651D, 0x5C04, 0x61FE, 0x6D89, 0x793E, /* 0xE0 */
0x8A2D, 0x7837, 0x7533, 0x547B, 0x4F38, 0x8EAB, 0x6DF1, 0x5A20, /* 0xE0 */
0x7D33, 0x795E, 0x6C88, 0x5BE9, 0x5B38, 0x751A, 0x814E, 0x614E, /* 0xF0 */
0x6EF2, 0x8072, 0x751F, 0x7525, 0x7272, 0x5347, 0x7E69 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_CA[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x7701, 0x76DB, 0x5269, 0x52DD, 0x8056, 0x5E2B, 0x5931, /* 0xA0 */
0x7345, 0x65BD, 0x6FD5, 0x8A69, 0x5C38, 0x8671, 0x5341, 0x77F3, /* 0xA0 */
0x62FE, 0x6642, 0x4EC0, 0x98DF, 0x8755, 0x5BE6, 0x8B58, 0x53F2, /* 0xB0 */
0x77E2, 0x4F7F, 0x5C4E, 0x99DB, 0x59CB, 0x5F0F, 0x793A, 0x58EB, /* 0xB0 */
0x4E16, 0x67FF, 0x4E8B, 0x62ED, 0x8A93, 0x901D, 0x52E2, 0x662F, /* 0xC0 */
0x55DC, 0x566C, 0x9069, 0x4ED5, 0x4F8D, 0x91CB, 0x98FE, 0x6C0F, /* 0xC0 */
0x5E02, 0x6043, 0x5BA4, 0x8996, 0x8A66, 0x6536, 0x624B, 0x9996, /* 0xD0 */
0x5B88, 0x58FD, 0x6388, 0x552E, 0x53D7, 0x7626, 0x7378, 0x852C, /* 0xD0 */
0x6A1E, 0x68B3, 0x6B8A, 0x6292, 0x8F38, 0x53D4, 0x8212, 0x6DD1, /* 0xE0 */
0x758F, 0x66F8, 0x8D16, 0x5B70, 0x719F, 0x85AF, 0x6691, 0x66D9, /* 0xE0 */
0x7F72, 0x8700, 0x9ECD, 0x9F20, 0x5C6C, 0x8853, 0x8FF0, 0x6A39, /* 0xF0 */
0x675F, 0x620D, 0x7AEA, 0x5885, 0x5EB6, 0x6578, 0x6F31 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_CB[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x6055, 0x5237, 0x800D, 0x6454, 0x8870, 0x7529, 0x5E25, /* 0xA0 */
0x6813, 0x62F4, 0x971C, 0x96D9, 0x723D, 0x8AB0, 0x6C34, 0x7761, /* 0xA0 */
0x7A0E, 0x542E, 0x77AC, 0x9806, 0x821C, 0x8AAC, 0x78A9, 0x6714, /* 0xB0 */
0x720D, 0x65AF, 0x6495, 0x5636, 0x601D, 0x79C1, 0x53F8, 0x7D72, /* 0xB0 */
0x6B7B, 0x8086, 0x5BFA, 0x55E3, 0x56DB, 0x4F3A, 0x4F3C, 0x98FC, /* 0xC0 */
0x5DF3, 0x9B06, 0x8073, 0x616B, 0x980C, 0x9001, 0x5B8B, 0x8A1F, /* 0xC0 */
0x8AA6, 0x641C, 0x8258, 0x64FB, 0x55FD, 0x8607, 0x9165, 0x4FD7, /* 0xD0 */
0x7D20, 0x901F, 0x7C9F, 0x50F3, 0x5851, 0x6EAF, 0x5BBF, 0x8A34, /* 0xD0 */
0x8085, 0x9178, 0x849C, 0x7B97, 0x96D6, 0x968B, 0x96A8, 0x7D8F, /* 0xE0 */
0x9AD3, 0x788E, 0x6B72, 0x7A57, 0x9042, 0x96A7, 0x795F, 0x5B6B, /* 0xE0 */
0x640D, 0x7B0B, 0x84D1, 0x68AD, 0x5506, 0x7E2E, 0x7463, 0x7D22, /* 0xF0 */
0x9396, 0x6240, 0x584C, 0x4ED6, 0x5B83, 0x5979, 0x5854 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_CC[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x737A, 0x64BB, 0x8E4B, 0x8E0F, 0x80CE, 0x82D4, 0x62AC, /* 0xA0 */
0x81FA, 0x6CF0, 0x915E, 0x592A, 0x614B, 0x6C70, 0x574D, 0x6524, /* 0xA0 */
0x8CAA, 0x7671, 0x7058, 0x58C7, 0x6A80, 0x75F0, 0x6F6D, 0x8B5A, /* 0xB0 */
0x8AC7, 0x5766, 0x6BEF, 0x8892, 0x78B3, 0x63A2, 0x5606, 0x70AD, /* 0xB0 */
0x6E6F, 0x5858, 0x642A, 0x5802, 0x68E0, 0x819B, 0x5510, 0x7CD6, /* 0xC0 */
0x5018, 0x8EBA, 0x6DCC, 0x8D9F, 0x71D9, 0x638F, 0x6FE4, 0x6ED4, /* 0xC0 */
0x7E27, 0x8404, 0x6843, 0x9003, 0x6DD8, 0x9676, 0x8A0E, 0x5957, /* 0xD0 */
0x7279, 0x85E4, 0x9A30, 0x75BC, 0x8B04, 0x68AF, 0x5254, 0x8E22, /* 0xD0 */
0x92BB, 0x63D0, 0x984C, 0x8E44, 0x557C, 0x9AD4, 0x66FF, 0x568F, /* 0xE0 */
0x60D5, 0x6D95, 0x5243, 0x5C49, 0x5929, 0x6DFB, 0x586B, 0x7530, /* 0xE0 */
0x751C, 0x606C, 0x8214, 0x8146, 0x6311, 0x689D, 0x8FE2, 0x773A, /* 0xF0 */
0x8DF3, 0x8CBC, 0x9435, 0x5E16, 0x5EF3, 0x807D, 0x70F4 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_CD[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x6C40, 0x5EF7, 0x505C, 0x4EAD, 0x5EAD, 0x633A, 0x8247, /* 0xA0 */
0x901A, 0x6850, 0x916E, 0x77B3, 0x540C, 0x9285, 0x5F64, 0x7AE5, /* 0xA0 */
0x6876, 0x6345, 0x7B52, 0x7D71, 0x75DB, 0x5077, 0x6295, 0x982D, /* 0xB0 */
0x900F, 0x51F8, 0x79C3, 0x7A81, 0x5716, 0x5F92, 0x9014, 0x5857, /* 0xB0 */
0x5C60, 0x571F, 0x5410, 0x5154, 0x6E4D, 0x5718, 0x63A8, 0x983D, /* 0xC0 */
0x817F, 0x8715, 0x892A, 0x9000, 0x541E, 0x5C6F, 0x81C0, 0x62D6, /* 0xC0 */
0x6258, 0x8131, 0x9D15, 0x9640, 0x99B1, 0x99DD, 0x6A62, 0x59A5, /* 0xD0 */
0x62D3, 0x553E, 0x6316, 0x54C7, 0x86D9, 0x7AAA, 0x5A03, 0x74E6, /* 0xD0 */
0x896A, 0x6B6A, 0x5916, 0x8C4C, 0x5F4E, 0x7063, 0x73A9, 0x9811, /* 0xE0 */
0x4E38, 0x70F7, 0x5B8C, 0x7897, 0x633D, 0x665A, 0x7696, 0x60CB, /* 0xE0 */
0x5B9B, 0x5A49, 0x842C, 0x8155, 0x6C6A, 0x738B, 0x4EA1, 0x6789, /* 0xF0 */
0x7DB2, 0x5F80, 0x65FA, 0x671B, 0x5FD8, 0x5984, 0x5A01 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_CE[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5DCD, 0x5FAE, 0x5371, 0x97CB, 0x9055, 0x6845, 0x570D, /* 0xA0 */
0x552F, 0x60DF, 0x7232, 0x6FF0, 0x7DAD, 0x8466, 0x840E, 0x59D4, /* 0xA0 */
0x5049, 0x50DE, 0x5C3E, 0x7DEF, 0x672A, 0x851A, 0x5473, 0x754F, /* 0xB0 */
0x80C3, 0x5582, 0x9B4F, 0x4F4D, 0x6E2D, 0x8B02, 0x5C09, 0x6170, /* 0xB0 */
0x885B, 0x761F, 0x6E29, 0x868A, 0x6587, 0x805E, 0x7D0B, 0x543B, /* 0xC0 */
0x7A69, 0x7D0A, 0x554F, 0x55E1, 0x7FC1, 0x74EE, 0x64BE, 0x8778, /* 0xC0 */
0x6E26, 0x7AA9, 0x6211, 0x65A1, 0x5367, 0x63E1, 0x6C83, 0x5DEB, /* 0xD0 */
0x55DA, 0x93A2, 0x70CF, 0x6C61, 0x8AA3, 0x5C4B, 0x7121, 0x856A, /* 0xD0 */
0x68A7, 0x543E, 0x5434, 0x6BCB, 0x6B66, 0x4E94, 0x6342, 0x5348, /* 0xE0 */
0x821E, 0x4F0D, 0x4FAE, 0x5862, 0x620A, 0x9727, 0x6664, 0x7269, /* 0xE0 */
0x52FF, 0x52D9, 0x609F, 0x8AA4, 0x6614, 0x7199, 0x6790, 0x897F, /* 0xF0 */
0x7852, 0x77FD, 0x6670, 0x563B, 0x5438, 0x932B, 0x72A7 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_CF[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x7A00, 0x606F, 0x5E0C, 0x6089, 0x819D, 0x5915, 0x60DC, /* 0xA0 */
0x7184, 0x70EF, 0x6EAA, 0x6C50, 0x7280, 0x6A84, 0x8972, 0x5E2D, /* 0xA0 */
0x7FD2, 0x5AB3, 0x559C, 0x9291, 0x6D17, 0x7CFB, 0x9699, 0x6232, /* 0xB0 */
0x7D30, 0x778E, 0x8766, 0x5323, 0x971E, 0x8F44, 0x6687, 0x5CFD, /* 0xB0 */
0x4FE0, 0x72F9, 0x4E0B, 0x53A6, 0x590F, 0x5687, 0x6380, 0x9341, /* 0xC0 */
0x5148, 0x4ED9, 0x9BAE, 0x7E96, 0x54B8, 0x8CE2, 0x929C, 0x8237, /* 0xC0 */
0x9591, 0x6D8E, 0x5F26, 0x5ACC, 0x986F, 0x96AA, 0x73FE, 0x737B, /* 0xD0 */
0x7E23, 0x817A, 0x9921, 0x7FA1, 0x61B2, 0x9677, 0x9650, 0x7DAB, /* 0xD0 */
0x76F8, 0x53A2, 0x9472, 0x9999, 0x7BB1, 0x8944, 0x6E58, 0x9109, /* 0xE0 */
0x7FD4, 0x7965, 0x8A73, 0x60F3, 0x97FF, 0x4EAB, 0x9805, 0x5DF7, /* 0xE0 */
0x6A61, 0x50CF, 0x5411, 0x8C61, 0x856D, 0x785D, 0x9704, 0x524A, /* 0xF0 */
0x54EE, 0x56C2, 0x92B7, 0x6D88, 0x5BB5, 0x6DC6, 0x66C9 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_D0[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5C0F, 0x5B5D, 0x6821, 0x8096, 0x562F, 0x7B11, 0x6548, /* 0xA0 */
0x6954, 0x4E9B, 0x6B47, 0x874E, 0x978B, 0x5354, 0x633E, 0x643A, /* 0xA0 */
0x90AA, 0x659C, 0x8105, 0x8AE7, 0x5BEB, 0x68B0, 0x5378, 0x87F9, /* 0xB0 */
0x61C8, 0x6CC4, 0x7009, 0x8B1D, 0x5C51, 0x85AA, 0x82AF, 0x92C5, /* 0xB0 */
0x6B23, 0x8F9B, 0x65B0, 0x5FFB, 0x5FC3, 0x4FE1, 0x91C1, 0x661F, /* 0xC0 */
0x8165, 0x7329, 0x60FA, 0x8208, 0x5211, 0x578B, 0x5F62, 0x90A2, /* 0xC0 */
0x884C, 0x9192, 0x5E78, 0x674F, 0x6027, 0x59D3, 0x5144, 0x51F6, /* 0xD0 */
0x80F8, 0x5308, 0x6C79, 0x96C4, 0x718A, 0x4F11, 0x4FEE, 0x7F9E, /* 0xD0 */
0x673D, 0x55C5, 0x92B9, 0x79C0, 0x8896, 0x7D89, 0x589F, 0x620C, /* 0xE0 */
0x9700, 0x865A, 0x5618, 0x9808, 0x5F90, 0x8A31, 0x84C4, 0x9157, /* 0xE0 */
0x53D9, 0x65ED, 0x5E8F, 0x755C, 0x6064, 0x7D6E, 0x5A7F, 0x7DD2, /* 0xF0 */
0x7E8C, 0x8ED2, 0x55A7, 0x5BA3, 0x61F8, 0x65CB, 0x7384 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_D1[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9078, 0x766C, 0x7729, 0x7D62, 0x9774, 0x859B, 0x5B78, /* 0xA0 */
0x7A74, 0x96EA, 0x8840, 0x52DB, 0x718F, 0x5FAA, 0x65EC, 0x8A62, /* 0xA0 */
0x5C0B, 0x99B4, 0x5DE1, 0x6B89, 0x6C5B, 0x8A13, 0x8A0A, 0x905C, /* 0xB0 */
0x8FC5, 0x58D3, 0x62BC, 0x9D09, 0x9D28, 0x5440, 0x4E2B, 0x82BD, /* 0xB0 */
0x7259, 0x869C, 0x5D16, 0x8859, 0x6DAF, 0x96C5, 0x555E, 0x4E9E, /* 0xC0 */
0x8A1D, 0x7109, 0x54BD, 0x95B9, 0x70DF, 0x6DF9, 0x9E7D, 0x56B4, /* 0xC0 */
0x7814, 0x8712, 0x5CA9, 0x5EF6, 0x8A00, 0x9854, 0x95BB, 0x708E, /* 0xD0 */
0x6CBF, 0x5944, 0x63A9, 0x773C, 0x884D, 0x6F14, 0x8277, 0x5830, /* 0xD0 */
0x71D5, 0x53AD, 0x786F, 0x96C1, 0x5501, 0x5F66, 0x7130, 0x5BB4, /* 0xE0 */
0x8AFA, 0x9A57, 0x6B83, 0x592E, 0x9D26, 0x79E7, 0x694A, 0x63DA, /* 0xE0 */
0x4F6F, 0x760D, 0x7F8A, 0x6D0B, 0x967D, 0x6C27, 0x4EF0, 0x7662, /* 0xF0 */
0x990A, 0x6A23, 0x6F3E, 0x9080, 0x8170, 0x5996, 0x7476 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_D2[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x6447, 0x582F, 0x9065, 0x7A91, 0x8B21, 0x59DA, 0x54AC, /* 0xA0 */
0x8200, 0x85E5, 0x8981, 0x8000, 0x6930, 0x564E, 0x8036, 0x723A, /* 0xA0 */
0x91CE, 0x51B6, 0x4E5F, 0x9801, 0x6396, 0x696D, 0x8449, 0x66F3, /* 0xB0 */
0x814B, 0x591C, 0x6DB2, 0x4E00, 0x58F9, 0x91AB, 0x63D6, 0x92A5, /* 0xB0 */
0x4F9D, 0x4F0A, 0x8863, 0x9824, 0x5937, 0x907A, 0x79FB, 0x5100, /* 0xC0 */
0x80F0, 0x7591, 0x6C82, 0x5B9C, 0x59E8, 0x5F5D, 0x6905, 0x87FB, /* 0xC0 */
0x501A, 0x5DF2, 0x4E59, 0x77E3, 0x4EE5, 0x85DD, 0x6291, 0x6613, /* 0xD0 */
0x9091, 0x5C79, 0x5104, 0x5F79, 0x81C6, 0x9038, 0x8084, 0x75AB, /* 0xD0 */
0x4EA6, 0x88D4, 0x610F, 0x6BC5, 0x61B6, 0x7FA9, 0x76CA, 0x6EA2, /* 0xE0 */
0x8A63, 0x8B70, 0x8ABC, 0x8B6F, 0x5F02, 0x7FFC, 0x7FCC, 0x7E79, /* 0xE0 */
0x8335, 0x852D, 0x56E0, 0x6BB7, 0x97F3, 0x9670, 0x59FB, 0x541F, /* 0xF0 */
0x9280, 0x6DEB, 0x5BC5, 0x98F2, 0x5C39, 0x5F15, 0x96B1 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_D3[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5370, 0x82F1, 0x6AFB, 0x5B30, 0x9DF9, 0x61C9, 0x7E93, /* 0xA0 */
0x7469, 0x87A2, 0x71DF, 0x7192, 0x8805, 0x8FCE, 0x8D0F, 0x76C8, /* 0xA0 */
0x5F71, 0x7A4E, 0x786C, 0x6620, 0x55B2, 0x64C1, 0x50AD, 0x81C3, /* 0xB0 */
0x7670, 0x5EB8, 0x96CD, 0x8E34, 0x86F9, 0x548F, 0x6CF3, 0x6D8C, /* 0xB0 */
0x6C38, 0x607F, 0x52C7, 0x7528, 0x5E7D, 0x512A, 0x60A0, 0x6182, /* 0xC0 */
0x5C24, 0x7531, 0x90F5, 0x923E, 0x7336, 0x6CB9, 0x6E38, 0x9149, /* 0xC0 */
0x6709, 0x53CB, 0x53F3, 0x4F51, 0x91C9, 0x8A98, 0x53C8, 0x5E7C, /* 0xD0 */
0x8FC2, 0x6DE4, 0x4E8E, 0x76C2, 0x6986, 0x865E, 0x611A, 0x8F3F, /* 0xD0 */
0x9918, 0x4FDE, 0x903E, 0x9B5A, 0x6109, 0x6E1D, 0x6F01, 0x9685, /* 0xE0 */
0x4E88, 0x5A31, 0x96E8, 0x8207, 0x5DBC, 0x79B9, 0x5B87, 0x8A9E, /* 0xE0 */
0x7FBD, 0x7389, 0x57DF, 0x828B, 0x9B31, 0x5401, 0x9047, 0x55BB, /* 0xF0 */
0x5CEA, 0x5FA1, 0x6108, 0x6B32, 0x7344, 0x80B2, 0x8B7D /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_D4[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x6D74, 0x5BD3, 0x88D5, 0x9810, 0x8C6B, 0x99AD, 0x9D1B, /* 0xA0 */
0x6DF5, 0x51A4, 0x5143, 0x57A3, 0x8881, 0x539F, 0x63F4, 0x8F45, /* 0xA0 */
0x5712, 0x54E1, 0x5713, 0x733F, 0x6E90, 0x7DE3, 0x9060, 0x82D1, /* 0xB0 */
0x9858, 0x6028, 0x9662, 0x66F0, 0x7D04, 0x8D8A, 0x8E8D, 0x9470, /* 0xB0 */
0x5CB3, 0x7CA4, 0x6708, 0x60A6, 0x95B2, 0x8018, 0x96F2, 0x9116, /* 0xC0 */
0x5300, 0x9695, 0x5141, 0x904B, 0x85F4, 0x9196, 0x6688, 0x97F5, /* 0xC0 */
0x5B55, 0x531D, 0x7838, 0x96DC, 0x683D, 0x54C9, 0x707E, 0x5BB0, /* 0xD0 */
0x8F09, 0x518D, 0x5728, 0x54B1, 0x6522, 0x66AB, 0x8D0A, 0x8D1C, /* 0xD0 */
0x81DF, 0x846C, 0x906D, 0x7CDF, 0x947F, 0x85FB, 0x68D7, 0x65E9, /* 0xE0 */
0x6FA1, 0x86A4, 0x8E81, 0x566A, 0x9020, 0x7682, 0x7AC8, 0x71E5, /* 0xE0 */
0x8CAC, 0x64C7, 0x5247, 0x6FA4, 0x8CCA, 0x600E, 0x589E, 0x618E, /* 0xF0 */
0x66FE, 0x8D08, 0x624E, 0x55B3, 0x6E23, 0x672D, 0x8ECB /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_D5[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9358, 0x9598, 0x7728, 0x6805, 0x69A8, 0x548B, 0x4E4D, /* 0xA0 */
0x70B8, 0x8A50, 0x6458, 0x9F4B, 0x5B85, 0x7A84, 0x50B5, 0x5BE8, /* 0xA0 */
0x77BB, 0x6C08, 0x8A79, 0x7C98, 0x6CBE, 0x76DE, 0x65AC, 0x8F3E, /* 0xB0 */
0x5D84, 0x5C55, 0x8638, 0x68E7, 0x5360, 0x6230, 0x7AD9, 0x6E5B, /* 0xB0 */
0x7DBB, 0x6A1F, 0x7AE0, 0x5F70, 0x6F33, 0x5F35, 0x638C, 0x6F32, /* 0xC0 */
0x6756, 0x4E08, 0x5E33, 0x8CEC, 0x4ED7, 0x8139, 0x7634, 0x969C, /* 0xC0 */
0x62DB, 0x662D, 0x627E, 0x6CBC, 0x8D99, 0x7167, 0x7F69, 0x5146, /* 0xD0 */
0x8087, 0x53EC, 0x906E, 0x6298, 0x54F2, 0x87C4, 0x8F4D, 0x8005, /* 0xD0 */
0x937A, 0x8517, 0x9019, 0x6D59, 0x73CD, 0x659F, 0x771F, 0x7504, /* 0xE0 */
0x7827, 0x81FB, 0x8C9E, 0x91DD, 0x5075, 0x6795, 0x75B9, 0x8A3A, /* 0xE0 */
0x9707, 0x632F, 0x93AE, 0x9663, 0x84B8, 0x6399, 0x775C, 0x5F81, /* 0xF0 */
0x7319, 0x722D, 0x6014, 0x6574, 0x62EF, 0x6B63, 0x653F /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_D6[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5E40, 0x7665, 0x912D, 0x8B49, 0x829D, 0x679D, 0x652F, /* 0xA0 */
0x5431, 0x8718, 0x77E5, 0x80A2, 0x8102, 0x6C41, 0x4E4B, 0x7E54, /* 0xA0 */
0x8077, 0x76F4, 0x690D, 0x6B96, 0x57F7, 0x503C, 0x4F84, 0x5740, /* 0xB0 */
0x6307, 0x6B62, 0x8DBE, 0x8879, 0x65E8, 0x7D19, 0x5FD7, 0x646F, /* 0xB0 */
0x64F2, 0x81F3, 0x81F4, 0x7F6E, 0x5E5F, 0x5CD9, 0x5236, 0x667A, /* 0xC0 */
0x79E9, 0x7A1A, 0x8CEA, 0x7099, 0x75D4, 0x6EEF, 0x6CBB, 0x7A92, /* 0xC0 */
0x4E2D, 0x76C5, 0x5FE0, 0x9418, 0x8877, 0x7D42, 0x7A2E, 0x816B, /* 0xD0 */
0x91CD, 0x4EF2, 0x8846, 0x821F, 0x5468, 0x5DDE, 0x6D32, 0x8B05, /* 0xD0 */
0x7CA5, 0x8EF8, 0x8098, 0x5E1A, 0x5492, 0x76BA, 0x5B99, 0x665D, /* 0xE0 */
0x9A5F, 0x73E0, 0x682A, 0x86DB, 0x6731, 0x732A, 0x8AF8, 0x8A85, /* 0xE0 */
0x9010, 0x7AF9, 0x71ED, 0x716E, 0x62C4, 0x77DA, 0x56D1, 0x4E3B, /* 0xF0 */
0x8457, 0x67F1, 0x52A9, 0x86C0, 0x8CAF, 0x9444, 0x7BC9 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_D7[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x4F4F, 0x6CE8, 0x795D, 0x99D0, 0x6293, 0x722A, 0x62FD, /* 0xA0 */
0x5C08, 0x78DA, 0x8F49, 0x64B0, 0x8CFA, 0x7BC6, 0x6A01, 0x838A, /* 0xA0 */
0x88DD, 0x599D, 0x649E, 0x58EF, 0x72C0, 0x690E, 0x9310, 0x8FFD, /* 0xB0 */
0x8D05, 0x589C, 0x7DB4, 0x8AC4, 0x6E96, 0x6349, 0x62D9, 0x5353, /* 0xB0 */
0x684C, 0x7422, 0x8301, 0x914C, 0x5544, 0x7740, 0x707C, 0x6FC1, /* 0xC0 */
0x5179, 0x54A8, 0x8CC7, 0x59FF, 0x6ECB, 0x6DC4, 0x5B5C, 0x7D2B, /* 0xC0 */
0x4ED4, 0x7C7D, 0x6ED3, 0x5B50, 0x81EA, 0x6F2C, 0x5B57, 0x9B03, /* 0xD0 */
0x68D5, 0x8E2A, 0x5B97, 0x7D9C, 0x7E3D, 0x7E31, 0x9112, 0x8D70, /* 0xD0 */
0x594F, 0x63CD, 0x79DF, 0x8DB3, 0x5352, 0x65CF, 0x7956, 0x8A5B, /* 0xE0 */
0x963B, 0x7D44, 0x947D, 0x7E82, 0x5634, 0x9189, 0x6700, 0x7F6A, /* 0xE0 */
0x5C0A, 0x9075, 0x6628, 0x5DE6, 0x4F50, 0x67DE, 0x505A, 0x4F5C, /* 0xF0 */
0x5750, 0x5EA7 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_D8[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x4E8D, 0x4E0C, 0x5140, 0x4E10, 0x5EFF, 0x5345, 0x4E15, /* 0xA0 */
0x4E98, 0x4E1E, 0x9B32, 0x5B6C, 0x5669, 0x4E28, 0x79BA, 0x4E3F, /* 0xA0 */
0x5315, 0x4E47, 0x592D, 0x723B, 0x536E, 0x6C10, 0x56DF, 0x80E4, /* 0xB0 */
0x9997, 0x6BD3, 0x777E, 0x9F17, 0x4E36, 0x4E9F, 0x9F10, 0x4E5C, /* 0xB0 */
0x4E69, 0x4E93, 0x8288, 0x5B5B, 0x55C7, 0x560F, 0x4EC4, 0x5399, /* 0xC0 */
0x539D, 0x53B4, 0x53A5, 0x53AE, 0x9768, 0x8D0B, 0x531A, 0x53F5, /* 0xC0 */
0x532D, 0x5331, 0x533E, 0x8CFE, 0x5366, 0x5363, 0x5202, 0x5208, /* 0xD0 */
0x520E, 0x5244, 0x5233, 0x528C, 0x5274, 0x524C, 0x525E, 0x5261, /* 0xD0 */
0x525C, 0x84AF, 0x527D, 0x5282, 0x5281, 0x5290, 0x5293, 0x5182, /* 0xE0 */
0x7F54, 0x4EBB, 0x4EC3, 0x4EC9, 0x4EC2, 0x4EE8, 0x4EE1, 0x4EEB, /* 0xE0 */
0x4EDE, 0x50B4, 0x4EF3, 0x4F22, 0x4F64, 0x4EF5, 0x5000, 0x5096, /* 0xF0 */
0x4F09, 0x4F47, 0x4F5E, 0x4F67, 0x6538, 0x4F5A, 0x4F5D /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_D9[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x4F5F, 0x4F57, 0x4F32, 0x4F3D, 0x4F76, 0x4F74, 0x4F91, /* 0xA0 */
0x4F89, 0x4F83, 0x4F8F, 0x4F7E, 0x4F7B, 0x5115, 0x4F7C, 0x5102, /* 0xA0 */
0x4F94, 0x5114, 0x513C, 0x5137, 0x4FC5, 0x4FDA, 0x4FE3, 0x4FDC, /* 0xB0 */
0x4FD1, 0x4FDF, 0x4FF8, 0x5029, 0x504C, 0x4FF3, 0x502C, 0x500F, /* 0xB0 */
0x502E, 0x502D, 0x4FFE, 0x501C, 0x500C, 0x5025, 0x5028, 0x50E8, /* 0xC0 */
0x5043, 0x5055, 0x5048, 0x504E, 0x506C, 0x50C2, 0x513B, 0x5110, /* 0xC0 */
0x513A, 0x50BA, 0x50D6, 0x5106, 0x50ED, 0x50EC, 0x50E6, 0x50EE, /* 0xD0 */
0x5107, 0x510B, 0x4EDD, 0x6C3D, 0x4F58, 0x50C9, 0x4FCE, 0x9FA0, /* 0xD0 */
0x6C46, 0x7CF4, 0x516E, 0x5DFD, 0x9ECC, 0x9998, 0x56C5, 0x5914, /* 0xE0 */
0x52F9, 0x530D, 0x8A07, 0x5310, 0x9CEC, 0x5919, 0x5155, 0x4EA0, /* 0xE0 */
0x5156, 0x4EB3, 0x886E, 0x88A4, 0x893B, 0x81E0, 0x88D2, 0x7980, /* 0xF0 */
0x5B34, 0x8803, 0x7FB8, 0x51AB, 0x51B1, 0x51BD, 0x51BC /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_DA[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x51C7, 0x5196, 0x51A2, 0x51A5, 0x8A01, 0x8A10, 0x8A0C, /* 0xA0 */
0x8A15, 0x8B33, 0x8A4E, 0x8A25, 0x8A41, 0x8A36, 0x8A46, 0x8A54, /* 0xA0 */
0x8A58, 0x8A52, 0x8A86, 0x8A84, 0x8A7F, 0x8A70, 0x8A7C, 0x8A75, /* 0xB0 */
0x8A6C, 0x8A6E, 0x8ACD, 0x8AE2, 0x8A61, 0x8A9A, 0x8AA5, 0x8A91, /* 0xB0 */
0x8A92, 0x8ACF, 0x8AD1, 0x8AC9, 0x8ADB, 0x8AD7, 0x8AC2, 0x8AB6, /* 0xC0 */
0x8AF6, 0x8AEB, 0x8B14, 0x8B01, 0x8AE4, 0x8AED, 0x8AFC, 0x8AF3, /* 0xC0 */
0x8AE6, 0x8AEE, 0x8ADE, 0x8B28, 0x8B9C, 0x8B16, 0x8B1A, 0x8B10, /* 0xD0 */
0x8B2B, 0x8B2D, 0x8B56, 0x8B59, 0x8B4E, 0x8B9E, 0x8B6B, 0x8B96, /* 0xD0 */
0x5369, 0x537A, 0x961D, 0x9622, 0x9621, 0x9631, 0x962A, 0x963D, /* 0xE0 */
0x963C, 0x9642, 0x9658, 0x9654, 0x965F, 0x9689, 0x966C, 0x9672, /* 0xE0 */
0x9674, 0x9688, 0x968D, 0x9697, 0x96B0, 0x9097, 0x909B, 0x913A, /* 0xF0 */
0x9099, 0x9114, 0x90A1, 0x90B4, 0x90B3, 0x90B6, 0x9134 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_DB[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x90B8, 0x90B0, 0x90DF, 0x90C5, 0x90BE, 0x9136, 0x90C4, /* 0xA0 */
0x90C7, 0x9106, 0x9148, 0x90E2, 0x90DC, 0x90D7, 0x90DB, 0x90EB, /* 0xA0 */
0x90EF, 0x90FE, 0x9104, 0x9122, 0x911E, 0x9123, 0x9131, 0x912F, /* 0xB0 */
0x9139, 0x9143, 0x9146, 0x82BB, 0x5950, 0x52F1, 0x52AC, 0x52AD, /* 0xB0 */
0x52BE, 0x54FF, 0x52D0, 0x52D6, 0x52F0, 0x53DF, 0x71EE, 0x77CD, /* 0xC0 */
0x5EF4, 0x51F5, 0x51FC, 0x9B2F, 0x53B6, 0x5F01, 0x755A, 0x5DF0, /* 0xC0 */
0x574C, 0x580A, 0x57A1, 0x587E, 0x58BC, 0x58C5, 0x58D1, 0x5729, /* 0xD0 */
0x572C, 0x572A, 0x5733, 0x58D9, 0x572E, 0x572F, 0x58E2, 0x573B, /* 0xD0 */
0x5742, 0x5769, 0x58E0, 0x576B, 0x58DA, 0x577C, 0x577B, 0x5768, /* 0xE0 */
0x576D, 0x5776, 0x5773, 0x57E1, 0x57A4, 0x578C, 0x584F, 0x57CF, /* 0xE0 */
0x57A7, 0x5816, 0x5793, 0x57A0, 0x57D5, 0x5852, 0x581D, 0x5864, /* 0xF0 */
0x57D2, 0x57B8, 0x57F4, 0x57EF, 0x57F8, 0x57E4, 0x57DD /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_DC[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x580B, 0x580D, 0x57FD, 0x57ED, 0x5800, 0x581E, 0x5819, /* 0xA0 */
0x5844, 0x5820, 0x5865, 0x586C, 0x5881, 0x5889, 0x589A, 0x5880, /* 0xA0 */
0x99A8, 0x9F19, 0x61FF, 0x8279, 0x827D, 0x827F, 0x828F, 0x828A, /* 0xB0 */
0x82A8, 0x8284, 0x828E, 0x8291, 0x858C, 0x8299, 0x82AB, 0x8553, /* 0xB0 */
0x82BE, 0x82B0, 0x85F6, 0x82CA, 0x82E3, 0x8298, 0x82B7, 0x82AE, /* 0xC0 */
0x83A7, 0x8407, 0x84EF, 0x82A9, 0x82B4, 0x82A1, 0x82AA, 0x829F, /* 0xC0 */
0x82C4, 0x82E7, 0x82A4, 0x82E1, 0x8309, 0x82F7, 0x82E4, 0x8622, /* 0xD0 */
0x8307, 0x82DC, 0x82F4, 0x82D2, 0x82D8, 0x830C, 0x82FB, 0x82D3, /* 0xD0 */
0x8526, 0x831A, 0x8306, 0x584B, 0x7162, 0x82E0, 0x82D5, 0x831C, /* 0xE0 */
0x8351, 0x8558, 0x84FD, 0x8308, 0x8392, 0x833C, 0x8334, 0x8331, /* 0xE0 */
0x839B, 0x854E, 0x832F, 0x834F, 0x8347, 0x8343, 0x8588, 0x8340, /* 0xF0 */
0x8317, 0x85BA, 0x832D, 0x833A, 0x8333, 0x7296, 0x6ECE /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_DD[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8541, 0x831B, 0x85CE, 0x8552, 0x84C0, 0x8452, 0x8464, /* 0xA0 */
0x83B0, 0x8378, 0x8494, 0x8435, 0x83A0, 0x83AA, 0x8393, 0x839C, /* 0xA0 */
0x8385, 0x837C, 0x859F, 0x83A9, 0x837D, 0x8555, 0x837B, 0x8398, /* 0xB0 */
0x839E, 0x83A8, 0x9DAF, 0x8493, 0x83C1, 0x8401, 0x83E5, 0x83D8, /* 0xB0 */
0x5807, 0x8418, 0x840B, 0x83DD, 0x83FD, 0x83D6, 0x841C, 0x8438, /* 0xC0 */
0x8411, 0x8406, 0x83D4, 0x83DF, 0x840F, 0x8403, 0x83F8, 0x83F9, /* 0xC0 */
0x83EA, 0x83C5, 0x83C0, 0x7E08, 0x83F0, 0x83E1, 0x845C, 0x8451, /* 0xD0 */
0x845A, 0x8459, 0x8473, 0x8546, 0x8488, 0x847A, 0x8562, 0x8478, /* 0xD0 */
0x843C, 0x8446, 0x8469, 0x8476, 0x851E, 0x848E, 0x8431, 0x846D, /* 0xE0 */
0x84C1, 0x84CD, 0x84D0, 0x9A40, 0x84BD, 0x84D3, 0x84CA, 0x84BF, /* 0xE0 */
0x84BA, 0x863A, 0x84A1, 0x84B9, 0x84B4, 0x8497, 0x93A3, 0x8577, /* 0xF0 */
0x850C, 0x750D, 0x8538, 0x84F0, 0x861E, 0x851F, 0x85FA /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_DE[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8556, 0x853B, 0x84FF, 0x84FC, 0x8559, 0x8548, 0x8568, /* 0xA0 */
0x8564, 0x855E, 0x857A, 0x77A2, 0x8543, 0x8604, 0x857B, 0x85A4, /* 0xA0 */
0x85A8, 0x8587, 0x858F, 0x8579, 0x85EA, 0x859C, 0x8585, 0x85B9, /* 0xB0 */
0x85B7, 0x85B0, 0x861A, 0x85C1, 0x85DC, 0x85FF, 0x8627, 0x8605, /* 0xB0 */
0x8629, 0x8616, 0x863C, 0x5EFE, 0x5F08, 0x593C, 0x5969, 0x8037, /* 0xC0 */
0x5955, 0x595A, 0x5958, 0x530F, 0x5C22, 0x5C25, 0x5C2C, 0x5C37, /* 0xC0 */
0x624C, 0x636B, 0x6476, 0x62BB, 0x62CA, 0x62DA, 0x62D7, 0x62EE, /* 0xD0 */
0x649F, 0x62F6, 0x6339, 0x634B, 0x6343, 0x63AD, 0x63F6, 0x6371, /* 0xD0 */
0x637A, 0x638E, 0x6451, 0x636D, 0x63AC, 0x638A, 0x6369, 0x63AE, /* 0xE0 */
0x645C, 0x63F2, 0x63F8, 0x63E0, 0x64B3, 0x63C4, 0x63DE, 0x63CE, /* 0xE0 */
0x6452, 0x63C6, 0x63BE, 0x6504, 0x6441, 0x640B, 0x641B, 0x6420, /* 0xF0 */
0x640C, 0x6426, 0x6421, 0x645E, 0x6516, 0x646D, 0x6496 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_DF[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x647A, 0x64F7, 0x64FC, 0x6499, 0x651B, 0x64C0, 0x64D0, /* 0xA0 */
0x64D7, 0x64E4, 0x64E2, 0x6509, 0x6525, 0x652E, 0x5F0B, 0x5FD2, /* 0xA0 */
0x7519, 0x5F11, 0x535F, 0x53F1, 0x5630, 0x53E9, 0x53E8, 0x53FB, /* 0xB0 */
0x5412, 0x5416, 0x5406, 0x544B, 0x5638, 0x56C8, 0x5454, 0x56A6, /* 0xB0 */
0x5443, 0x5421, 0x5504, 0x54BC, 0x5423, 0x5432, 0x5482, 0x5494, /* 0xC0 */
0x5477, 0x5471, 0x5464, 0x549A, 0x5680, 0x5484, 0x5476, 0x5466, /* 0xC0 */
0x565D, 0x54D0, 0x54AD, 0x54C2, 0x54B4, 0x5660, 0x54A7, 0x54A6, /* 0xD0 */
0x5635, 0x55F6, 0x5472, 0x54A3, 0x5666, 0x54BB, 0x54BF, 0x54CC, /* 0xD0 */
0x5672, 0x54DA, 0x568C, 0x54A9, 0x54AA, 0x54A4, 0x5665, 0x54CF, /* 0xE0 */
0x54DE, 0x561C, 0x54E7, 0x562E, 0x54FD, 0x5514, 0x54F3, 0x55E9, /* 0xE0 */
0x5523, 0x550F, 0x5511, 0x5527, 0x552A, 0x5616, 0x558F, 0x55B5, /* 0xF0 */
0x5549, 0x56C0, 0x5541, 0x5555, 0x553F, 0x5550, 0x553C /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_E0[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5537, 0x5556, 0x5575, 0x5576, 0x5577, 0x5533, 0x5530, /* 0xA0 */
0x555C, 0x558B, 0x55D2, 0x5583, 0x55B1, 0x55B9, 0x5588, 0x5581, /* 0xA0 */
0x559F, 0x557E, 0x55D6, 0x5591, 0x557B, 0x55DF, 0x560D, 0x56B3, /* 0xB0 */
0x5594, 0x5599, 0x55EA, 0x55F7, 0x55C9, 0x561F, 0x55D1, 0x56C1, /* 0xB0 */
0x55EC, 0x55D4, 0x55E6, 0x55DD, 0x55C4, 0x55EF, 0x55E5, 0x55F2, /* 0xC0 */
0x566F, 0x55CC, 0x55CD, 0x55E8, 0x55F5, 0x55E4, 0x8F61, 0x561E, /* 0xC0 */
0x5608, 0x560C, 0x5601, 0x56B6, 0x5623, 0x55FE, 0x5600, 0x5627, /* 0xD0 */
0x562D, 0x5658, 0x5639, 0x5657, 0x562C, 0x564D, 0x5662, 0x5659, /* 0xD0 */
0x5695, 0x564C, 0x5654, 0x5686, 0x5664, 0x5671, 0x566B, 0x567B, /* 0xE0 */
0x567C, 0x5685, 0x5693, 0x56AF, 0x56D4, 0x56D7, 0x56DD, 0x56E1, /* 0xE0 */
0x5707, 0x56EB, 0x56F9, 0x56FF, 0x5704, 0x570A, 0x5709, 0x571C, /* 0xF0 */
0x5E43, 0x5E19, 0x5E14, 0x5E11, 0x5E6C, 0x5E58, 0x5E57 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_E1[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5E37, 0x5E44, 0x5E54, 0x5E5B, 0x5E5E, 0x5E61, 0x5C8C, /* 0xA0 */
0x5C7A, 0x5C8D, 0x5C90, 0x5D87, 0x5C88, 0x5CF4, 0x5C99, 0x5C91, /* 0xA0 */
0x5D50, 0x5C9C, 0x5CB5, 0x5CA2, 0x5D2C, 0x5CAC, 0x5CAB, 0x5CB1, /* 0xB0 */
0x5CA3, 0x5CC1, 0x5CB7, 0x5DA7, 0x5CD2, 0x5DA0, 0x5CCB, 0x5D22, /* 0xB0 */
0x5D97, 0x5D0D, 0x5D27, 0x5D26, 0x5D2E, 0x5D24, 0x5D1E, 0x5D06, /* 0xC0 */
0x5D1B, 0x5DB8, 0x5D3E, 0x5D34, 0x5D3D, 0x5D6C, 0x5D5B, 0x5D6F, /* 0xC0 */
0x5D81, 0x5D6B, 0x5D4B, 0x5D4A, 0x5D69, 0x5D74, 0x5D82, 0x5D99, /* 0xD0 */
0x5D9D, 0x8C73, 0x5DB7, 0x5DD4, 0x5F73, 0x5F77, 0x5F82, 0x5F87, /* 0xD0 */
0x5F89, 0x540E, 0x5FA0, 0x5F99, 0x5F9C, 0x5FA8, 0x5FAD, 0x5FB5, /* 0xE0 */
0x5FBC, 0x8862, 0x5F61, 0x72AD, 0x72B0, 0x72B4, 0x7377, 0x7341, /* 0xE0 */
0x72C3, 0x72C1, 0x72CE, 0x72CD, 0x72D2, 0x72E8, 0x736A, 0x72E9, /* 0xF0 */
0x733B, 0x72F4, 0x72F7, 0x7301, 0x72F3, 0x736B, 0x72FA /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_E2[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x72FB, 0x7317, 0x7313, 0x7380, 0x730A, 0x731E, 0x731D, /* 0xA0 */
0x737C, 0x7322, 0x7339, 0x7325, 0x732C, 0x7338, 0x7331, 0x7350, /* 0xA0 */
0x734D, 0x7357, 0x7360, 0x736C, 0x736F, 0x737E, 0x821B, 0x5925, /* 0xB0 */
0x98E7, 0x5924, 0x5902, 0x98E0, 0x9933, 0x98E9, 0x993C, 0x98EA, /* 0xB0 */
0x98EB, 0x98ED, 0x98F4, 0x9909, 0x9911, 0x4F59, 0x991B, 0x9937, /* 0xC0 */
0x993F, 0x9943, 0x9948, 0x9949, 0x994A, 0x994C, 0x9962, 0x5E80, /* 0xC0 */
0x5EE1, 0x5E8B, 0x5E96, 0x5EA5, 0x5EA0, 0x5EB9, 0x5EB5, 0x5EBE, /* 0xD0 */
0x5EB3, 0x8CE1, 0x5ED2, 0x5ED1, 0x5EDB, 0x5EE8, 0x5EEA, 0x81BA, /* 0xD0 */
0x5FC4, 0x5FC9, 0x5FD6, 0x61FA, 0x61AE, 0x5FEE, 0x616A, 0x5FE1, /* 0xE0 */
0x5FE4, 0x613E, 0x60B5, 0x6134, 0x5FEA, 0x5FED, 0x5FF8, 0x6019, /* 0xE0 */
0x6035, 0x6026, 0x601B, 0x600F, 0x600D, 0x6029, 0x602B, 0x600A, /* 0xF0 */
0x61CC, 0x6021, 0x615F, 0x61E8, 0x60FB, 0x6137, 0x6042 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_E3[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x606A, 0x60F2, 0x6096, 0x609A, 0x6173, 0x609D, 0x6083, /* 0xA0 */
0x6092, 0x608C, 0x609B, 0x611C, 0x60BB, 0x60B1, 0x60DD, 0x60D8, /* 0xA0 */
0x60C6, 0x60DA, 0x60B4, 0x6120, 0x6192, 0x6115, 0x6123, 0x60F4, /* 0xB0 */
0x6100, 0x610E, 0x612B, 0x614A, 0x6175, 0x61AC, 0x6194, 0x61A7, /* 0xB0 */
0x61B7, 0x61D4, 0x61F5, 0x5FDD, 0x96B3, 0x9582, 0x9586, 0x95C8, /* 0xC0 */
0x958E, 0x9594, 0x958C, 0x95E5, 0x95AD, 0x95AB, 0x9B2E, 0x95AC, /* 0xC0 */
0x95BE, 0x95B6, 0x9B29, 0x95BF, 0x95BD, 0x95BC, 0x95C3, 0x95CB, /* 0xD0 */
0x95D4, 0x95D0, 0x95D5, 0x95DE, 0x4E2C, 0x723F, 0x6215, 0x6C35, /* 0xD0 */
0x6C54, 0x6C5C, 0x6C4A, 0x7043, 0x6C85, 0x6C90, 0x6C94, 0x6C8C, /* 0xE0 */
0x6C68, 0x6C69, 0x6C74, 0x6C76, 0x6C86, 0x6F59, 0x6CD0, 0x6CD4, /* 0xE0 */
0x6CAD, 0x7027, 0x7018, 0x6CF1, 0x6CD7, 0x6CB2, 0x6CE0, 0x6CD6, /* 0xF0 */
0x6FFC, 0x6CEB, 0x6CEE, 0x6CB1, 0x6CD3, 0x6CEF, 0x6D87 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_E4[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x6D39, 0x6D27, 0x6D0C, 0x6D79, 0x6E5E, 0x6D07, 0x6D04, /* 0xA0 */
0x6D19, 0x6D0E, 0x6D2B, 0x6FAE, 0x6D2E, 0x6D35, 0x6D1A, 0x700F, /* 0xA0 */
0x6EF8, 0x6F6F, 0x6D33, 0x6D91, 0x6D6F, 0x6DF6, 0x6F7F, 0x6D5E, /* 0xB0 */
0x6D93, 0x6D94, 0x6D5C, 0x6D60, 0x6D7C, 0x6D63, 0x6E1A, 0x6DC7, /* 0xB0 */
0x6DC5, 0x6DDE, 0x7006, 0x6DBF, 0x6DE0, 0x6FA0, 0x6DE6, 0x6DDD, /* 0xC0 */
0x6DD9, 0x700B, 0x6DAB, 0x6E0C, 0x6DAE, 0x6E2B, 0x6E6E, 0x6E4E, /* 0xC0 */
0x6E6B, 0x6EB2, 0x6E5F, 0x6E86, 0x6E53, 0x6E54, 0x6E32, 0x6E25, /* 0xD0 */
0x6E44, 0x7067, 0x6EB1, 0x6E98, 0x7044, 0x6F2D, 0x7005, 0x6EA5, /* 0xD0 */
0x6EA7, 0x6EBD, 0x6EBB, 0x6EB7, 0x6F77, 0x6EB4, 0x6ECF, 0x6E8F, /* 0xE0 */
0x6EC2, 0x6E9F, 0x6F62, 0x7020, 0x701F, 0x6F24, 0x6F15, 0x6EF9, /* 0xE0 */
0x6F2F, 0x6F36, 0x7032, 0x6F74, 0x6F2A, 0x6F09, 0x6F29, 0x6F89, /* 0xF0 */
0x6F8D, 0x6F8C, 0x6F78, 0x6F72, 0x6F7C, 0x6F7A, 0x7028 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_E5[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x6FC9, 0x6FA7, 0x6FB9, 0x6FB6, 0x6FC2, 0x6FE1, 0x6FEE, /* 0xA0 */
0x6FDE, 0x6FE0, 0x6FEF, 0x701A, 0x7023, 0x701B, 0x7039, 0x7035, /* 0xA0 */
0x705D, 0x705E, 0x5B80, 0x5B84, 0x5B95, 0x5B93, 0x5BA5, 0x5BB8, /* 0xB0 */
0x752F, 0x9A2B, 0x6434, 0x5BE4, 0x5BEE, 0x8930, 0x5BF0, 0x8E47, /* 0xB0 */
0x8B07, 0x8FB6, 0x8FD3, 0x8FD5, 0x8FE5, 0x8FEE, 0x8FE4, 0x9087, /* 0xC0 */
0x8FE6, 0x9015, 0x8FE8, 0x9005, 0x9004, 0x900B, 0x9090, 0x9011, /* 0xC0 */
0x900D, 0x9016, 0x9021, 0x9035, 0x9036, 0x902D, 0x902F, 0x9044, /* 0xD0 */
0x9051, 0x9052, 0x9050, 0x9068, 0x9058, 0x9062, 0x905B, 0x66B9, /* 0xD0 */
0x9074, 0x907D, 0x9082, 0x9088, 0x9083, 0x908B, 0x5F50, 0x5F57, /* 0xE0 */
0x5F56, 0x5F58, 0x5C3B, 0x54AB, 0x5C50, 0x5C59, 0x5B71, 0x5C63, /* 0xE0 */
0x5C68, 0x7FBC, 0x5F33, 0x5F29, 0x5F2D, 0x8274, 0x5F3C, 0x9B3B, /* 0xF0 */
0x5C6E, 0x5981, 0x5983, 0x598D, 0x5AF5, 0x5AD7, 0x59A3 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_E6[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x5997, 0x59CA, 0x5B00, 0x599E, 0x59A4, 0x59D2, 0x59B2, /* 0xA0 */
0x59AF, 0x59D7, 0x59BE, 0x5A6D, 0x5B08, 0x59DD, 0x5B4C, 0x59E3, /* 0xA0 */
0x59D8, 0x59F9, 0x5A0C, 0x5A09, 0x5AA7, 0x5AFB, 0x5A11, 0x5A23, /* 0xB0 */
0x5A13, 0x5A40, 0x5A67, 0x5A4A, 0x5A55, 0x5A3C, 0x5A62, 0x5B0B, /* 0xB0 */
0x80EC, 0x5AAA, 0x5A9B, 0x5A77, 0x5A7A, 0x5ABE, 0x5AEB, 0x5AB2, /* 0xC0 */
0x5B21, 0x5B2A, 0x5AB8, 0x5AE0, 0x5AE3, 0x5B19, 0x5AD6, 0x5AE6, /* 0xC0 */
0x5AD8, 0x5ADC, 0x5B09, 0x5B17, 0x5B16, 0x5B32, 0x5B37, 0x5B40, /* 0xD0 */
0x5C15, 0x5C1C, 0x5B5A, 0x5B65, 0x5B73, 0x5B51, 0x5B53, 0x5B62, /* 0xD0 */
0x99D4, 0x99DF, 0x99D9, 0x9A36, 0x9A5B, 0x99D1, 0x99D8, 0x9A4D, /* 0xE0 */
0x9A4A, 0x99E2, 0x9A6A, 0x9A0F, 0x9A0D, 0x9A05, 0x9A42, 0x9A2D, /* 0xE0 */
0x9A16, 0x9A41, 0x9A2E, 0x9A38, 0x9A43, 0x9A44, 0x9A4F, 0x9A65, /* 0xF0 */
0x9A64, 0x7CF9, 0x7D06, 0x7D02, 0x7D07, 0x7D08, 0x7E8A /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_E7[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x7D1C, 0x7D15, 0x7D13, 0x7D3A, 0x7D32, 0x7D31, 0x7E10, /* 0xA0 */
0x7D3C, 0x7D40, 0x7D3F, 0x7D5D, 0x7D4E, 0x7D73, 0x7D86, 0x7D83, /* 0xA0 */
0x7D88, 0x7DBE, 0x7DBA, 0x7DCB, 0x7DD4, 0x7DC4, 0x7D9E, 0x7DAC, /* 0xB0 */
0x7DB9, 0x7DA3, 0x7DB0, 0x7DC7, 0x7DD9, 0x7DD7, 0x7DF9, 0x7DF2, /* 0xB0 */
0x7E62, 0x7DE6, 0x7DF6, 0x7DF1, 0x7E0B, 0x7DE1, 0x7E09, 0x7E1D, /* 0xC0 */
0x7E1F, 0x7E1E, 0x7E2D, 0x7E0A, 0x7E11, 0x7E7D, 0x7E39, 0x7E35, /* 0xC0 */
0x7E32, 0x7E46, 0x7E45, 0x7E88, 0x7E5A, 0x7E52, 0x7E6E, 0x7E7E, /* 0xD0 */
0x7E70, 0x7E6F, 0x7E98, 0x5E7A, 0x757F, 0x5DDB, 0x753E, 0x9095, /* 0xD0 */
0x738E, 0x74A3, 0x744B, 0x73A2, 0x739F, 0x73CF, 0x73C2, 0x74CF, /* 0xE0 */
0x73B7, 0x73B3, 0x73C0, 0x73C9, 0x73C8, 0x73E5, 0x73D9, 0x980A, /* 0xE0 */
0x740A, 0x73E9, 0x73E7, 0x73DE, 0x74BD, 0x743F, 0x7489, 0x742A, /* 0xF0 */
0x745B, 0x7426, 0x7425, 0x7428, 0x7430, 0x742E, 0x742C /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_E8[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x741B, 0x741A, 0x7441, 0x745C, 0x7457, 0x7455, 0x7459, /* 0xA0 */
0x74A6, 0x746D, 0x747E, 0x749C, 0x74D4, 0x7480, 0x7481, 0x7487, /* 0xA0 */
0x748B, 0x749E, 0x74A8, 0x74A9, 0x7490, 0x74A7, 0x74DA, 0x74BA, /* 0xB0 */
0x97D9, 0x97DE, 0x97DC, 0x674C, 0x6753, 0x675E, 0x6748, 0x69AA, /* 0xB0 */
0x6AEA, 0x6787, 0x676A, 0x6773, 0x6798, 0x6898, 0x6775, 0x68D6, /* 0xC0 */
0x6A05, 0x689F, 0x678B, 0x6777, 0x677C, 0x67F0, 0x6ADB, 0x67D8, /* 0xC0 */
0x6AF3, 0x67E9, 0x67B0, 0x6AE8, 0x67D9, 0x67B5, 0x67DA, 0x67B3, /* 0xD0 */
0x67DD, 0x6800, 0x67C3, 0x67B8, 0x67E2, 0x6ADF, 0x67C1, 0x6A89, /* 0xD0 */
0x6832, 0x6833, 0x690F, 0x6A48, 0x684E, 0x6968, 0x6844, 0x69BF, /* 0xE0 */
0x6883, 0x681D, 0x6855, 0x6A3A, 0x6841, 0x6A9C, 0x6840, 0x6B12, /* 0xE0 */
0x684A, 0x6849, 0x6829, 0x68B5, 0x688F, 0x6874, 0x6877, 0x6893, /* 0xF0 */
0x686B, 0x6B1E, 0x696E, 0x68FC, 0x6ADD, 0x69E7, 0x68F9 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_E9[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x6B0F, 0x68F0, 0x690B, 0x6901, 0x6957, 0x68E3, 0x6910, /* 0xA0 */
0x6971, 0x6939, 0x6960, 0x6942, 0x695D, 0x6B16, 0x696B, 0x6980, /* 0xA0 */
0x6998, 0x6978, 0x6934, 0x69CC, 0x6AEC, 0x6ADA, 0x69CE, 0x6AF8, /* 0xB0 */
0x6966, 0x6963, 0x6979, 0x699B, 0x69A7, 0x69BB, 0x69AB, 0x69AD, /* 0xB0 */
0x69D4, 0x69B1, 0x69C1, 0x69CA, 0x6AB3, 0x6995, 0x6AE7, 0x698D, /* 0xC0 */
0x69FF, 0x6AA3, 0x69ED, 0x6A17, 0x6A18, 0x6A65, 0x69F2, 0x6A44, /* 0xC0 */
0x6A3E, 0x6AA0, 0x6A50, 0x6A5B, 0x6A35, 0x6A8E, 0x6AD3, 0x6A3D, /* 0xD0 */
0x6A28, 0x6A58, 0x6ADE, 0x6A91, 0x6A90, 0x6AA9, 0x6A97, 0x6AAB, /* 0xD0 */
0x7337, 0x7352, 0x6B81, 0x6B82, 0x6BA4, 0x6B84, 0x6B9E, 0x6BAE, /* 0xE0 */
0x6B8D, 0x6BAB, 0x6B9B, 0x6BAF, 0x6BAA, 0x8ED4, 0x8EDB, 0x8EF2, /* 0xE0 */
0x8EFB, 0x8F64, 0x8EF9, 0x8EFC, 0x8EEB, 0x8EE4, 0x8F62, 0x8EFA, /* 0xF0 */
0x8EFE, 0x8F0A, 0x8F07, 0x8F05, 0x8F12, 0x8F26, 0x8F1E /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_EA[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8F1F, 0x8F1C, 0x8F33, 0x8F46, 0x8F54, 0x8ECE, 0x6214, /* 0xA0 */
0x6227, 0x621B, 0x621F, 0x6222, 0x6221, 0x6225, 0x6224, 0x6229, /* 0xA0 */
0x81E7, 0x750C, 0x74F4, 0x74FF, 0x750F, 0x7511, 0x7513, 0x6534, /* 0xB0 */
0x65EE, 0x65EF, 0x65F0, 0x660A, 0x66C7, 0x6772, 0x6603, 0x6615, /* 0xB0 */
0x6600, 0x7085, 0x66F7, 0x661D, 0x6634, 0x6631, 0x6636, 0x6635, /* 0xC0 */
0x8006, 0x665F, 0x66C4, 0x6641, 0x664F, 0x6689, 0x6661, 0x6657, /* 0xC0 */
0x6677, 0x6684, 0x668C, 0x66D6, 0x669D, 0x66BE, 0x66DB, 0x66DC, /* 0xD0 */
0x66E6, 0x66E9, 0x8CC1, 0x8CB0, 0x8CBA, 0x8CBD, 0x8D04, 0x8CB2, /* 0xD0 */
0x8CC5, 0x8D10, 0x8CD1, 0x8CDA, 0x8CD5, 0x8CEB, 0x8CE7, 0x8CFB, /* 0xE0 */
0x8998, 0x89AC, 0x89A1, 0x89BF, 0x89A6, 0x89AF, 0x89B2, 0x89B7, /* 0xE0 */
0x726E, 0x729F, 0x725D, 0x7266, 0x726F, 0x727E, 0x727F, 0x7284, /* 0xF0 */
0x728B, 0x728D, 0x728F, 0x7292, 0x6308, 0x6332, 0x63B0 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_EB[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x643F, 0x64D8, 0x8004, 0x6BEA, 0x6BF3, 0x6BFD, 0x6BFF, /* 0xA0 */
0x6BF9, 0x6C05, 0x6C0C, 0x6C06, 0x6C0D, 0x6C15, 0x6C18, 0x6C19, /* 0xA0 */
0x6C1A, 0x6C21, 0x6C2C, 0x6C24, 0x6C2A, 0x6C32, 0x6535, 0x6555, /* 0xB0 */
0x656B, 0x7258, 0x7252, 0x7256, 0x7230, 0x8662, 0x5216, 0x809F, /* 0xB0 */
0x809C, 0x8093, 0x80BC, 0x670A, 0x80BD, 0x80B1, 0x80AB, 0x80AD, /* 0xC0 */
0x80B4, 0x80B7, 0x6727, 0x8156, 0x80E9, 0x81DA, 0x80DB, 0x80C2, /* 0xC0 */
0x80C4, 0x80D9, 0x80CD, 0x80D7, 0x6710, 0x80DD, 0x811B, 0x80F1, /* 0xD0 */
0x80F4, 0x80ED, 0x81BE, 0x810E, 0x80F2, 0x80FC, 0x6715, 0x8112, /* 0xD0 */
0x8C5A, 0x8161, 0x811E, 0x812C, 0x8118, 0x8132, 0x8148, 0x814C, /* 0xE0 */
0x8153, 0x8174, 0x8159, 0x815A, 0x8171, 0x8160, 0x8169, 0x817C, /* 0xE0 */
0x817D, 0x816D, 0x8167, 0x584D, 0x5AB5, 0x8188, 0x8182, 0x81CF, /* 0xF0 */
0x6ED5, 0x81A3, 0x81AA, 0x81CC, 0x6726, 0x81CA, 0x81BB /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_EC[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x81C1, 0x81A6, 0x6B5F, 0x6B37, 0x6B39, 0x6B43, 0x6B46, /* 0xA0 */
0x6B59, 0x98AE, 0x98AF, 0x98B6, 0x98BC, 0x98C6, 0x98C8, 0x6BB3, /* 0xA0 */
0x5F40, 0x8F42, 0x89F3, 0x6590, 0x9F4F, 0x6595, 0x65BC, 0x65C6, /* 0xB0 */
0x65C4, 0x65C3, 0x65CC, 0x65CE, 0x65D2, 0x65D6, 0x716C, 0x7152, /* 0xB0 */
0x7096, 0x7197, 0x70BB, 0x70C0, 0x70B7, 0x70AB, 0x70B1, 0x71C1, /* 0xC0 */
0x70CA, 0x7110, 0x7113, 0x71DC, 0x712F, 0x7131, 0x7173, 0x715C, /* 0xC0 */
0x7168, 0x7145, 0x7172, 0x714A, 0x7178, 0x717A, 0x7198, 0x71B3, /* 0xD0 */
0x71B5, 0x71A8, 0x71A0, 0x71E0, 0x71D4, 0x71E7, 0x71F9, 0x721D, /* 0xD0 */
0x7228, 0x706C, 0x71FE, 0x7166, 0x71B9, 0x623E, 0x623D, 0x6243, /* 0xE0 */
0x6248, 0x6249, 0x793B, 0x7940, 0x7946, 0x7949, 0x795B, 0x795C, /* 0xE0 */
0x7953, 0x795A, 0x79B0, 0x7957, 0x7960, 0x798E, 0x7967, 0x797A, /* 0xF0 */
0x79AA, 0x798A, 0x799A, 0x79A7, 0x79B3, 0x5FD1, 0x5FD0 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_ED[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x61DF, 0x605D, 0x605A, 0x6067, 0x6041, 0x6059, 0x6063, /* 0xA0 */
0x6164, 0x6106, 0x610D, 0x615D, 0x61A9, 0x619D, 0x61CB, 0x61E3, /* 0xA0 */
0x6207, 0x8080, 0x807F, 0x6C93, 0x6FA9, 0x6DFC, 0x78EF, 0x77F8, /* 0xB0 */
0x78AD, 0x7809, 0x7868, 0x7818, 0x7811, 0x65AB, 0x782D, 0x78B8, /* 0xB0 */
0x781D, 0x7839, 0x792A, 0x7931, 0x781F, 0x783C, 0x7825, 0x782C, /* 0xC0 */
0x7823, 0x7829, 0x784E, 0x786D, 0x7864, 0x78FD, 0x7826, 0x7850, /* 0xC0 */
0x7847, 0x784C, 0x786A, 0x78E7, 0x7893, 0x789A, 0x7887, 0x78E3, /* 0xD0 */
0x78A1, 0x78A3, 0x78B2, 0x78B9, 0x78A5, 0x78D4, 0x78D9, 0x78C9, /* 0xD0 */
0x78EC, 0x78F2, 0x7905, 0x78F4, 0x7913, 0x7924, 0x791E, 0x7934, /* 0xE0 */
0x9F95, 0x9EF9, 0x9EFB, 0x9EFC, 0x76F1, 0x7704, 0x7798, 0x76F9, /* 0xE0 */
0x7707, 0x7708, 0x771A, 0x7722, 0x7719, 0x772D, 0x7726, 0x7735, /* 0xF0 */
0x7738, 0x775E, 0x77BC, 0x7747, 0x7743, 0x775A, 0x7768 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_EE[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x7762, 0x7765, 0x777F, 0x778D, 0x777D, 0x7780, 0x778C, /* 0xA0 */
0x7791, 0x779F, 0x77A0, 0x77B0, 0x77B5, 0x77BD, 0x753A, 0x7540, /* 0xA0 */
0x754E, 0x754B, 0x7548, 0x755B, 0x7572, 0x7579, 0x7583, 0x7F58, /* 0xB0 */
0x7F61, 0x7F5F, 0x8A48, 0x7F68, 0x7F86, 0x7F71, 0x7F79, 0x7F88, /* 0xB0 */
0x7F7E, 0x76CD, 0x76E5, 0x8832, 0x91D2, 0x91D3, 0x91D4, 0x91D9, /* 0xC0 */
0x91D7, 0x91D5, 0x91F7, 0x91E7, 0x91E4, 0x9346, 0x91F5, 0x91F9, /* 0xC0 */
0x9208, 0x9226, 0x9245, 0x9211, 0x9210, 0x9201, 0x9227, 0x9204, /* 0xD0 */
0x9225, 0x9200, 0x923A, 0x9266, 0x9237, 0x9233, 0x9255, 0x923D, /* 0xD0 */
0x9238, 0x925E, 0x926C, 0x926D, 0x923F, 0x9460, 0x9230, 0x9249, /* 0xE0 */
0x9248, 0x924D, 0x922E, 0x9239, 0x9438, 0x92AC, 0x92A0, 0x927A, /* 0xE0 */
0x92AA, 0x92EE, 0x92CF, 0x9403, 0x92E3, 0x943A, 0x92B1, 0x92A6, /* 0xF0 */
0x93A7, 0x9296, 0x92CC, 0x92A9, 0x93F5, 0x9293, 0x927F /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_EF[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x93A9, 0x929A, 0x931A, 0x92AB, 0x9283, 0x940B, 0x92A8, /* 0xA0 */
0x92A3, 0x9412, 0x9338, 0x92F1, 0x93D7, 0x92E5, 0x92F0, 0x92EF, /* 0xA0 */
0x92E8, 0x92BC, 0x92DD, 0x92F6, 0x9426, 0x9427, 0x92C3, 0x92DF, /* 0xB0 */
0x92E6, 0x9312, 0x9306, 0x9369, 0x931B, 0x9340, 0x9301, 0x9315, /* 0xB0 */
0x932E, 0x9343, 0x9307, 0x9308, 0x931F, 0x9319, 0x9365, 0x9347, /* 0xC0 */
0x9376, 0x9354, 0x9364, 0x93AA, 0x9370, 0x9384, 0x93E4, 0x93D8, /* 0xC0 */
0x9428, 0x9387, 0x93CC, 0x9398, 0x93B8, 0x93BF, 0x93A6, 0x93B0, /* 0xD0 */
0x93B5, 0x944C, 0x93E2, 0x93DC, 0x93DD, 0x93CD, 0x93DE, 0x93C3, /* 0xD0 */
0x93C7, 0x93D1, 0x9414, 0x941D, 0x93F7, 0x9465, 0x9413, 0x946D, /* 0xE0 */
0x9420, 0x9479, 0x93F9, 0x9419, 0x944A, 0x9432, 0x943F, 0x9454, /* 0xE0 */
0x9463, 0x937E, 0x77E7, 0x77EC, 0x96C9, 0x79D5, 0x79ED, 0x79E3, /* 0xF0 */
0x79EB, 0x7A06, 0x5D47, 0x7A03, 0x7A02, 0x7A1E, 0x7A14 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_F0[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x7A39, 0x7A37, 0x7A61, 0x9ECF, 0x99A5, 0x7A70, 0x7688, /* 0xA0 */
0x768E, 0x7693, 0x7699, 0x76A4, 0x74DE, 0x74E0, 0x752C, 0x9CE9, /* 0xA0 */
0x9CF6, 0x9D07, 0x9D06, 0x9D23, 0x9D87, 0x9E15, 0x9D1D, 0x9D1F, /* 0xB0 */
0x9DE5, 0x9D2F, 0x9DD9, 0x9D30, 0x9D42, 0x9E1E, 0x9D53, 0x9E1D, /* 0xB0 */
0x9D60, 0x9D52, 0x9DF3, 0x9D5C, 0x9D61, 0x9D93, 0x9D6A, 0x9D6F, /* 0xC0 */
0x9D89, 0x9D98, 0x9D9A, 0x9DC0, 0x9DA5, 0x9DA9, 0x9DC2, 0x9DBC, /* 0xC0 */
0x9E1A, 0x9DD3, 0x9DDA, 0x9DEF, 0x9DE6, 0x9DF2, 0x9DF8, 0x9E0C, /* 0xD0 */
0x9DFA, 0x9E1B, 0x7592, 0x7594, 0x7664, 0x7658, 0x759D, 0x7667, /* 0xD0 */
0x75A3, 0x75B3, 0x75B4, 0x75B8, 0x75C4, 0x75B1, 0x75B0, 0x75C3, /* 0xE0 */
0x75C2, 0x7602, 0x75CD, 0x75E3, 0x7646, 0x75E6, 0x75E4, 0x7647, /* 0xE0 */
0x75E7, 0x7603, 0x75F1, 0x75FC, 0x75FF, 0x7610, 0x7600, 0x7649, /* 0xF0 */
0x760C, 0x761E, 0x760A, 0x7625, 0x763B, 0x7615, 0x7619 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_F1[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x761B, 0x763C, 0x7622, 0x7620, 0x7640, 0x762D, 0x7630, /* 0xA0 */
0x766D, 0x7635, 0x7643, 0x766E, 0x7633, 0x764D, 0x7669, 0x7654, /* 0xA0 */
0x765C, 0x7656, 0x7672, 0x766F, 0x7FCA, 0x7AE6, 0x7A78, 0x7A79, /* 0xB0 */
0x7A80, 0x7A86, 0x7A88, 0x7A95, 0x7AC7, 0x7AA0, 0x7AAC, 0x7AA8, /* 0xB0 */
0x7AB6, 0x7AB3, 0x8864, 0x8869, 0x8872, 0x887D, 0x887F, 0x8882, /* 0xC0 */
0x88A2, 0x8960, 0x88B7, 0x88BC, 0x88C9, 0x8933, 0x88CE, 0x895D, /* 0xC0 */
0x8947, 0x88F1, 0x891A, 0x88FC, 0x88E8, 0x88FE, 0x88F0, 0x8921, /* 0xD0 */
0x8919, 0x8913, 0x8938, 0x890A, 0x8964, 0x892B, 0x8936, 0x8941, /* 0xD0 */
0x8966, 0x897B, 0x758B, 0x80E5, 0x76B8, 0x76B4, 0x77DC, 0x8012, /* 0xE0 */
0x8014, 0x8016, 0x801C, 0x8020, 0x802E, 0x8025, 0x8026, 0x802C, /* 0xE0 */
0x8029, 0x8028, 0x8031, 0x800B, 0x8035, 0x8043, 0x8046, 0x8079, /* 0xF0 */
0x8052, 0x8075, 0x8071, 0x8983, 0x9807, 0x980E, 0x980F /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_F2[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9821, 0x981C, 0x6F41, 0x9826, 0x9837, 0x984E, 0x9853, /* 0xA0 */
0x9873, 0x9862, 0x9859, 0x9865, 0x986C, 0x9870, 0x864D, 0x8654, /* 0xA0 */
0x866C, 0x87E3, 0x8806, 0x867A, 0x867C, 0x867B, 0x86A8, 0x868D, /* 0xB0 */
0x868B, 0x8706, 0x869D, 0x86A7, 0x86A3, 0x86AA, 0x8693, 0x86A9, /* 0xB0 */
0x86B6, 0x86C4, 0x86B5, 0x8823, 0x86B0, 0x86BA, 0x86B1, 0x86AF, /* 0xC0 */
0x86C9, 0x87F6, 0x86B4, 0x86E9, 0x86FA, 0x87EF, 0x86ED, 0x8784, /* 0xC0 */
0x86D0, 0x8713, 0x86DE, 0x8810, 0x86DF, 0x86D8, 0x86D1, 0x8703, /* 0xD0 */
0x8707, 0x86F8, 0x8708, 0x870A, 0x870D, 0x8709, 0x8723, 0x873B, /* 0xD0 */
0x871E, 0x8725, 0x872E, 0x871A, 0x873E, 0x87C8, 0x8734, 0x8731, /* 0xE0 */
0x8729, 0x8737, 0x873F, 0x8782, 0x8722, 0x877D, 0x8811, 0x877B, /* 0xE0 */
0x8760, 0x8770, 0x874C, 0x876E, 0x878B, 0x8753, 0x8763, 0x87BB, /* 0xF0 */
0x8764, 0x8759, 0x8765, 0x8793, 0x87AF, 0x87CE, 0x87D2 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_F3[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x87C6, 0x8788, 0x8785, 0x87AD, 0x8797, 0x8783, 0x87AB, /* 0xA0 */
0x87E5, 0x87AC, 0x87B5, 0x87B3, 0x87CB, 0x87D3, 0x87BD, 0x87D1, /* 0xA0 */
0x87C0, 0x87CA, 0x87DB, 0x87EA, 0x87E0, 0x87EE, 0x8816, 0x8813, /* 0xB0 */
0x87FE, 0x880A, 0x881B, 0x8821, 0x8839, 0x883C, 0x7F36, 0x7F4C, /* 0xB0 */
0x7F44, 0x7F45, 0x8210, 0x7AFA, 0x7AFD, 0x7B08, 0x7BE4, 0x7B04, /* 0xC0 */
0x7B67, 0x7B0A, 0x7B2B, 0x7B0F, 0x7B47, 0x7B38, 0x7B2A, 0x7B19, /* 0xC0 */
0x7B2E, 0x7B31, 0x7B20, 0x7B25, 0x7B24, 0x7B33, 0x7C69, 0x7B1E, /* 0xD0 */
0x7B58, 0x7BF3, 0x7B45, 0x7B75, 0x7B4C, 0x7B8F, 0x7B60, 0x7B6E, /* 0xD0 */
0x7B7B, 0x7B62, 0x7B72, 0x7B71, 0x7B90, 0x7C00, 0x7BCB, 0x7BB8, /* 0xE0 */
0x7BAC, 0x7B9D, 0x7C5C, 0x7B85, 0x7C1E, 0x7B9C, 0x7BA2, 0x7C2B, /* 0xE0 */
0x7BB4, 0x7C23, 0x7BC1, 0x7BCC, 0x7BDD, 0x7BDA, 0x7BE5, 0x7BE6, /* 0xF0 */
0x7BEA, 0x7C0C, 0x7BFE, 0x7BFC, 0x7C0F, 0x7C6A, 0x7C0B /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_F4[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x7C1F, 0x7C2A, 0x7C26, 0x7C38, 0x7C5F, 0x7C40, 0x81FE, /* 0xA0 */
0x8201, 0x8202, 0x8204, 0x81EC, 0x8844, 0x8221, 0x8222, 0x8264, /* 0xA0 */
0x822D, 0x822F, 0x8228, 0x822B, 0x8238, 0x826B, 0x8233, 0x8234, /* 0xB0 */
0x823E, 0x8244, 0x8249, 0x824B, 0x824F, 0x825A, 0x825F, 0x8268, /* 0xB0 */
0x887E, 0x88CA, 0x8888, 0x88D8, 0x88DF, 0x895E, 0x7F9D, 0x7FA5, /* 0xC0 */
0x7FA7, 0x7FAF, 0x7FB0, 0x7FB2, 0x7C7C, 0x6549, 0x7C91, 0x7CF2, /* 0xC0 */
0x7CF6, 0x7C9E, 0x7CA2, 0x7CB2, 0x7CBC, 0x7CBD, 0x7CDD, 0x7CC7, /* 0xD0 */
0x7CCC, 0x7CCD, 0x7CC8, 0x7CC5, 0x7CD7, 0x7CE8, 0x826E, 0x66A8, /* 0xD0 */
0x7FBF, 0x7FCE, 0x7FD5, 0x7FE5, 0x7FE1, 0x7FE6, 0x7FE9, 0x7FEE, /* 0xE0 */
0x7FF3, 0x7CF8, 0x7E36, 0x7DA6, 0x7DAE, 0x7E47, 0x7E9B, 0x9EA9, /* 0xE0 */
0x9EB4, 0x8D73, 0x8D84, 0x8D94, 0x8D91, 0x8DB2, 0x8D67, 0x8D6D, /* 0xF0 */
0x8C47, 0x8C49, 0x914A, 0x9150, 0x914E, 0x914F, 0x9164 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_F5[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9162, 0x9161, 0x9170, 0x9169, 0x916F, 0x91C5, 0x91C3, /* 0xA0 */
0x9172, 0x9174, 0x9179, 0x918C, 0x9185, 0x9190, 0x918D, 0x9191, /* 0xA0 */
0x91A2, 0x91A3, 0x91AA, 0x91AD, 0x91AE, 0x91AF, 0x91B5, 0x91B4, /* 0xB0 */
0x91BA, 0x8C55, 0x9E7A, 0x8E89, 0x8DEB, 0x8E05, 0x8E59, 0x8E69, /* 0xB0 */
0x8DB5, 0x8DBF, 0x8DBC, 0x8DBA, 0x8E4C, 0x8DD6, 0x8DD7, 0x8DDA, /* 0xC0 */
0x8E92, 0x8DCE, 0x8DCF, 0x8DDB, 0x8DC6, 0x8DEC, 0x8E7A, 0x8E55, /* 0xC0 */
0x8DE3, 0x8E9A, 0x8E8B, 0x8DE4, 0x8E09, 0x8DFD, 0x8E14, 0x8E1D, /* 0xD0 */
0x8E1F, 0x8E93, 0x8E2E, 0x8E23, 0x8E91, 0x8E3A, 0x8E40, 0x8E39, /* 0xD0 */
0x8E35, 0x8E3D, 0x8E31, 0x8E49, 0x8E41, 0x8E42, 0x8EA1, 0x8E63, /* 0xE0 */
0x8E4A, 0x8E70, 0x8E76, 0x8E7C, 0x8E6F, 0x8E74, 0x8E85, 0x8EAA, /* 0xE0 */
0x8E94, 0x8E90, 0x8EA6, 0x8E9E, 0x8C78, 0x8C82, 0x8C8A, 0x8C85, /* 0xF0 */
0x8C98, 0x8C94, 0x659B, 0x89D6, 0x89F4, 0x89DA, 0x89DC /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_F6[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x89E5, 0x89EB, 0x89F6, 0x8A3E, 0x8B26, 0x975A, 0x96E9, /* 0xA0 */
0x9742, 0x96EF, 0x9706, 0x973D, 0x9708, 0x970F, 0x970E, 0x972A, /* 0xA0 */
0x9744, 0x9730, 0x973E, 0x9F54, 0x9F5F, 0x9F59, 0x9F60, 0x9F5C, /* 0xB0 */
0x9F66, 0x9F6C, 0x9F6A, 0x9F77, 0x9EFD, 0x9EFF, 0x9F09, 0x96B9, /* 0xB0 */
0x96BC, 0x96BD, 0x96CE, 0x96D2, 0x77BF, 0x8B8E, 0x928E, 0x947E, /* 0xC0 */
0x92C8, 0x93E8, 0x936A, 0x93CA, 0x938F, 0x943E, 0x946B, 0x9B77, /* 0xC0 */
0x9B74, 0x9B81, 0x9B83, 0x9B8E, 0x9C78, 0x7A4C, 0x9B92, 0x9C5F, /* 0xD0 */
0x9B90, 0x9BAD, 0x9B9A, 0x9BAA, 0x9B9E, 0x9C6D, 0x9BAB, 0x9B9D, /* 0xD0 */
0x9C58, 0x9BC1, 0x9C7A, 0x9C31, 0x9C39, 0x9C23, 0x9C37, 0x9BC0, /* 0xE0 */
0x9BCA, 0x9BC7, 0x9BFD, 0x9BD6, 0x9BEA, 0x9BEB, 0x9BE1, 0x9BE4, /* 0xE0 */
0x9BE7, 0x9BDD, 0x9BE2, 0x9BF0, 0x9BDB, 0x9BF4, 0x9BD4, 0x9C5D, /* 0xF0 */
0x9C08, 0x9C10, 0x9C0D, 0x9C12, 0x9C09, 0x9BFF, 0x9C20 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_F7[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9C32, 0x9C2D, 0x9C28, 0x9C25, 0x9C29, 0x9C33, 0x9C3E, /* 0xA0 */
0x9C48, 0x9C3B, 0x9C35, 0x9C45, 0x9C56, 0x9C54, 0x9C52, 0x9C67, /* 0xA0 */
0x977C, 0x9785, 0x97C3, 0x97BD, 0x9794, 0x97C9, 0x97AB, 0x97A3, /* 0xB0 */
0x97B2, 0x97B4, 0x9AB1, 0x9AB0, 0x9AB7, 0x9DBB, 0x9AB6, 0x9ABA, /* 0xB0 */
0x9ABC, 0x9AC1, 0x9AC0, 0x9ACF, 0x9AC2, 0x9AD6, 0x9AD5, 0x9AD1, /* 0xC0 */
0x9B45, 0x9B43, 0x9B58, 0x9B4E, 0x9B48, 0x9B4D, 0x9B51, 0x9957, /* 0xC0 */
0x995C, 0x992E, 0x9955, 0x9954, 0x9ADF, 0x9AE1, 0x9AE6, 0x9AEF, /* 0xD0 */
0x9AEB, 0x9AFB, 0x9AED, 0x9AF9, 0x9B08, 0x9B0F, 0x9B22, 0x9B1F, /* 0xD0 */
0x9B23, 0x4E48, 0x9EBE, 0x7E3B, 0x9E82, 0x9E87, 0x9E88, 0x9E8B, /* 0xE0 */
0x9E92, 0x93D6, 0x9E9D, 0x9E9F, 0x9EDB, 0x9EDC, 0x9EDD, 0x9EE0, /* 0xE0 */
0x9EDF, 0x9EE2, 0x9EF7, 0x9EE7, 0x9EE5, 0x9EF2, 0x9EEF, 0x9F22, /* 0xF0 */
0x9F2C, 0x9F2F, 0x9F39, 0x9F37, 0x9F3D, 0x9F3E, 0x9F44 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_F8[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x896C, 0x95C6, 0x9336, 0x5F46, 0x8514, 0x7E94, 0x5382, /* 0xA0 */
0x51B2, 0x4E11, 0x9F63, 0x5679, 0x515A, 0x6DC0, 0x9F15, 0x6597, /* 0xA0 */
0x5641, 0x9AEE, 0x8303, 0x4E30, 0x8907, 0x5E72, 0x7A40, 0x98B3, /* 0xB0 */
0x5E7F, 0x95A4, 0x9B0D, 0x5212, 0x8FF4, 0x5F59, 0x7A6B, 0x98E2, /* 0xB0 */
0x51E0, 0x50A2, 0x4EF7, 0x8350, 0x8591, 0x5118, 0x636E, 0x6372, /* 0xC0 */
0x524B, 0x5938, 0x774F, 0x8721, 0x814A, 0x7E8D, 0x91CC, 0x66C6, /* 0xC0 */
0x5E18, 0x77AD, 0x9E75, 0x56C9, 0x9EF4, 0x6FDB, 0x61DE, 0x77C7, /* 0xD0 */
0x7030, 0x9EB5, 0x884A, 0x95E2, 0x82F9, 0x51ED, 0x6251, 0x4EC6, /* 0xD0 */
0x6734, 0x97C6, 0x7C64, 0x7E34, 0x97A6, 0x9EAF, 0x786E, 0x820D, /* 0xE0 */
0x672F, 0x677E, 0x56CC, 0x53F0, 0x98B1, 0x6AAF, 0x7F4E, 0x6D82, /* 0xE0 */
0x7CF0, 0x4E07, 0x4FC2, 0x7E6B, 0x9E79, 0x56AE, 0x9B1A, 0x846F, /* 0xF0 */
0x53F6, 0x90C1, 0x79A6, 0x7C72, 0x613F, 0x4E91, 0x9AD2 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplDBCSToUniTab_GBT_F9[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x75C7, 0x96BB, 0x53EA, 0x7DFB, 0x88FD, 0x79CD, 0x7843, /* 0xA0 */
0x7B51, 0x51C6 /* 0xA0 */
}; | the_stack |
create table heap_tbl_a(c1 int, c2 int, c3 int);
create table heap_tbl_b(c1 int, c2 int, c3 int);
create table heap_tbl_c(c1 int, c2 int, c3 int)
partition by range (c2) (
partition p1 values less than(5),
partition p2 values less than(10),
partition p3 values less than(15),
partition p8 values less than(maxvalue)
);
insert into heap_tbl_a select v%20,v,v from generate_series(1, 100) as v;
insert into heap_tbl_b select * from heap_tbl_a;
insert into heap_tbl_c select * from heap_tbl_a;
analyze heap_tbl_a;
analyze heap_tbl_b;
analyze heap_tbl_c;
update pg_class set reltuples = 1200000
where relname in ('heap_tbl_a', 'heap_tbl_b', 'heap_tbl_c');
-- test nestloop seqscan
set enable_indexscan=off;
set enable_indexonlyscan=off;
set enable_bitmapscan=off;
set enable_material=off;
set enable_seqscan=on;
-- test nestloop
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2
) group by 1 order by 1;
--------------------------------------
-- test hashjoin
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ hashjoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2;
select ac1, sum(bc2) from (
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2
) group by 1 order by 1;
-- test mergejoin
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ mergejoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2;
select ac1, sum(bc2) from (
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2
) group by 1 order by 1;
set enable_material=on;
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2
) group by 1 order by 1;
-- test three table join
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
---------------------------------------------------------------------------------
-- index test
create index heap_tbl_b_index_0b on heap_tbl_b(c2);
create index heap_tbl_c_index_0c on heap_tbl_c(c2) local;
set enable_indexscan=on;
set enable_indexonlyscan=off;
set enable_bitmapscan=off;
set enable_material=off;
set enable_seqscan=off;
-- test nestloop
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2
) group by 1 order by 1;
set enable_indexscan=on;
set enable_indexonlyscan=on;
set enable_bitmapscan=off;
set enable_material=off;
set enable_seqscan=off;
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ mergejoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2;
select ac1, sum(bc2) from (
select /*+ mergejoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2
) group by 1 order by 1;
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ hashjoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2;
select ac1, sum(bc2) from (
select /*+ hashjoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2
) group by 1 order by 1;
-- test three table join
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
set enable_indexscan=off;
set enable_indexonlyscan=off;
set enable_bitmapscan=on;
set enable_material=off;
set enable_seqscan=off;
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2
) group by 1 order by 1;
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ mergejoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2;
select ac1, sum(bc2) from (
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2
) group by 1 order by 1;
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ hashjoin(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2
from heap_tbl_a, heap_tbl_b
where heap_tbl_a.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2;
select ac1, sum(bc2) from (
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2
) group by 1 order by 1;
-- test three table join
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
select /*+ hashjoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2;
select ac1, sum(bc2) from (
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2
) group by 1 order by 1;
explain (costs off)
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
select /*+ mergejoin(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2
from heap_tbl_a, heap_tbl_b, heap_tbl_c
where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2 and heap_tbl_a.c1 = 1
order by 1, 2;
drop table heap_tbl_a;
drop table heap_tbl_b;
drop table heap_tbl_c; | the_stack |
------ The file is for llt
-- indexGetPartitionOidList
create table test_reindex_llt (a int)
partition by range (a)
(
partition test_reindex_llt_p1 values less than (10),
partition test_reindex_llt_p2 values less than (20)
);
create index test_reindex_llt_index on test_reindex_llt (a) local;
reindex index test_reindex_llt_index;
drop table test_reindex_llt;
-- isTupleLocatePartition
create table test_exchange_llt (a int)
partition by range (a)
(
partition test_exchange_llt_p1 values less than (10),
partition test_exchange_llt_p2 values less than (20)
);
create table test_ord (a int);
insert into test_ord values (11);
alter table test_exchange_llt exchange partition (test_exchange_llt_p2) with table test_ord with validation;
drop table test_exchange_llt;
drop table test_ord;
-- get_rel_oids
create table test_get_rel_oids_llt (a int)
partition by range (a)
(
partition test_get_rel_oids_llt_p1 values less than (10),
partition test_get_rel_oids_llt_p2 values less than (20)
);
vacuum test_get_rel_oids_llt partition (test_get_rel_oids_llt_p1);
drop table test_get_rel_oids_llt;
-- pg_stat_... funcs
create table test_pg_stat_funcs (a int)
partition by range (a)
(
partition test_pg_stat_funcs_p1 values less than (10),
partition test_pg_stat_funcs_p2 values less than (20)
);
create index test_pg_stat_funcs_index on test_pg_stat_funcs (a) local;
select pg_stat_get_numscans(oid)>-1 from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_numscans(oid)>-1 from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_tuples_returned(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_tuples_returned(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_tuples_fetched(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_tuples_fetched(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_tuples_inserted(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_tuples_inserted(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_tuples_updated(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_tuples_updated(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_tuples_deleted(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_tuples_deleted(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_tuples_hot_updated(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_tuples_hot_updated(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_live_tuples(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_live_tuples(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_dead_tuples(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_dead_tuples(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_blocks_fetched(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_blocks_fetched(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_blocks_hit(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_blocks_hit(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_last_vacuum_time(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_last_vacuum_time(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_last_autovacuum_time(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_last_autovacuum_time(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_last_analyze_time(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_last_analyze_time(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_last_autoanalyze_time(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_last_autoanalyze_time(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_vacuum_count(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_vacuum_count(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_autovacuum_count(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_autovacuum_count(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_analyze_count(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_analyze_count(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_autoanalyze_count(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_autoanalyze_count(oid) from pg_class where relname='test_pg_stat_funcs_index';
analyze test_pg_stat_funcs;
select pg_sleep(1);
select pg_stat_get_xact_tuples_updated(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_xact_tuples_updated(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_xact_tuples_deleted(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_xact_tuples_deleted(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_xact_tuples_inserted(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_xact_tuples_inserted(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_xact_tuples_hot_updated(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_xact_tuples_hot_updated(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_xact_blocks_fetched(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_xact_blocks_fetched(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_xact_blocks_hit(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_xact_blocks_hit(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_xact_numscans(oid)>-1 from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_xact_numscans(oid)>-1 from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_xact_tuples_returned(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_xact_tuples_returned(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_xact_tuples_fetched(oid) from pg_class where relname='test_pg_stat_funcs';
select pg_stat_get_xact_tuples_fetched(oid) from pg_class where relname='test_pg_stat_funcs_index';
select pg_stat_get_last_analyze_time(oid) is not NULL as A from pg_class where relname='test_pg_stat_funcs';
drop table test_pg_stat_funcs;
-- PWJ
create table test_pwj_1 (a int)
distribute by replication
partition by range (a)
(
partition test_pwj_1_p1 values less than (10),
partition test_pwj_1_p2 values less than (20)
);
create table test_pwj_2 (b int)
distribute by replication
partition by range (b)
(
partition test_pwj_2_p1 values less than (10),
partition test_pwj_2_p2 values less than (20)
);
insert into test_pwj_1 values (generate_series(0, 19));
insert into test_pwj_2 values (generate_series(0, 19));
set enable_partitionwise = on;
-- try_nestloop_path
set enable_nestloop = on;
set enable_mergejoin = off;
set enable_hashjoin = off;
select * from test_pwj_1 inner join test_pwj_2 on a=b;
-- try_mergejoin_path
set enable_nestloop = off;
set enable_mergejoin = on;
set enable_hashjoin = off;
select * from test_pwj_1 inner join test_pwj_2 on a=b;
-- try_hasjoin_path
set enable_nestloop = off;
set enable_mergejoin = on;
set enable_hashjoin = off;
select * from test_pwj_1 inner join test_pwj_2 on a=b;
drop table test_pwj_1;
drop table test_pwj_2;
-- pwj with index
create table test_pwj_idx_1 (c1 int, c2 int)
distribute by replication
partition by range (c1)
(
partition test_pwj_idx_1_p1 values less than (10),
partition test_pwj_idx_1_p2 values less than (20)
);
create index idx_test_pwj_idx_1 on test_pwj_idx_1(c1) local;
create table test_pwj_idx_2 (c3 int, c4 int)
distribute by replication
partition by range (c3)
(
partition test_pwj_idx_2_p1 values less than (10),
partition test_pwj_idx_2_p2 values less than (20)
);
create index idx_test_pwj_idx_2 on test_pwj_idx_2(c3) local;
insert into test_pwj_idx_1 values (generate_series(0, 19), generate_series(0, 19));
insert into test_pwj_idx_2 values (generate_series(0, 19), generate_series(0, 19));
set enable_partitionwise = on;
set enable_seqscan = off;
-- try_nestloop_path
alter index idx_test_pwj_idx_1 modify partition test_pwj_idx_1_p1_c1_idx unusable;
set enable_nestloop = on;
set enable_mergejoin = off;
set enable_hashjoin = off;
select c1, c3 from test_pwj_idx_1 inner join test_pwj_idx_2 on c1=c3;
-- try_mergejoin_path
alter index idx_test_pwj_idx_2 modify partition test_pwj_idx_2_p1_c3_idx unusable;
set enable_nestloop = off;
set enable_mergejoin = on;
set enable_hashjoin = off;
select c1, c3 from test_pwj_idx_1 inner join test_pwj_idx_2 on c1=c3;
-- try_hasjoin_path
alter index idx_test_pwj_idx_1 unusable;
alter index idx_test_pwj_idx_2 unusable;
set enable_nestloop = off;
set enable_mergejoin = on;
set enable_hashjoin = off;
select c1, c3 from test_pwj_idx_1 inner join test_pwj_idx_2 on c1=c3;
drop table test_pwj_idx_1;
drop table test_pwj_idx_2;
-- reindexPartIndex
create table test_reindexPartIndex (a int)
partition by range (a)
(
partition test_reindexPartIndex_p1 values less than (10),
partition test_reindexPartIndex_p2 values less than (20)
);
create index test_reindexPartIndex_index on test_reindexPartIndex (a) local
(
partition test_reindexPartIndex_p1_index,
partition test_reindexPartIndex_p2_index
);
reindex index test_reindexPartIndex_index;
drop table test_reindexPartIndex;
-- estimatePartitionSize
create table test_estimatePartitionSize (a int)
partition by range (a)
(
partition test_reindexPartIndex_p1 values less than (10),
partition test_reindexPartIndex_p2 values less than (20)
);
create index test_estimatePartitionSize_index on test_estimatePartitionSize (a) local;
insert into test_estimatePartitionSize values (1);
analyze test_estimatePartitionSize;
cluster test_estimatePartitionSize using test_estimatePartitionSize_index;
drop table test_estimatePartitionSize;
-- get_rel_oids
create table test_get_rel_oids(a int)
partition by range (a)
(
partition test_get_rel_oids_p1 values less than (10),
partition test_get_rel_oids_p2 values less than (20)
);
vacuum;
drop table test_get_rel_oids;
create table PARTITION_EXCHANGE_TABLE_028_1(c_varchar varchar(100)) partition by range (c_varchar) (
partition PARTITION_EXCHANGE_TABLE_028_1_1 values less than ('AAAA') ,
partition PARTITION_EXCHANGE_TABLE_028_1_2 values less than ('ZZZZ') ,
partition PARTITION_EXCHANGE_TABLE_028_1_3 values less than ('ZZZZa'));
create table PARTITION_EXCHANGE_TABLE_028_2(a varchar);
alter table PARTITION_EXCHANGE_TABLE_028_1 exchange partition for('ZZZZ','AAAA') with table PARTITION_EXCHANGE_TABLE_028_2 with validation;
alter table PARTITION_EXCHANGE_TABLE_028_1 merge partitions PARTITION_EXCHANGE_TABLE_028_1_1,PARTITION_EXCHANGE_TABLE_028_1_3 into partition PARTITION_EXCHANGE_TABLE_028_1_4;
drop table PARTITION_EXCHANGE_TABLE_028_1;
drop table PARTITION_EXCHANGE_TABLE_028_2;
create table setop_002 (
w_warehouse_sk integer not null,
w_warehouse_id char(16) not null,
w_warehouse_date varchar(50) ,
w_warehouse_sq_ft integer ,
w_street_number smallint ,
w_street_name varchar(60) ,
w_street_type char(15) ,
w_suite_number char(10) ,
w_city varchar(60) ,
w_county varchar(30) ,
w_state char(2) ,
w_country Boolean ,
w_gmt_offset decimal(5,2)
)distribute by hash(w_gmt_offset,w_state,w_county,w_street_number,w_warehouse_sq_ft);
create table call_center
(
cc_call_center_sk integer not null,
cc_call_center_id char(16) not null,
cc_rec_start_date date ,
cc_rec_end_date date ,
cc_closed_date_sk integer ,
cc_open_date_sk integer ,
cc_name varchar(50) ,
cc_class varchar(50) ,
cc_employees integer ,
cc_sq_ft integer ,
cc_hours char(20) ,
cc_manager varchar(40) ,
cc_mkt_id integer ,
cc_mkt_class char(50) ,
cc_mkt_desc varchar(100) ,
cc_market_manager varchar(40) ,
cc_division integer ,
cc_division_name varchar(50) ,
cc_company integer ,
cc_company_name char(50) ,
cc_street_number char(10) ,
cc_street_name varchar(60) ,
cc_street_type char(15) ,
cc_suite_number char(10) ,
cc_city varchar(60) ,
cc_county varchar(30) ,
cc_state char(2) ,
cc_zip char(10) ,
cc_country varchar(20) ,
cc_gmt_offset decimal(5,2) ,
cc_tax_percentage decimal(5,2)
) distribute by hash (cc_call_center_id);
create table web_page
(
wp_web_page_sk integer not null,
wp_web_page_id char(16) not null,
wp_rec_start_date date ,
wp_rec_end_date date ,
wp_creation_date_sk integer ,
wp_access_date_sk integer ,
wp_autogen_flag char(1) ,
wp_customer_sk integer ,
wp_url varchar(100) ,
wp_type char(50) ,
wp_char_count integer ,
wp_link_count integer ,
wp_image_count integer ,
wp_max_ad_count integer
) distribute by hash (wp_rec_start_date,wp_autogen_flag)
partition by range(wp_rec_start_date)
(
partition p1 values less than('1990-01-01'),
partition p2 values less than('1995-01-01'),
partition p3 values less than('2000-01-01'),
partition p4 values less than('2005-01-01'),
partition p5 values less than('2010-01-01'),
partition p6 values less than('2015-01-01'),
partition p7 values less than(maxvalue)
);
select w_warehouse_date from setop_002
where w_warehouse_date in (select cc_rec_start_date from call_center union all select wp_rec_start_date from web_page);
drop table setop_002;
drop table call_center;
drop table web_page;
create table t10 (c1 int, c2 date)
partition by range(c2)
(
partition "01" values less than ('2015-01-01'),
partition "02" values less than ('2018-09-06'),
partition p01 values less than ('2018-09-07'),
partition p02 values less than ('2018-09-08')
) ENABLE ROW MOVEMENT;
create index t10_idx on t10(c2) local(
partition "01",
partition "02",
partition p01,
partition p02
);
select pg_get_indexdef('t10_idx'::regclass::oid);
\d+ t10
drop table t10; | the_stack |
CREATE OR REPLACE FUNCTION water_class(waterway text, water text) RETURNS text AS
$$
SELECT CASE
WHEN waterway='riverbank' THEN 'river'
%%FIELD_MAPPING: class %%
ELSE 'lake'
END;
$$ LANGUAGE SQL IMMUTABLE
PARALLEL SAFE;
CREATE OR REPLACE FUNCTION waterway_brunnel(is_bridge bool, is_tunnel bool) RETURNS text AS
$$
SELECT CASE
WHEN is_bridge THEN 'bridge'
WHEN is_tunnel THEN 'tunnel'
END;
$$ LANGUAGE SQL IMMUTABLE
STRICT
PARALLEL SAFE;
-- ne_10m_ocean
-- etldoc: ne_10m_ocean -> ne_10m_ocean_gen_z5
DROP MATERIALIZED VIEW IF EXISTS ne_10m_ocean_gen_z5 CASCADE;
CREATE MATERIALIZED VIEW ne_10m_ocean_gen_z5 AS
(
SELECT ST_Simplify(geometry, ZRes(7)) AS geometry,
'ocean'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM ne_10m_ocean
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_10m_ocean_gen_z5_idx ON ne_10m_ocean_gen_z5 USING gist (geometry);
-- ne_10m_lakes
-- etldoc: ne_10m_lakes -> ne_10m_lakes_gen_z5
DROP MATERIALIZED VIEW IF EXISTS ne_10m_lakes_gen_z5 CASCADE;
CREATE MATERIALIZED VIEW ne_10m_lakes_gen_z5 AS
(
SELECT ogc_fid,
ST_MakeValid(ST_Simplify(geometry, ZRes(7))) AS geometry,
'lake'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM ne_10m_lakes
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_10m_lakes_gen_z5_idx ON ne_10m_lakes_gen_z5 USING gist (geometry);
-- etldoc: ne_10m_lakes_gen_z5 -> ne_10m_lakes_gen_z4
DROP MATERIALIZED VIEW IF EXISTS ne_10m_lakes_gen_z4 CASCADE;
CREATE MATERIALIZED VIEW ne_10m_lakes_gen_z4 AS
(
SELECT ogc_fid,
ST_MakeValid(ST_Simplify(geometry, ZRes(6))) AS geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_10m_lakes_gen_z5
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_10m_lakes_gen_z4_idx ON ne_10m_lakes_gen_z4 USING gist (geometry);
-- ne_50m_ocean
-- etldoc: ne_50m_ocean -> ne_50m_ocean_gen_z4
DROP MATERIALIZED VIEW IF EXISTS ne_50m_ocean_gen_z4 CASCADE;
CREATE MATERIALIZED VIEW ne_50m_ocean_gen_z4 AS
(
SELECT ST_Simplify(geometry, ZRes(6)) AS geometry,
'ocean'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM ne_50m_ocean
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_50m_ocean_gen_z4_idx ON ne_50m_ocean_gen_z4 USING gist (geometry);
-- etldoc: ne_50m_ocean_gen_z4 -> ne_50m_ocean_gen_z3
DROP MATERIALIZED VIEW IF EXISTS ne_50m_ocean_gen_z3 CASCADE;
CREATE MATERIALIZED VIEW ne_50m_ocean_gen_z3 AS
(
SELECT ST_Simplify(geometry, ZRes(5)) AS geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_50m_ocean_gen_z4
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_50m_ocean_gen_z3_idx ON ne_50m_ocean_gen_z3 USING gist (geometry);
-- etldoc: ne_50m_ocean_gen_z3 -> ne_50m_ocean_gen_z2
DROP MATERIALIZED VIEW IF EXISTS ne_50m_ocean_gen_z2 CASCADE;
CREATE MATERIALIZED VIEW ne_50m_ocean_gen_z2 AS
(
SELECT ST_Simplify(geometry, ZRes(4)) AS geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_50m_ocean_gen_z3
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_50m_ocean_gen_z2_idx ON ne_50m_ocean_gen_z2 USING gist (geometry);
-- ne_50m_lakes
-- etldoc: ne_50m_lakes -> ne_50m_lakes_gen_z3
DROP MATERIALIZED VIEW IF EXISTS ne_50m_lakes_gen_z3 CASCADE;
CREATE MATERIALIZED VIEW ne_50m_lakes_gen_z3 AS
(
SELECT ogc_fid,
ST_MakeValid(ST_Simplify(geometry, ZRes(5))) AS geometry,
'lakes'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM ne_50m_lakes
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_50m_lakes_gen_z3_idx ON ne_50m_lakes_gen_z3 USING gist (geometry);
-- etldoc: ne_50m_lakes_gen_z3 -> ne_50m_lakes_gen_z2
DROP MATERIALIZED VIEW IF EXISTS ne_50m_lakes_gen_z2 CASCADE;
CREATE MATERIALIZED VIEW ne_50m_lakes_gen_z2 AS
(
SELECT ogc_fid,
ST_MakeValid(ST_Simplify(geometry, ZRes(4))) AS geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_50m_lakes_gen_z3
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_50m_lakes_gen_z2_idx ON ne_50m_lakes_gen_z2 USING gist (geometry);
--ne_110m_ocean
-- etldoc: ne_110m_ocean -> ne_110m_ocean_gen_z1
DROP MATERIALIZED VIEW IF EXISTS ne_110m_ocean_gen_z1 CASCADE;
CREATE MATERIALIZED VIEW ne_110m_ocean_gen_z1 AS
(
SELECT ST_Simplify(geometry, ZRes(3)) AS geometry,
'ocean'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM ne_110m_ocean
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_110m_ocean_gen_z1_idx ON ne_110m_ocean_gen_z1 USING gist (geometry);
-- etldoc: ne_110m_ocean_gen_z1 -> ne_110m_ocean_gen_z0
DROP MATERIALIZED VIEW IF EXISTS ne_110m_ocean_gen_z0 CASCADE;
CREATE MATERIALIZED VIEW ne_110m_ocean_gen_z0 AS
(
SELECT ST_Simplify(geometry, ZRes(2)) AS geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_110m_ocean_gen_z1
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_110m_ocean_gen_z0_idx ON ne_110m_ocean_gen_z0 USING gist (geometry);
-- ne_110m_lakes
-- etldoc: ne_110m_lakes -> ne_110m_lakes_gen_z1
DROP MATERIALIZED VIEW IF EXISTS ne_110m_lakes_gen_z1 CASCADE;
CREATE MATERIALIZED VIEW ne_110m_lakes_gen_z1 AS
(
SELECT ogc_fid,
ST_Simplify(geometry, ZRes(3)) AS geometry,
'lakes'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM ne_110m_lakes
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_110m_lakes_gen_z1_idx ON ne_110m_lakes_gen_z1 USING gist (geometry);
-- etldoc: ne_110m_lakes_gen_z1 -> ne_110m_lakes_gen_z0
DROP MATERIALIZED VIEW IF EXISTS ne_110m_lakes_gen_z0 CASCADE;
CREATE MATERIALIZED VIEW ne_110m_lakes_gen_z0 AS
(
SELECT ogc_fid,
ST_Simplify(geometry, ZRes(2)) AS geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_110m_lakes_gen_z1
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_110m_lakes_gen_z0_idx ON ne_110m_lakes_gen_z0 USING gist (geometry);
CREATE OR REPLACE VIEW water_z0 AS
(
-- etldoc: ne_110m_ocean_gen_z0 -> water_z0
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_110m_ocean_gen_z0
UNION ALL
-- etldoc: ne_110m_lakes_gen_z0 -> water_z0
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_110m_lakes_gen_z0
);
CREATE OR REPLACE VIEW water_z1 AS
(
-- etldoc: ne_110m_ocean_gen_z1 -> water_z1
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_110m_ocean_gen_z1
UNION ALL
-- etldoc: ne_110m_lakes_gen_z1 -> water_z1
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_110m_lakes_gen_z1
);
CREATE OR REPLACE VIEW water_z2 AS
(
-- etldoc: ne_50m_ocean_gen_z2 -> water_z2
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_50m_ocean_gen_z2
UNION ALL
-- etldoc: ne_50m_lakes_gen_z2 -> water_z2
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_50m_lakes_gen_z2
);
CREATE OR REPLACE VIEW water_z3 AS
(
-- etldoc: ne_50m_ocean_gen_z3 -> water_z3
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_50m_ocean_gen_z3
UNION ALL
-- etldoc: ne_50m_lakes_gen_z3 -> water_z3
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_50m_lakes_gen_z3
);
CREATE OR REPLACE VIEW water_z4 AS
(
-- etldoc: ne_50m_ocean_gen_z4 -> water_z4
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_50m_ocean_gen_z4
UNION ALL
-- etldoc: ne_10m_lakes_gen_z4 -> water_z4
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_10m_lakes_gen_z4
);
CREATE OR REPLACE VIEW water_z5 AS
(
-- etldoc: ne_10m_ocean_gen_z5 -> water_z5
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_10m_ocean_gen_z5
UNION ALL
-- etldoc: ne_10m_lakes_gen_z5 -> water_z5
SELECT geometry,
class,
is_intermittent,
is_bridge,
is_tunnel
FROM ne_10m_lakes_gen_z5
);
CREATE OR REPLACE VIEW water_z6 AS
(
-- etldoc: osm_ocean_polygon_gen_z6 -> water_z6
SELECT geometry,
'ocean'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_ocean_polygon_gen_z6
UNION ALL
-- etldoc: osm_water_polygon_gen_z6 -> water_z6
SELECT geometry,
water_class(waterway, water) AS class,
is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_water_polygon_gen_z6
WHERE "natural" != 'bay'
);
CREATE OR REPLACE VIEW water_z7 AS
(
-- etldoc: osm_ocean_polygon_gen_z7 -> water_z7
SELECT geometry,
'ocean'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_ocean_polygon_gen_z7
UNION ALL
-- etldoc: osm_water_polygon_gen_z7 -> water_z7
SELECT geometry,
water_class(waterway, water) AS class,
is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_water_polygon_gen_z7
WHERE "natural" != 'bay'
);
CREATE OR REPLACE VIEW water_z8 AS
(
-- etldoc: osm_ocean_polygon_gen_z8 -> water_z8
SELECT geometry,
'ocean'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_ocean_polygon_gen_z8
UNION ALL
-- etldoc: osm_water_polygon_gen_z8 -> water_z8
SELECT geometry,
water_class(waterway, water) AS class,
is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_water_polygon_gen_z8
WHERE "natural" != 'bay'
);
CREATE OR REPLACE VIEW water_z9 AS
(
-- etldoc: osm_ocean_polygon_gen_z9 -> water_z9
SELECT geometry,
'ocean'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_ocean_polygon_gen_z9
UNION ALL
-- etldoc: osm_water_polygon_gen_z9 -> water_z9
SELECT geometry,
water_class(waterway, water) AS class,
is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_water_polygon_gen_z9
WHERE "natural" != 'bay'
);
CREATE OR REPLACE VIEW water_z10 AS
(
-- etldoc: osm_ocean_polygon_gen_z10 -> water_z10
SELECT geometry,
'ocean'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_ocean_polygon_gen_z10
UNION ALL
-- etldoc: osm_water_polygon_gen_z10 -> water_z10
SELECT geometry,
water_class(waterway, water) AS class,
is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_water_polygon_gen_z10
WHERE "natural" != 'bay'
);
CREATE OR REPLACE VIEW water_z11 AS
(
-- etldoc: osm_ocean_polygon_gen_z11 -> water_z11
SELECT geometry,
'ocean'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_ocean_polygon_gen_z11
UNION ALL
-- etldoc: osm_water_polygon_gen_z11 -> water_z11
SELECT geometry,
water_class(waterway, water) AS class,
is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_water_polygon_gen_z11
WHERE "natural" != 'bay'
);
CREATE OR REPLACE VIEW water_z12 AS
(
-- etldoc: osm_ocean_polygon_union -> water_z12
SELECT geometry,
'ocean'::text AS class,
NULL::boolean AS is_intermittent,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel
FROM osm_ocean_polygon_union
UNION ALL
-- etldoc: osm_water_polygon -> water_z12
SELECT geometry,
water_class(waterway, water) AS class,
is_intermittent,
is_bridge,
is_tunnel
FROM osm_water_polygon
WHERE "natural" != 'bay'
);
-- etldoc: layer_water [shape=record fillcolor=lightpink, style="rounded,filled",
-- etldoc: label="layer_water |<z0> z0|<z1>z1|<z2>z2|<z3>z3 |<z4> z4|<z5>z5|<z6>z6|<z7>z7| <z8> z8 |<z9> z9 |<z10> z10 |<z11> z11 |<z12> z12+" ] ;
CREATE OR REPLACE FUNCTION layer_water(bbox geometry, zoom_level int)
RETURNS TABLE
(
geometry geometry,
class text,
brunnel text,
intermittent int
)
AS
$$
SELECT geometry,
class::text,
waterway_brunnel(is_bridge, is_tunnel) AS brunnel,
is_intermittent::int AS intermittent
FROM (
-- etldoc: water_z0 -> layer_water:z0
SELECT *
FROM water_z0
WHERE zoom_level = 0
UNION ALL
-- etldoc: water_z1 -> layer_water:z1
SELECT *
FROM water_z1
WHERE zoom_level = 1
UNION ALL
-- etldoc: water_z2 -> layer_water:z2
SELECT *
FROM water_z2
WHERE zoom_level = 2
UNION ALL
-- etldoc: water_z3 -> layer_water:z3
SELECT *
FROM water_z3
WHERE zoom_level = 3
UNION ALL
-- etldoc: water_z4 -> layer_water:z4
SELECT *
FROM water_z4
WHERE zoom_level = 4
UNION ALL
-- etldoc: water_z5 -> layer_water:z5
SELECT *
FROM water_z5
WHERE zoom_level = 5
UNION ALL
-- etldoc: water_z6 -> layer_water:z6
SELECT *
FROM water_z6
WHERE zoom_level = 6
UNION ALL
-- etldoc: water_z7 -> layer_water:z7
SELECT *
FROM water_z7
WHERE zoom_level = 7
UNION ALL
-- etldoc: water_z8 -> layer_water:z8
SELECT *
FROM water_z8
WHERE zoom_level = 8
UNION ALL
-- etldoc: water_z9 -> layer_water:z9
SELECT *
FROM water_z9
WHERE zoom_level = 9
UNION ALL
-- etldoc: water_z10 -> layer_water:z10
SELECT *
FROM water_z10
WHERE zoom_level = 10
UNION ALL
-- etldoc: water_z11 -> layer_water:z11
SELECT *
FROM water_z11
WHERE zoom_level = 11
UNION ALL
-- etldoc: water_z12 -> layer_water:z12
SELECT *
FROM water_z12
WHERE zoom_level >= 12
) AS zoom_levels
WHERE geometry && bbox;
$$ LANGUAGE SQL STABLE
-- STRICT
PARALLEL SAFE; | the_stack |
--
-- renaming and rearanging fields to better distinguish between *filters* and *assignments*;
-- also translating and fixing some entitytypes etc
--
-- 05.11.2015 10:56
-- URL zum Konzept
INSERT INTO AD_FieldGroup (AD_Client_ID,AD_FieldGroup_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,IsCollapsedByDefault,Name,Updated,UpdatedBy) VALUES (0,540080,0,TO_TIMESTAMP('2015-11-05 10:56:30','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','Filterkriterien',TO_TIMESTAMP('2015-11-05 10:56:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 05.11.2015 10:56
-- URL zum Konzept
INSERT INTO AD_FieldGroup_Trl (AD_Language,AD_FieldGroup_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_FieldGroup_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_FieldGroup t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_FieldGroup_ID=540080 AND NOT EXISTS (SELECT * FROM AD_FieldGroup_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_FieldGroup_ID=t.AD_FieldGroup_ID)
;
-- 05.11.2015 10:57
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540080,Updated=TO_TIMESTAMP('2015-11-05 10:57:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551297
;
-- 05.11.2015 10:58
-- URL zum Konzept
UPDATE AD_FieldGroup SET FieldGroupType='L',Updated=TO_TIMESTAMP('2015-11-05 10:58:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_FieldGroup_ID=540080
;
-- 05.11.2015 10:58
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540080,Updated=TO_TIMESTAMP('2015-11-05 10:58:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551301
;
-- 05.11.2015 10:58
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540080,Updated=TO_TIMESTAMP('2015-11-05 10:58:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551292
;
-- 05.11.2015 10:58
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540080,Updated=TO_TIMESTAMP('2015-11-05 10:58:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551299
;
-- 05.11.2015 10:58
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540080,Updated=TO_TIMESTAMP('2015-11-05 10:58:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551300
;
-- 05.11.2015 11:00
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540080,Updated=TO_TIMESTAMP('2015-11-05 11:00:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551304
;
-- 05.11.2015 11:01
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540080,Updated=TO_TIMESTAMP('2015-11-05 11:01:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555108
;
-- 05.11.2015 11:02
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540080,Updated=TO_TIMESTAMP('2015-11-05 11:02:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555109
;
-- 05.11.2015 11:02
-- URL zum Konzept
UPDATE AD_Field SET EntityType='de.metas.printing',Updated=TO_TIMESTAMP('2015-11-05 11:02:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555185
;
-- 05.11.2015 11:04
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540080, EntityType='de.metas.printing',Updated=TO_TIMESTAMP('2015-11-05 11:04:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555184
;
-- 05.11.2015 11:04
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540080,Updated=TO_TIMESTAMP('2015-11-05 11:04:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555185
;
-- 05.11.2015 11:07
-- URL zum Konzept
INSERT INTO AD_FieldGroup (AD_Client_ID,AD_FieldGroup_ID,AD_Org_ID,Created,CreatedBy,EntityType,FieldGroupType,IsActive,IsCollapsedByDefault,Name,Updated,UpdatedBy) VALUES (0,540081,0,TO_TIMESTAMP('2015-11-05 11:07:10','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.printing','L','Y','N','Zuordnung zu logischem Drucker',TO_TIMESTAMP('2015-11-05 11:07:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 05.11.2015 11:07
-- URL zum Konzept
INSERT INTO AD_FieldGroup_Trl (AD_Language,AD_FieldGroup_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_FieldGroup_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_FieldGroup t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_FieldGroup_ID=540081 AND NOT EXISTS (SELECT * FROM AD_FieldGroup_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_FieldGroup_ID=t.AD_FieldGroup_ID)
;
-- 05.11.2015 11:07
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540081,Updated=TO_TIMESTAMP('2015-11-05 11:07:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551302
;
-- 05.11.2015 11:07
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540081,Updated=TO_TIMESTAMP('2015-11-05 11:07:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551298
;
-- 05.11.2015 11:07
-- URL zum Konzept
UPDATE AD_Field SET AD_FieldGroup_ID=540080, EntityType='de.metas.printing',Updated=TO_TIMESTAMP('2015-11-05 11:07:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556239
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=10,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556239
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=20,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551289
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=30,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551293
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=40,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551297
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=50,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551301
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=60,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551292
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=70,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551299
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=80,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551300
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551304
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=100,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555108
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555109
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=120,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555184
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=130,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555185
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=140,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551302
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=150,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551298
;
-- 05.11.2015 11:10
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=160,Updated=TO_TIMESTAMP('2015-11-05 11:10:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551294
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556239
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551289
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551297
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551301
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551299
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551300
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551304
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555184
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555108
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555109
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551294
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555185
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551302
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551298
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2015-11-05 11:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551293
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=100,Updated=TO_TIMESTAMP('2015-11-05 11:11:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555184
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110,Updated=TO_TIMESTAMP('2015-11-05 11:11:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555108
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=120,Updated=TO_TIMESTAMP('2015-11-05 11:11:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555109
;
-- 05.11.2015 11:11
-- URL zum Konzept
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2015-11-05 11:11:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551289
;
-- 05.11.2015 11:12
-- URL zum Konzept
UPDATE AD_Field SET IsSameLine='N',Updated=TO_TIMESTAMP('2015-11-05 11:12:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551300
;
-- 05.11.2015 11:12
-- URL zum Konzept
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2015-11-05 11:12:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551304
;
-- 05.11.2015 11:12
-- URL zum Konzept
UPDATE AD_Element SET Name='Seiten-Kriterium', PrintName='Seiten-Kriterium',Updated=TO_TIMESTAMP('2015-11-05 11:12:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542632
;
-- 05.11.2015 11:12
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=542632
;
-- 05.11.2015 11:12
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='RoutingType', Name='Seiten-Kriterium', Description=NULL, Help=NULL WHERE AD_Element_ID=542632
;
-- 05.11.2015 11:12
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='RoutingType', Name='Seiten-Kriterium', Description=NULL, Help=NULL, AD_Element_ID=542632 WHERE UPPER(ColumnName)='ROUTINGTYPE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 05.11.2015 11:12
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='RoutingType', Name='Seiten-Kriterium', Description=NULL, Help=NULL WHERE AD_Element_ID=542632 AND IsCentrallyMaintained='Y'
;
-- 05.11.2015 11:12
-- URL zum Konzept
UPDATE AD_Field SET Name='Seiten-Kriterium', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=542632) AND IsCentrallyMaintained='Y'
;
-- 05.11.2015 11:12
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Seiten-Kriterium', Name='Seiten-Kriterium' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=542632)
;
-- 05.11.2015 11:13
-- URL zum Konzept
UPDATE AD_Element SET Name='Letzte Seiten', PrintName='Letzte Seiten',Updated=TO_TIMESTAMP('2015-11-05 11:13:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542633
;
-- 05.11.2015 11:13
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=542633
;
-- 05.11.2015 11:13
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='LastPages', Name='Letzte Seiten', Description=NULL, Help=NULL WHERE AD_Element_ID=542633
;
-- 05.11.2015 11:13
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='LastPages', Name='Letzte Seiten', Description=NULL, Help=NULL, AD_Element_ID=542633 WHERE UPPER(ColumnName)='LASTPAGES' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 05.11.2015 11:13
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='LastPages', Name='Letzte Seiten', Description=NULL, Help=NULL WHERE AD_Element_ID=542633 AND IsCentrallyMaintained='Y'
;
-- 05.11.2015 11:13
-- URL zum Konzept
UPDATE AD_Field SET Name='Letzte Seiten', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=542633) AND IsCentrallyMaintained='Y'
;
-- 05.11.2015 11:13
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Letzte Seiten', Name='Letzte Seiten' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=542633)
;
-- 05.11.2015 11:15
-- URL zum Konzept
UPDATE AD_Field SET SeqNoGrid=160,Updated=TO_TIMESTAMP('2015-11-05 11:15:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551294
;
-- 05.11.2015 11:15
-- URL zum Konzept
UPDATE AD_Field SET IsSameLine='N',Updated=TO_TIMESTAMP('2015-11-05 11:15:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551294
;
-- 05.11.2015 11:16
-- URL zum Konzept
UPDATE AD_FieldGroup SET Name='Drucker-Zuordnung',Updated=TO_TIMESTAMP('2015-11-05 11:16:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_FieldGroup_ID=540081
;
-- 05.11.2015 11:16
-- URL zum Konzept
UPDATE AD_FieldGroup_Trl SET IsTranslated='N' WHERE AD_FieldGroup_ID=540081
;
-- 05.11.2015 11:17
-- URL zum Konzept
UPDATE AD_Ref_List SET Name='letzte Seiten',Updated=TO_TIMESTAMP('2015-11-05 11:17:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=540873
;
-- 05.11.2015 11:17
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=540873
;
-- 05.11.2015 11:17
-- URL zum Konzept
UPDATE AD_Ref_List SET Name='Seiten von-bis',Updated=TO_TIMESTAMP('2015-11-05 11:17:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=540872
;
-- 05.11.2015 11:17
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=540872
;
-- 05.11.2015 11:18
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@RoutingType@ = L',Updated=TO_TIMESTAMP('2015-11-05 11:18:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555185
;
-- 05.11.2015 11:19
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@RoutingType@ = P',Updated=TO_TIMESTAMP('2015-11-05 11:19:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555109
;
-- 05.11.2015 11:19
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@RoutingType@ = P',Updated=TO_TIMESTAMP('2015-11-05 11:19:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555108
;
-- 05.11.2015 11:19
-- URL zum Konzept
UPDATE AD_Tab SET OrderByClause='SeqNo',Updated=TO_TIMESTAMP('2015-11-05 11:19:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540469
;
-- 05.11.2015 11:20
-- URL zum Konzept
UPDATE AD_Ref_List SET Name='Letzte Seiten',Updated=TO_TIMESTAMP('2015-11-05 11:20:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=540873
;
-- 05.11.2015 11:20
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=540873
;
-- 05.11.2015 11:22
-- URL zum Konzept
UPDATE AD_Field SET Help='The Direct Print checkbox indicates that this report will print without a print dialog box being displayed.
Note: currently not showing because it''s not really used', IsDisplayed='N', IsDisplayedGrid='N',Updated=TO_TIMESTAMP('2015-11-05 11:22:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551294
;
-- 05.11.2015 11:22
-- URL zum Konzept
UPDATE AD_Field_Trl SET IsTranslated='N' WHERE AD_Field_ID=551294
;
-- 05.11.2015 11:31
-- URL zum Konzept
UPDATE AD_Ref_List SET Name='Letzte Seiten (optional)',Updated=TO_TIMESTAMP('2015-11-05 11:31:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=540873
;
-- 05.11.2015 11:31
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=540873
;
-- 05.11.2015 11:31
-- URL zum Konzept
UPDATE AD_Ref_List SET Name='Seiten von-bis (optional)',Updated=TO_TIMESTAMP('2015-11-05 11:31:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=540872
;
-- 05.11.2015 11:31
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='N' WHERE AD_Ref_List_ID=540872
; | the_stack |
-- BEGINNING TRANSACTION STRUCTURE
PRINT 'Beginning transaction STRUCTURE'
BEGIN TRANSACTION _STRUCTURE_
GO
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Create Table bl_Application
Print 'Create Table bl_Application'
GO
CREATE TABLE [dbo].[bl_Application] (
[ApplicationID] int IDENTITY (1,1) NOT NULL,
[Code] varchar(100) NOT NULL,
[Name] varchar(250) NOT NULL
)
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Add Primary Key PK_bl_Application to bl_Application
Print 'Add Primary Key PK_bl_Application to bl_Application'
GO
IF (EXISTS(SELECT * FROM sys.objects WHERE [object_id] = OBJECT_ID(N'[dbo].[bl_Application]') AND [type]='U')) AND NOT (EXISTS (SELECT * FROM sys.indexes WHERE [name]=N'PK_bl_Application' AND [object_id]=OBJECT_ID(N'[dbo].[bl_Application]')))
ALTER TABLE [dbo].[bl_Application]
ADD
CONSTRAINT [PK_bl_Application]
PRIMARY KEY
([ApplicationID])
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Add Unique IX_bl_Application to bl_Application
Print 'Add Unique IX_bl_Application to bl_Application'
GO
IF (EXISTS(SELECT * FROM sys.objects WHERE [object_id] = OBJECT_ID(N'[dbo].[bl_Application]') AND [type]='U')) AND NOT (EXISTS (SELECT * FROM sys.indexes WHERE [name]=N'IX_bl_Application' AND [object_id]=OBJECT_ID(N'[dbo].[bl_Application]')))
ALTER TABLE [dbo].[bl_Application]
ADD
CONSTRAINT [IX_bl_Application]
UNIQUE
([Code])
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Create Table bl_Entry
Print 'Create Table bl_Entry'
GO
CREATE TABLE [dbo].[bl_Entry] (
[EntryID] int IDENTITY (1,1) NOT NULL,
[myDateTime] datetime NOT NULL,
[Message] varchar(500) NOT NULL,
[ApplicationID] int NOT NULL,
[SourceID] int NOT NULL,
[SeverityID] int NOT NULL,
[HostID] int NOT NULL,
[ExceptionMessage] varchar(500) NULL,
[ExceptionDetails] varchar(5000) NULL,
[CFID] varchar(255) NULL,
[CFTOKEN] varchar(255) NULL,
[UserAgent] varchar(500) NULL,
[TemplatePath] varchar(500) NULL,
[HTMLReport] text NULL,
[createdOn] datetime NOT NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Add Primary Key PK_bl_Entry to bl_Entry
Print 'Add Primary Key PK_bl_Entry to bl_Entry'
GO
IF (EXISTS(SELECT * FROM sys.objects WHERE [object_id] = OBJECT_ID(N'[dbo].[bl_Entry]') AND [type]='U')) AND NOT (EXISTS (SELECT * FROM sys.indexes WHERE [name]=N'PK_bl_Entry' AND [object_id]=OBJECT_ID(N'[dbo].[bl_Entry]')))
ALTER TABLE [dbo].[bl_Entry]
ADD
CONSTRAINT [PK_bl_Entry]
PRIMARY KEY
([EntryID])
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Add Unique IX_bl_Entry to bl_Entry
Print 'Add Unique IX_bl_Entry to bl_Entry'
GO
IF (EXISTS(SELECT * FROM sys.objects WHERE [object_id] = OBJECT_ID(N'[dbo].[bl_Entry]') AND [type]='U')) AND NOT (EXISTS (SELECT * FROM sys.indexes WHERE [name]=N'IX_bl_Entry' AND [object_id]=OBJECT_ID(N'[dbo].[bl_Entry]')))
ALTER TABLE [dbo].[bl_Entry]
ADD
CONSTRAINT [IX_bl_Entry]
UNIQUE
([EntryID])
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Add Default Constraint DF_bl_Entry_createdOn to bl_Entry
Print 'Add Default Constraint DF_bl_Entry_createdOn to bl_Entry'
GO
IF (EXISTS(SELECT * FROM sys.objects WHERE [object_id] = OBJECT_ID(N'[dbo].[bl_Entry]') AND [type]='U')) AND NOT (EXISTS (SELECT * FROM sys.objects WHERE [object_id]=OBJECT_ID(N'[dbo].[DF_bl_Entry_createdOn]') AND [parent_object_id]=OBJECT_ID(N'[dbo].[bl_Entry]')))
ALTER TABLE [dbo].[bl_Entry]
ADD
CONSTRAINT [DF_bl_Entry_createdOn]
DEFAULT (getdate()) FOR [createdOn]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Add Default Constraint DF_bl_Entry_myDateTime to bl_Entry
Print 'Add Default Constraint DF_bl_Entry_myDateTime to bl_Entry'
GO
IF (EXISTS(SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[bl_Entry]') AND [type]='U')) AND NOT (EXISTS (SELECT * FROM sysobjects WHERE id=OBJECT_ID(N'[dbo].[DF_bl_Entry_createdOn]') AND parent_obj=OBJECT_ID(N'[dbo].[bl_Entry]')))
ALTER TABLE [dbo].[bl_Entry]
ADD
CONSTRAINT [DF_bl_Entry_myDateTime]
DEFAULT (getdate()) FOR [myDateTime]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Create Table bl_Host
Print 'Create Table bl_Host'
GO
CREATE TABLE [dbo].[bl_Host] (
[HostID] int IDENTITY (1,1) NOT NULL,
[HostName] varchar(250) NOT NULL
)
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Add Primary Key PK_bl_Host to bl_Host
Print 'Add Primary Key PK_bl_Host to bl_Host'
GO
IF (EXISTS(SELECT * FROM sys.objects WHERE [object_id] = OBJECT_ID(N'[dbo].[bl_Host]') AND [type]='U')) AND NOT (EXISTS (SELECT * FROM sys.indexes WHERE [name]=N'PK_bl_Host' AND [object_id]=OBJECT_ID(N'[dbo].[bl_Host]')))
ALTER TABLE [dbo].[bl_Host]
ADD
CONSTRAINT [PK_bl_Host]
PRIMARY KEY
([HostID])
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Create Table bl_Severity
Print 'Create Table bl_Severity'
GO
CREATE TABLE [dbo].[bl_Severity] (
[SeverityID] int IDENTITY (1,1) NOT NULL,
[Name] varchar(250) NOT NULL,
[Code] varchar(50) NOT NULL
)
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Add Primary Key PK_bl_Severity to bl_Severity
Print 'Add Primary Key PK_bl_Severity to bl_Severity'
GO
IF (EXISTS(SELECT * FROM sys.objects WHERE [object_id] = OBJECT_ID(N'[dbo].[bl_Severity]') AND [type]='U')) AND NOT (EXISTS (SELECT * FROM sys.indexes WHERE [name]=N'PK_bl_Severity' AND [object_id]=OBJECT_ID(N'[dbo].[bl_Severity]')))
ALTER TABLE [dbo].[bl_Severity]
ADD
CONSTRAINT [PK_bl_Severity]
PRIMARY KEY
([SeverityID])
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Create Table bl_Source
Print 'Create Table bl_Source'
GO
CREATE TABLE [dbo].[bl_Source] (
[SourceID] int IDENTITY (1,1) NOT NULL,
[Name] varchar(250) NOT NULL
)
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Add Primary Key PK_bl_Source to bl_Source
Print 'Add Primary Key PK_bl_Source to bl_Source'
GO
IF (EXISTS(SELECT * FROM sys.objects WHERE [object_id] = OBJECT_ID(N'[dbo].[bl_Source]') AND [type]='U')) AND NOT (EXISTS (SELECT * FROM sys.indexes WHERE [name]=N'PK_bl_Source' AND [object_id]=OBJECT_ID(N'[dbo].[bl_Source]')))
ALTER TABLE [dbo].[bl_Source]
ADD
CONSTRAINT [PK_bl_Source]
PRIMARY KEY
([SourceID])
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Create Table bl_User
Print 'Create Table bl_User'
GO
CREATE TABLE [dbo].[bl_User] (
[UserID] int IDENTITY (1,1) NOT NULL,
[Username] varchar(250) NOT NULL,
[Password] varchar(50) NOT NULL,
[IsAdmin] int NOT NULL,
[email] VARCHAR(255) NULL,
[apiKey] VARCHAR(100) NULL
)
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Add Primary Key PK_bl_User to bl_User
Print 'Add Primary Key PK_bl_User to bl_User'
GO
IF (EXISTS(SELECT * FROM sys.objects WHERE [object_id] = OBJECT_ID(N'[dbo].[bl_User]') AND [type]='U')) AND NOT (EXISTS (SELECT * FROM sys.indexes WHERE [name]=N'PK_bl_User' AND [object_id]=OBJECT_ID(N'[dbo].[bl_User]')))
ALTER TABLE [dbo].[bl_User]
ADD
CONSTRAINT [PK_bl_User]
PRIMARY KEY
([UserID])
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Create Foreign Key FK_bl_Entry_bl_Application on bl_Entry
Print 'Create Foreign Key FK_bl_Entry_bl_Application on bl_Entry'
GO
IF OBJECT_ID(N'[dbo].[bl_Entry]') IS NOT NULL
AND OBJECT_ID(N'[dbo].[bl_Application]') IS NOT NULL
AND NOT EXISTS (SELECT * FROM sys.objects WHERE [object_id]=OBJECT_ID(N'[dbo].[FK_bl_Entry_bl_Application]') AND [parent_object_id]=OBJECT_ID(N'[dbo].[bl_Entry]'))
BEGIN
ALTER TABLE [dbo].[bl_Entry]
WITH NOCHECK
ADD CONSTRAINT [FK_bl_Entry_bl_Application]
FOREIGN KEY ([ApplicationID]) REFERENCES [dbo].[bl_Application] ([ApplicationID])
ALTER TABLE [dbo].[bl_Entry]
CHECK CONSTRAINT [FK_bl_Entry_bl_Application]
END
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Create Foreign Key FK_bl_Entry_bl_Host on bl_Entry
Print 'Create Foreign Key FK_bl_Entry_bl_Host on bl_Entry'
GO
IF OBJECT_ID(N'[dbo].[bl_Entry]') IS NOT NULL
AND OBJECT_ID(N'[dbo].[bl_Host]') IS NOT NULL
AND NOT EXISTS (SELECT * FROM sys.objects WHERE [object_id]=OBJECT_ID(N'[dbo].[FK_bl_Entry_bl_Host]') AND [parent_object_id]=OBJECT_ID(N'[dbo].[bl_Entry]'))
BEGIN
ALTER TABLE [dbo].[bl_Entry]
ADD CONSTRAINT [FK_bl_Entry_bl_Host]
FOREIGN KEY ([HostID]) REFERENCES [dbo].[bl_Host] ([HostID])
END
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Create Foreign Key FK_bl_Entry_bl_Severity on bl_Entry
Print 'Create Foreign Key FK_bl_Entry_bl_Severity on bl_Entry'
GO
IF OBJECT_ID(N'[dbo].[bl_Entry]') IS NOT NULL
AND OBJECT_ID(N'[dbo].[bl_Severity]') IS NOT NULL
AND NOT EXISTS (SELECT * FROM sys.objects WHERE [object_id]=OBJECT_ID(N'[dbo].[FK_bl_Entry_bl_Severity]') AND [parent_object_id]=OBJECT_ID(N'[dbo].[bl_Entry]'))
BEGIN
ALTER TABLE [dbo].[bl_Entry]
ADD CONSTRAINT [FK_bl_Entry_bl_Severity]
FOREIGN KEY ([SeverityID]) REFERENCES [dbo].[bl_Severity] ([SeverityID])
END
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- Create Foreign Key FK_bl_Entry_bl_Source on bl_Entry
Print 'Create Foreign Key FK_bl_Entry_bl_Source on bl_Entry'
GO
IF OBJECT_ID(N'[dbo].[bl_Entry]') IS NOT NULL
AND OBJECT_ID(N'[dbo].[bl_Source]') IS NOT NULL
AND NOT EXISTS (SELECT * FROM sys.objects WHERE [object_id]=OBJECT_ID(N'[dbo].[FK_bl_Entry_bl_Source]') AND [parent_object_id]=OBJECT_ID(N'[dbo].[bl_Entry]'))
BEGIN
ALTER TABLE [dbo].[bl_Entry]
ADD CONSTRAINT [FK_bl_Entry_bl_Source]
FOREIGN KEY ([SourceID]) REFERENCES [dbo].[bl_Source] ([SourceID])
END
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
GO
-- COMMITTING TRANSACTION STRUCTURE
PRINT 'Committing transaction STRUCTURE'
IF @@TRANCOUNT>0
COMMIT TRANSACTION _STRUCTURE_
GO
SET NOEXEC OFF
GO
-- BEGINNING TRANSACTION DATA
PRINT 'Beginning transaction DATA'
BEGIN TRANSACTION _DATA_
GO
SET NOCOUNT ON
GO
-- Deleting from table: bl_User
PRINT 'Deleting from table: bl_User'
DELETE FROM [dbo].[bl_User]
-- Insert scripts for table: bl_User
PRINT 'Inserting rows into table: bl_User'
INSERT INTO [dbo].[bl_User] ([Username], [Password], [IsAdmin]) VALUES ('admin', 'admin', 1)
-- COMMITTING TRANSACTION DATA
PRINT 'Committing transaction DATA'
IF @@TRANCOUNT>0
COMMIT TRANSACTION _DATA_
GO
SET NOEXEC OFF
GO
CREATE TABLE [dbo].[bl_Extension] (
[ExtensionID] int IDENTITY (1,1) NOT NULL,
[name] varchar(255) NOT NULL,
[type] varchar(255) NOT NULL,
[enabled] bit NOT NULL,
[description] varchar(500) NULL,
[properties] text NULL,
[createdBy] int NULL,
[createdOn] datetime NOT NULL
)
ON [PRIMARY]
GO
ALTER TABLE [dbo].[bl_Extension]
ADD
CONSTRAINT [DF_bl_Extension_enabled]
DEFAULT 0 FOR [enabled]
GO
ALTER TABLE [dbo].[bl_Extension]
ADD
CONSTRAINT [DF_bl_Extension_createdOn]
DEFAULT (getdate()) FOR [createdOn]
GO
CREATE TABLE [dbo].[bl_ExtensionLog] (
[ExtensionLogID] int IDENTITY (1,1) NOT NULL,
[extensionID] int NULL,
[createdOn] datetime NOT NULL,
[entryID] int NULL
)
ON [PRIMARY]
GO
ALTER TABLE [dbo].[bl_ExtensionLog]
ADD
CONSTRAINT [DF_bl_ExtensionLog_createdOn]
DEFAULT (getdate()) FOR [createdOn]
GO
CREATE TABLE [dbo].[bl_userApplication] (
[userApplicationID] int IDENTITY (1,1) NOT NULL,
[userID] int NULL,
[applicationID] int NULL
)
ON [PRIMARY]
GO
ALTER TABLE [dbo].[bl_userApplication]
ADD
CONSTRAINT [FK_bl_userApplication_bl_user]
FOREIGN KEY ([userID]) REFERENCES [dbo].[bl_User] ([userID])
GO
ALTER TABLE [dbo].[bl_userApplication]
ADD
CONSTRAINT [FK_bl_userApplication_bl_application]
FOREIGN KEY ([applicationID]) REFERENCES [dbo].[bl_application] ([applicationID])
GO | the_stack |
SELECT RUN_METRIC('android/android_hwui_metric.sql');
CREATE VIEW dequeue_buffer AS
SELECT
count(*) as dequeue_buffer_count,
max(dur) as dequeue_buffer_max,
min(dur) as dequeue_buffer_min,
avg(dur) as dequeue_buffer_avg,
sum(dur) as dequeue_buffer_sum,
thread_track.utid as render_thread_id
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
WHERE slice.name='dequeueBuffer' AND slice.dur >= 0
GROUP BY thread_track.utid;
-- limit test results starting from second frame to 7 seconds after that
CREATE VIEW test_start_ts AS
SELECT
ts as test_start,
ts + 7000000000 as test_end,
thread.upid as process_upid
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
INNER JOIN thread ON (thread.utid = thread_track.utid)
WHERE slice.name='DrawFrame' AND slice.dur >= 0
ORDER BY slice.ts
LIMIT 1 OFFSET 1;
-- increase the offset if want to start from more than second frame
CREATE VIEW startup_time AS
SELECT
min(ts) as first_draw_frame,
test_start_ts.test_start as second_draw_frame,
test_start_ts.test_start - min(ts) as start_time,
thread_track.utid as render_thread_id
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
INNER JOIN thread ON (thread.utid = thread_track.utid)
INNER JOIN test_start_ts ON (test_start_ts.process_upid = thread.upid)
WHERE slice.name='setSurface' AND slice.dur >= 0
GROUP BY thread_track.utid;
CREATE VIEW hwui_draw_frame2 AS
SELECT
count(*) as draw_frame_count,
max(dur) as draw_frame_max,
min(dur) as draw_frame_min,
avg(dur) as draw_frame_avg,
thread_track.utid as render_thread_id
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
INNER JOIN thread ON (thread.utid = thread_track.utid)
INNER JOIN test_start_ts ON (slice.ts >= test_start_ts.test_start AND slice.ts <= test_start_ts.test_end)
WHERE slice.name='DrawFrame' AND slice.dur >= 0
GROUP BY thread_track.utid;
CREATE VIEW skottie_animator AS
SELECT
count(*) as skottie_animator_count,
max(dur) as skottie_animator_max,
min(dur) as skottie_animator_min,
avg(dur) as skottie_animator_avg,
sum(dur) as skottie_animator_sum,
thread.upid as process_upid
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
INNER JOIN thread ON (thread.name='SkottieAnimator' AND thread.utid = thread_track.utid)
INNER JOIN test_start_ts ON (slice.ts >= test_start_ts.test_start AND slice.ts <= test_start_ts.test_end)
WHERE slice.name='Choreographer#doFrame' AND slice.dur >= 0
GROUP BY thread_track.utid;
CREATE VIEW total_cpu_time AS
SELECT
sum(sched_slice.dur) as cpu_time,
thread.upid as process_upid
FROM sched_slice
INNER JOIN process ON (process.upid = thread.upid)
INNER JOIN thread ON (
(thread.name LIKE 'hwuiTask%' OR thread.name=substr(process.name,-15) OR thread.name LIKE '%skottie' OR thread.name='RenderThread' OR thread.name='SkottieAnimator')
AND thread.utid = sched_slice.utid
)
INNER JOIN test_start_ts ON (sched_slice.ts >= test_start_ts.test_start AND sched_slice.ts <= test_start_ts.test_end)
WHERE sched_slice.dur >= 0
GROUP BY thread.upid;
CREATE VIEW cpu_time_rt_hwui_tasks AS
SELECT
sum(sched_slice.dur) as cpu_time,
thread.upid as process_upid
FROM sched_slice
INNER JOIN thread ON (thread.name LIKE 'hwuiTask%' AND thread.utid = sched_slice.utid)
INNER JOIN test_start_ts ON (sched_slice.ts >= test_start_ts.test_start AND sched_slice.ts <= test_start_ts.test_end)
WHERE sched_slice.dur >= 0
GROUP BY thread.upid;
CREATE VIEW cpu_time_ui_thread AS
SELECT
sum(sched_slice.dur) as cpu_time,
thread.upid as process_upid
FROM sched_slice
INNER JOIN process ON (process.upid = thread.upid)
INNER JOIN thread ON ((thread.name=substr(process.name,-15) OR thread.name LIKE '%skottie') AND thread.utid = sched_slice.utid)
INNER JOIN test_start_ts ON (sched_slice.ts >= test_start_ts.test_start AND sched_slice.ts <= test_start_ts.test_end)
WHERE sched_slice.dur >= 0
GROUP BY thread.upid;
CREATE VIEW cpu_time_rt AS
SELECT
sum(sched_slice.dur) as cpu_time,
thread.upid as process_upid
FROM sched_slice
INNER JOIN thread ON (thread.name='RenderThread' AND thread.utid = sched_slice.utid)
INNER JOIN test_start_ts ON (sched_slice.ts >= test_start_ts.test_start AND sched_slice.ts <= test_start_ts.test_end)
WHERE sched_slice.dur >= 0
GROUP BY thread.upid;
CREATE VIEW cpu_time_skottie_animator AS
SELECT
sum(sched_slice.dur) as cpu_time,
thread.upid as process_upid
FROM sched_slice
INNER JOIN thread ON (thread.name='SkottieAnimator' AND thread.utid = sched_slice.utid)
INNER JOIN test_start_ts ON (sched_slice.ts >= test_start_ts.test_start AND sched_slice.ts <= test_start_ts.test_end)
WHERE sched_slice.dur >= 0
GROUP BY thread.upid;
CREATE VIEW hwui_gpu_completion2 AS
SELECT
count(*) as gpu_completion_count,
max(dur) as gpu_completion_max,
min(dur) as gpu_completion_min,
avg(dur) as gpu_completion_avg,
sum(dur) as gpu_completion_sum,
thread.upid as process_upid
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
INNER JOIN thread ON (thread.name='GPU completion' AND thread.utid = thread_track.utid)
INNER JOIN test_start_ts ON (slice.ts >= test_start_ts.test_start AND slice.ts <= test_start_ts.test_end)
WHERE slice.name LIKE 'waiting for GPU completion%' AND slice.dur >= 0
GROUP BY thread_track.utid;
CREATE VIEW hwui_gpu_completion3 AS
SELECT
sum(dur) as gpu_completion_sum,
thread.upid as process_upid
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
INNER JOIN thread ON (thread.utid = thread_track.utid)
INNER JOIN test_start_ts ON (slice.ts >= test_start_ts.test_start AND slice.ts <= test_start_ts.test_end)
WHERE slice.name LIKE 'waiting for frame%' AND slice.dur >= 0
GROUP BY thread_track.utid;
CREATE VIEW skottie_metric_output AS
SELECT SkottieMetric(
'process_info', (
SELECT RepeatedField(
ProcessRenderInfoEx(
'hwui_process_info',
ProcessRenderInfo(
'process_name', process_name,
'rt_cpu_time_ms', rt_cpu_time_ms,
'draw_frame_count', hwui_draw_frame2.draw_frame_count,
'draw_frame_max', hwui_draw_frame2.draw_frame_max,
'draw_frame_min', hwui_draw_frame2.draw_frame_min,
'draw_frame_avg', hwui_draw_frame2.draw_frame_avg,
'flush_count', hwui_flush_commands.flush_count,
'flush_max', hwui_flush_commands.flush_max,
'flush_min', hwui_flush_commands.flush_min,
'flush_avg', hwui_flush_commands.flush_avg,
'prepare_tree_count', hwui_prepare_tree.prepare_tree_count,
'prepare_tree_max', hwui_prepare_tree.prepare_tree_max,
'prepare_tree_min', hwui_prepare_tree.prepare_tree_min,
'prepare_tree_avg', hwui_prepare_tree.prepare_tree_avg,
'gpu_completion_count', hwui_gpu_completion2.gpu_completion_count,
'gpu_completion_max', hwui_gpu_completion2.gpu_completion_max,
'gpu_completion_min', hwui_gpu_completion2.gpu_completion_min,
'gpu_completion_avg', hwui_gpu_completion2.gpu_completion_avg,
'ui_record_count', hwui_ui_record.ui_record_count,
'ui_record_max', hwui_ui_record.ui_record_max,
'ui_record_min', hwui_ui_record.ui_record_min,
'ui_record_avg', hwui_ui_record.ui_record_avg,
'shader_compile_count', hwui_shader_compile.shader_compile_count,
'shader_compile_time', hwui_shader_compile.shader_compile_time,
'shader_compile_avg', hwui_shader_compile.shader_compile_avg,
'cache_hit_count', hwui_cache_hit.cache_hit_count,
'cache_hit_time', hwui_cache_hit.cache_hit_time,
'cache_hit_avg', hwui_cache_hit.cache_hit_avg,
'cache_miss_count', hwui_cache_miss.cache_miss_count,
'cache_miss_time', hwui_cache_miss.cache_miss_time,
'cache_miss_avg', hwui_cache_miss.cache_miss_avg,
'graphics_cpu_mem_max', CAST(hwui_graphics_cpu_mem.graphics_cpu_mem_max as INT64),
'graphics_cpu_mem_min', CAST(hwui_graphics_cpu_mem.graphics_cpu_mem_min as INT64),
'graphics_cpu_mem_avg', hwui_graphics_cpu_mem.graphics_cpu_mem_avg,
'graphics_gpu_mem_max', CAST(hwui_graphics_gpu_mem.graphics_gpu_mem_max as INT64),
'graphics_gpu_mem_min', CAST(hwui_graphics_gpu_mem.graphics_gpu_mem_min as INT64),
'graphics_gpu_mem_avg', hwui_graphics_gpu_mem.graphics_gpu_mem_avg,
'texture_mem_max', CAST(hwui_texture_mem.texture_mem_max as INT64),
'texture_mem_min', CAST(hwui_texture_mem.texture_mem_min as INT64),
'texture_mem_avg', hwui_texture_mem.texture_mem_avg,
'all_mem_max', CAST(hwui_all_mem.all_mem_max as INT64),
'all_mem_min', CAST(hwui_all_mem.all_mem_min as INT64),
'all_mem_avg', hwui_all_mem.all_mem_avg
),
'skottie_animator_count', ifnull(skottie_animator.skottie_animator_count, 0),
'skottie_animator_max', ifnull(skottie_animator.skottie_animator_max, 0),
'skottie_animator_min', ifnull(skottie_animator.skottie_animator_min, 0),
'skottie_animator_avg', ifnull(skottie_animator.skottie_animator_avg, 0.0),
'dequeue_buffer_count', dequeue_buffer.dequeue_buffer_count,
'dequeue_buffer_max', dequeue_buffer.dequeue_buffer_max,
'dequeue_buffer_min', dequeue_buffer.dequeue_buffer_min,
'dequeue_buffer_avg', dequeue_buffer.dequeue_buffer_avg,
'render_time_avg', ifnull(skottie_animator.skottie_animator_avg, 0.0) + hwui_draw_frame2.draw_frame_avg,
'render_time_avg_no_dequeue', ifnull(skottie_animator.skottie_animator_avg, 0.0) + hwui_draw_frame2.draw_frame_avg - ifnull(dequeue_buffer.dequeue_buffer_avg, 0.0),
'ui_thread_cpu_time', ifnull(cpu_time_ui_thread.cpu_time, 0),
'rt_thread_cpu_time', ifnull(cpu_time_rt.cpu_time, 0),
'hwui_tasks_cpu_time', ifnull(cpu_time_rt_hwui_tasks.cpu_time, 0),
'skottie_animator_cpu_time', ifnull(cpu_time_skottie_animator.cpu_time, 0),
'total_cpu_time', ifnull(total_cpu_time.cpu_time, 0),
'total_gpu_time', ifnull(hwui_gpu_completion3.gpu_completion_sum, 0),
'total_time', ifnull(total_cpu_time.cpu_time, 0) + ifnull(hwui_gpu_completion3.gpu_completion_sum, 0),
'startup_time', startup_time.start_time
)
)
FROM hwui_processes
LEFT JOIN hwui_draw_frame2 ON (hwui_draw_frame2.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_flush_commands ON (hwui_flush_commands.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_prepare_tree ON (hwui_prepare_tree.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_gpu_completion2 ON (hwui_gpu_completion2.process_upid = hwui_processes.process_upid)
LEFT JOIN hwui_ui_record ON (hwui_ui_record.process_upid = hwui_processes.process_upid)
LEFT JOIN hwui_shader_compile ON (hwui_shader_compile.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_cache_hit ON (hwui_cache_hit.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_cache_miss ON (hwui_cache_miss.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_graphics_cpu_mem ON (hwui_graphics_cpu_mem.process_upid = hwui_processes.process_upid)
LEFT JOIN hwui_graphics_gpu_mem ON (hwui_graphics_gpu_mem.process_upid = hwui_processes.process_upid)
LEFT JOIN hwui_texture_mem ON (hwui_texture_mem.process_upid = hwui_processes.process_upid)
LEFT JOIN hwui_all_mem ON (hwui_all_mem.process_upid = hwui_processes.process_upid)
LEFT JOIN skottie_animator ON (skottie_animator.process_upid = hwui_processes.process_upid)
LEFT JOIN dequeue_buffer ON (dequeue_buffer.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN total_cpu_time ON (total_cpu_time.process_upid = hwui_processes.process_upid)
LEFT JOIN cpu_time_rt_hwui_tasks ON (cpu_time_rt_hwui_tasks.process_upid = hwui_processes.process_upid)
LEFT JOIN cpu_time_rt ON (cpu_time_rt.process_upid = hwui_processes.process_upid)
LEFT JOIN cpu_time_skottie_animator ON (cpu_time_skottie_animator.process_upid = hwui_processes.process_upid)
LEFT JOIN cpu_time_ui_thread ON (cpu_time_ui_thread.process_upid = hwui_processes.process_upid)
LEFT JOIN hwui_gpu_completion3 ON (hwui_gpu_completion3.process_upid = hwui_processes.process_upid)
LEFT JOIN startup_time ON (startup_time.render_thread_id = hwui_processes.render_thread_id)
JOIN (SELECT MAX(rt_cpu_time_ms), process_upid AS id FROM hwui_processes) max_render ON hwui_processes.process_upid = max_render.id
-- process name is often missing on WearOs/Android P -> instead select process is highest CPU time in RenderThread.
-- WHERE hwui_processes.process_name='org.skia.skottie'
)
); | the_stack |
--
-- note: also clean up a bit in the respective AD_Elements
--
-- 2019-01-17T13:19:42.097
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,544820,0,TO_TIMESTAMP('2019-01-17 13:19:41','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y','Über','I',TO_TIMESTAMP('2019-01-17 13:19:41','YYYY-MM-DD HH24:MI:SS'),100,'webui.window.about.caption')
;
-- 2019-01-17T13:19:42.100
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Message_ID=544820 AND NOT EXISTS (SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 2019-01-17T13:19:46.292
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:19:46','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Message_ID=544820 AND AD_Language='de_CH'
;
-- 2019-01-17T13:19:54.713
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:19:54','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',MsgText='About' WHERE AD_Message_ID=544820 AND AD_Language='en_US'
;
-- 2019-01-17T13:21:17.264
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,544821,0,TO_TIMESTAMP('2019-01-17 13:21:17','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y','Erstellt durch','I',TO_TIMESTAMP('2019-01-17 13:21:17','YYYY-MM-DD HH24:MI:SS'),100,'webui.view.about.createdBy')
;
-- 2019-01-17T13:21:17.267
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Message_ID=544821 AND NOT EXISTS (SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 2019-01-17T13:21:23.047
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=246 AND AD_Language='fr_CH'
;
-- 2019-01-17T13:21:29.962
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=246 AND AD_Language='it_CH'
;
-- 2019-01-17T13:21:29.988
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=246 AND AD_Language='en_GB'
;
-- 2019-01-17T13:21:37.516
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:21:37','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=246 AND AD_Language='de_CH'
;
-- 2019-01-17T13:21:37.571
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(246,'de_CH')
;
-- 2019-01-17T13:21:39.213
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:21:39','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=246 AND AD_Language='de_DE'
;
-- 2019-01-17T13:21:39.222
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(246,'de_DE')
;
-- 2019-01-17T13:21:39.336
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(246,'de_DE')
;
-- 2019-01-17T13:21:48.100
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:21:48','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Message_ID=544821 AND AD_Language='de_CH'
;
-- 2019-01-17T13:22:02.734
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:22:02','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',MsgText='Created By' WHERE AD_Message_ID=544821 AND AD_Language='en_US'
;
-- 2019-01-17T13:22:44.233
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,544822,0,TO_TIMESTAMP('2019-01-17 13:22:44','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y','Erstellt','I',TO_TIMESTAMP('2019-01-17 13:22:44','YYYY-MM-DD HH24:MI:SS'),100,'webui.view.about.created')
;
-- 2019-01-17T13:22:44.234
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Message_ID=544822 AND NOT EXISTS (SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 2019-01-17T13:22:55.066
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=245 AND AD_Language='it_CH'
;
-- 2019-01-17T13:22:57.367
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=245 AND AD_Language='en_GB'
;
-- 2019-01-17T13:23:01.196
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:23:01','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=245 AND AD_Language='de_CH'
;
-- 2019-01-17T13:23:01.207
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(245,'de_CH')
;
-- 2019-01-17T13:23:08.882
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:23:08','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',MsgText='Created' WHERE AD_Message_ID=544822 AND AD_Language='en_US'
;
-- 2019-01-17T13:23:11.751
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:23:11','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Message_ID=544822 AND AD_Language='de_CH'
;
-- 2019-01-17T13:23:58.164
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,544823,0,TO_TIMESTAMP('2019-01-17 13:23:58','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y','Aktualisiert','I',TO_TIMESTAMP('2019-01-17 13:23:58','YYYY-MM-DD HH24:MI:SS'),100,'webui.view.about.updated')
;
-- 2019-01-17T13:23:58.166
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Message_ID=544823 AND NOT EXISTS (SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 2019-01-17T13:24:02.836
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:24:02','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Message_ID=544823 AND AD_Language='de_CH'
;
-- 2019-01-17T13:24:11.683
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=607 AND AD_Language='fr_CH'
;
-- 2019-01-17T13:24:11.702
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=607 AND AD_Language='it_CH'
;
-- 2019-01-17T13:24:11.727
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=607 AND AD_Language='en_GB'
;
-- 2019-01-17T13:24:17.268
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:24:17','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=607 AND AD_Language='de_DE'
;
-- 2019-01-17T13:24:17.277
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(607,'de_DE')
;
-- 2019-01-17T13:24:17.390
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(607,'de_DE')
;
-- 2019-01-17T13:24:27.042
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:24:27','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',MsgText='Updated' WHERE AD_Message_ID=544823 AND AD_Language='en_US'
;
-- 2019-01-17T13:24:50.986
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:24:50','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=607 AND AD_Language='de_CH'
;
-- 2019-01-17T13:24:51
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(607,'de_CH')
;
-- 2019-01-17T13:25:00.729
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,544824,0,TO_TIMESTAMP('2019-01-17 13:25:00','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y','Aktualisiert durch','I',TO_TIMESTAMP('2019-01-17 13:25:00','YYYY-MM-DD HH24:MI:SS'),100,'webui.view.about.updatedBy')
;
-- 2019-01-17T13:25:00.730
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Message_ID=544824 AND NOT EXISTS (SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 2019-01-17T13:25:09.304
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=608 AND AD_Language='fr_CH'
;
-- 2019-01-17T13:25:09.325
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=608 AND AD_Language='it_CH'
;
-- 2019-01-17T13:25:09.348
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=608 AND AD_Language='en_GB'
;
-- 2019-01-17T13:25:14.244
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:25:14','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=608 AND AD_Language='de_CH'
;
-- 2019-01-17T13:25:14.267
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(608,'de_CH')
;
-- 2019-01-17T13:25:21.755
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:25:21','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',MsgText='Updated By' WHERE AD_Message_ID=544824 AND AD_Language='en_US'
;
-- 2019-01-17T13:25:24.078
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:25:24','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Message_ID=544824 AND AD_Language='de_CH'
;
-- 2019-01-17T13:25:31.069
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-17 13:25:31','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=608 AND AD_Language='de_DE'
;
-- 2019-01-17T13:25:31.080
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(608,'de_DE')
;
-- 2019-01-17T13:25:31.172
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(608,'de_DE')
; | the_stack |
-- 2017-05-26T09:23:29.091
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000017, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000083 AND AD_Tree_ID=10
;
-- 2017-05-26T09:23:29.097
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000017, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540736 AND AD_Tree_ID=10
;
-- 2017-05-26T09:23:29.098
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000017, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540781 AND AD_Tree_ID=10
;
-- 2017-05-26T09:23:29.098
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000017, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540782 AND AD_Tree_ID=10
;
-- 2017-05-26T09:23:29.099
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000017, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000058 AND AD_Tree_ID=10
;
-- 2017-05-26T09:23:29.100
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000017, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000066 AND AD_Tree_ID=10
;
-- 2017-05-26T09:23:29.100
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000017, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000076 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:16.669
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,Description,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy,WEBUI_NameBrowse) VALUES ('W',0,540841,0,53097,TO_TIMESTAMP('2017-05-26 09:24:16','YYYY-MM-DD HH24:MI:SS'),100,'Customer Return (Receipts)','U','_Kunden_Rücklieferung','Y','N','N','Y','N','Kunden Rücklieferung',TO_TIMESTAMP('2017-05-26 09:24:16','YYYY-MM-DD HH24:MI:SS'),100,'Kunden Rücklieferung')
;
-- 2017-05-26T09:24:16.676
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=540841 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 2017-05-26T09:24:16.682
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 540841, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=540841)
;
-- 2017-05-26T09:24:16.813
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000087 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:16.817
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540728 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:16.817
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540783 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:16.818
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000060 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:16.818
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000068 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:16.819
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000079 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:16.819
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540841 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:19.731
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000087 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:19.732
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540728 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:19.732
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540783 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:19.733
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540841 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:19.733
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000060 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:19.734
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000068 AND AD_Tree_ID=10
;
-- 2017-05-26T09:24:19.734
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000079 AND AD_Tree_ID=10
;
-- 2017-05-27T07:55:10.443
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy,Value,Name) VALUES (0,0,53271,540220,TO_TIMESTAMP('2017-05-27 07:55:10','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-05-27 07:55:10','YYYY-MM-DD HH24:MI:SS'),100,'advanced edit','')
;
-- 2017-05-27T07:55:10.458
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section_Trl (AD_Language,AD_UI_Section_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_UI_Section_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_UI_Section t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_UI_Section_ID=540220 AND NOT EXISTS (SELECT * FROM AD_UI_Section_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_UI_Section_ID=t.AD_UI_Section_ID)
;
-- 2017-05-27T07:55:48.599
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540080,540507,TO_TIMESTAMP('2017-05-27 07:55:48','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-05-27 07:55:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T07:55:56.713
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET Name='advanced edit', UIStyle='',Updated=TO_TIMESTAMP('2017-05-27 07:55:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540106
;
-- 2017-05-27T07:56:15.191
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=99,Updated=TO_TIMESTAMP('2017-05-27 07:56:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540106
;
-- 2017-05-27T07:56:44.778
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy,WidgetSize) VALUES (0,57720,0,53271,540507,544835,TO_TIMESTAMP('2017-05-27 07:56:44','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Kunde',10,0,0,TO_TIMESTAMP('2017-05-27 07:56:44','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-05-27T07:56:59.360
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-05-27 07:56:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544835
;
-- 2017-05-27T07:57:15.579
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540080,540508,TO_TIMESTAMP('2017-05-27 07:57:15','YYYY-MM-DD HH24:MI:SS'),100,'Y','description',20,TO_TIMESTAMP('2017-05-27 07:57:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T07:57:31.631
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57713,0,53271,540508,544836,TO_TIMESTAMP('2017-05-27 07:57:31','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','RMA',10,0,0,TO_TIMESTAMP('2017-05-27 07:57:31','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T07:57:44.759
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57724,0,53271,540508,544837,TO_TIMESTAMP('2017-05-27 07:57:44','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Priorität',20,0,0,TO_TIMESTAMP('2017-05-27 07:57:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T07:57:57.382
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57727,0,53271,540508,544838,TO_TIMESTAMP('2017-05-27 07:57:57','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sachbearbeiter',30,0,0,TO_TIMESTAMP('2017-05-27 07:57:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T07:58:14.850
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57729,0,53271,540508,544839,TO_TIMESTAMP('2017-05-27 07:58:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Versandkosten Regel',40,0,0,TO_TIMESTAMP('2017-05-27 07:58:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T07:58:28.097
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57716,0,53271,540508,544840,TO_TIMESTAMP('2017-05-27 07:58:28','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Beschreibung',50,0,0,TO_TIMESTAMP('2017-05-27 07:58:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T07:58:53.888
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540081,540509,TO_TIMESTAMP('2017-05-27 07:58:53','YYYY-MM-DD HH24:MI:SS'),100,'Y','doctype',10,TO_TIMESTAMP('2017-05-27 07:58:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T07:59:04.987
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57717,0,53271,540509,544841,TO_TIMESTAMP('2017-05-27 07:59:04','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Belegart',10,0,0,TO_TIMESTAMP('2017-05-27 07:59:04','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T07:59:18.031
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57714,0,53271,540509,544842,TO_TIMESTAMP('2017-05-27 07:59:17','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Beleg Nr.',20,0,0,TO_TIMESTAMP('2017-05-27 07:59:17','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T07:59:30.823
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57718,0,53271,540509,544843,TO_TIMESTAMP('2017-05-27 07:59:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bewegungsdatum',30,0,0,TO_TIMESTAMP('2017-05-27 07:59:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T07:59:37.309
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540081,540510,TO_TIMESTAMP('2017-05-27 07:59:37','YYYY-MM-DD HH24:MI:SS'),100,'Y','flags',20,TO_TIMESTAMP('2017-05-27 07:59:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:00:30.991
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,555572,0,53271,540510,544844,TO_TIMESTAMP('2017-05-27 08:00:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Manuell',10,0,0,TO_TIMESTAMP('2017-05-27 08:00:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:00:42.857
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57733,0,53271,540510,544845,TO_TIMESTAMP('2017-05-27 08:00:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Direktlieferung',20,0,0,TO_TIMESTAMP('2017-05-27 08:00:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:00:50.037
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540081,540511,TO_TIMESTAMP('2017-05-27 08:00:50','YYYY-MM-DD HH24:MI:SS'),100,'Y','org',30,TO_TIMESTAMP('2017-05-27 08:00:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:00:57.625
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57723,0,53271,540511,544846,TO_TIMESTAMP('2017-05-27 08:00:57','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Lager',10,0,0,TO_TIMESTAMP('2017-05-27 08:00:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:01:06.872
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57710,0,53271,540511,544847,TO_TIMESTAMP('2017-05-27 08:01:06','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',20,0,0,TO_TIMESTAMP('2017-05-27 08:01:06','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:01:18.138
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57709,0,53271,540511,544848,TO_TIMESTAMP('2017-05-27 08:01:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',30,0,0,TO_TIMESTAMP('2017-05-27 08:01:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:03:52.955
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57694,0,53271,540510,544849,TO_TIMESTAMP('2017-05-27 08:03:52','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Verarbeitet',5,0,0,TO_TIMESTAMP('2017-05-27 08:03:52','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:05:02.247
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541547
;
-- 2017-05-27T08:05:02.261
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541548
;
-- 2017-05-27T08:05:02.272
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541552
;
-- 2017-05-27T08:05:02.281
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541554
;
-- 2017-05-27T08:05:09.972
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541557
;
-- 2017-05-27T08:05:28.454
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541551
;
-- 2017-05-27T08:05:39.313
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541561
;
-- 2017-05-27T08:06:07.682
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,57721,0,540131,544835,TO_TIMESTAMP('2017-05-27 08:06:07','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-05-27 08:06:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:06:13.123
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,57722,0,540132,544835,TO_TIMESTAMP('2017-05-27 08:06:13','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-05-27 08:06:13','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:06:23.967
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementField WHERE AD_UI_ElementField_ID=540071
;
-- 2017-05-27T08:06:23.979
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementField WHERE AD_UI_ElementField_ID=540072
;
-- 2017-05-27T08:06:28.271
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541556
;
-- 2017-05-27T08:06:59.448
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541545
;
-- 2017-05-27T08:07:21.032
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541559
;
-- 2017-05-27T08:07:21.100
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541560
;
-- 2017-05-27T08:07:21.122
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541562
;
-- 2017-05-27T08:07:21.142
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541563
;
-- 2017-05-27T08:07:21.153
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541564
;
-- 2017-05-27T08:07:21.166
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541565
;
-- 2017-05-27T08:07:21.174
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541566
;
-- 2017-05-27T08:07:21.181
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541567
;
-- 2017-05-27T08:07:25.582
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541546
;
-- 2017-05-27T08:07:25.596
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541549
;
-- 2017-05-27T08:07:25.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541550
;
-- 2017-05-27T08:07:25.612
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541553
;
-- 2017-05-27T08:07:25.621
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541555
;
-- 2017-05-27T08:07:25.628
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541558
;
-- 2017-05-27T08:07:25.634
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541577
;
-- 2017-05-27T08:07:25.640
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541578
;
-- 2017-05-27T08:07:25.647
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541579
;
-- 2017-05-27T08:07:25.671
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541580
;
-- 2017-05-27T08:07:25.681
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541581
;
-- 2017-05-27T08:07:25.690
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541569
;
-- 2017-05-27T08:07:25.698
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541570
;
-- 2017-05-27T08:07:25.709
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541571
;
-- 2017-05-27T08:07:25.718
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541572
;
-- 2017-05-27T08:07:25.727
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541573
;
-- 2017-05-27T08:07:25.743
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541574
;
-- 2017-05-27T08:07:25.752
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541575
;
-- 2017-05-27T08:07:25.766
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541576
;
-- 2017-05-27T08:07:56.680
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementField WHERE AD_UI_ElementField_ID=540073
;
-- 2017-05-27T08:07:56.708
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementField WHERE AD_UI_ElementField_ID=540074
;
-- 2017-05-27T08:08:00.273
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541568
;
-- 2017-05-27T08:08:04.473
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540106
;
-- 2017-05-27T08:08:44.576
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540304,540220,TO_TIMESTAMP('2017-05-27 08:08:44','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-05-27 08:08:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:09:02.998
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540304,540512,TO_TIMESTAMP('2017-05-27 08:09:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','advanced edit',10,TO_TIMESTAMP('2017-05-27 08:09:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:10:59.375
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET Name='acct',Updated=TO_TIMESTAMP('2017-05-27 08:10:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540512
;
-- 2017-05-27T08:11:16.825
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57739,0,53271,540512,544850,TO_TIMESTAMP('2017-05-27 08:11:16','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Projekt',10,0,0,TO_TIMESTAMP('2017-05-27 08:11:16','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:11:29.523
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57740,0,53271,540512,544851,TO_TIMESTAMP('2017-05-27 08:11:29','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Kostenstelle',20,0,0,TO_TIMESTAMP('2017-05-27 08:11:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:11:37.400
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57752,0,53271,540512,544852,TO_TIMESTAMP('2017-05-27 08:11:37','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Verbucht',30,0,0,TO_TIMESTAMP('2017-05-27 08:11:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:11:49.708
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57719,0,53271,540512,544853,TO_TIMESTAMP('2017-05-27 08:11:49','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Buchungsdatum',40,0,0,TO_TIMESTAMP('2017-05-27 08:11:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:12:07.910
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540304,540513,TO_TIMESTAMP('2017-05-27 08:12:07','YYYY-MM-DD HH24:MI:SS'),100,'Y','logistic',20,TO_TIMESTAMP('2017-05-27 08:12:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:12:28.832
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57726,0,53271,540513,544854,TO_TIMESTAMP('2017-05-27 08:12:28','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Spediteur',10,0,0,TO_TIMESTAMP('2017-05-27 08:12:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:12:43.231
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57728,0,53271,540513,544855,TO_TIMESTAMP('2017-05-27 08:12:43','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Lieferregel',20,0,0,TO_TIMESTAMP('2017-05-27 08:12:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:13:07.593
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57730,0,53271,540513,544856,TO_TIMESTAMP('2017-05-27 08:13:07','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Frachtbetrag',30,0,0,TO_TIMESTAMP('2017-05-27 08:13:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:13:27.085
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57731,0,53271,540513,544857,TO_TIMESTAMP('2017-05-27 08:13:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Gebührenart',40,0,0,TO_TIMESTAMP('2017-05-27 08:13:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:14:37.978
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57732,0,53271,540513,544858,TO_TIMESTAMP('2017-05-27 08:14:37','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Gebühr',50,0,0,TO_TIMESTAMP('2017-05-27 08:14:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:15:01.194
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540304,540514,TO_TIMESTAMP('2017-05-27 08:15:01','YYYY-MM-DD HH24:MI:SS'),100,'Y','shipment',30,TO_TIMESTAMP('2017-05-27 08:15:01','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:15:14.561
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57725,0,53271,540514,544859,TO_TIMESTAMP('2017-05-27 08:15:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Lieferung',10,0,0,TO_TIMESTAMP('2017-05-27 08:15:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:15:32.810
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57703,0,53271,540514,544860,TO_TIMESTAMP('2017-05-27 08:15:32','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Lieferdatum',20,0,0,TO_TIMESTAMP('2017-05-27 08:15:32','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:16:05.363
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_Field_ID=57696,Updated=TO_TIMESTAMP('2017-05-27 08:16:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544859
;
-- 2017-05-27T08:16:21.102
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57725,0,53271,540514,544861,TO_TIMESTAMP('2017-05-27 08:16:21','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Lieferart',30,0,0,TO_TIMESTAMP('2017-05-27 08:16:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:16:38.136
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57734,0,53271,540514,544862,TO_TIMESTAMP('2017-05-27 08:16:38','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Lieferempfänger',40,0,0,TO_TIMESTAMP('2017-05-27 08:16:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:16:53.501
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,57735,0,540133,544862,TO_TIMESTAMP('2017-05-27 08:16:53','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-05-27 08:16:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:16:59.870
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,57736,0,540134,544862,TO_TIMESTAMP('2017-05-27 08:16:59','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-05-27 08:16:59','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-05-27T08:17:55.836
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:17:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544859
;
-- 2017-05-27T08:17:56.277
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:17:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544860
;
-- 2017-05-27T08:17:57.026
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:17:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544861
;
-- 2017-05-27T08:17:59.126
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:17:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544862
;
-- 2017-05-27T08:18:04.317
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:18:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544854
;
-- 2017-05-27T08:18:04.806
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:18:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544855
;
-- 2017-05-27T08:18:05.257
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:18:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544856
;
-- 2017-05-27T08:18:05.617
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:18:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544857
;
-- 2017-05-27T08:18:07.132
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:18:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544858
;
-- 2017-05-27T08:18:14.964
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:18:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544850
;
-- 2017-05-27T08:18:15.429
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:18:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544851
;
-- 2017-05-27T08:18:15.735
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:18:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544852
;
-- 2017-05-27T08:18:17.446
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-05-27 08:18:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544853
;
-- 2017-05-27T08:26:55.879
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-05-27 08:26:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544835
;
-- 2017-05-27T08:26:55.885
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-05-27 08:26:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544841
;
-- 2017-05-27T08:26:55.889
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-05-27 08:26:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544842
;
-- 2017-05-27T08:26:55.894
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-05-27 08:26:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544843
;
-- 2017-05-27T08:26:55.898
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-05-27 08:26:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544844
;
-- 2017-05-27T08:26:55.900
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-05-27 08:26:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544849
;
-- 2017-05-27T08:26:55.902
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-05-27 08:26:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544852
;
-- 2017-05-27T08:26:55.904
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-05-27 08:26:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544846
;
-- 2017-05-27T08:26:55.905
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-05-27 08:26:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544847
;
-- 2017-05-27T08:26:55.907
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-05-27 08:26:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544848
;
-- 2017-05-27T08:26:55.908
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-05-27 08:26:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544838
;
-- 2017-05-27T08:27:31.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='S',Updated=TO_TIMESTAMP('2017-05-27 08:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544843
;
-- 2017-05-27T08:27:43.001
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-05-27 08:27:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544846
;
-- 2017-05-27T08:27:45.346
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-05-27 08:27:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544847
;
-- 2017-05-27T08:27:51.048
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-05-27 08:27:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544848
;
-- 2017-05-27T08:28:20.485
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='S',Updated=TO_TIMESTAMP('2017-05-27 08:28:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544842
;
-- 2017-05-27T08:28:37.763
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-05-27 08:28:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544841
;
-- 2017-05-27T08:28:37.768
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-05-27 08:28:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544842
;
-- 2017-05-27T08:28:37.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-05-27 08:28:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544835
;
-- 2017-05-27T08:29:27.996
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-05-27 08:29:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544841
;
-- 2017-05-27T08:30:11.408
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=10,Updated=TO_TIMESTAMP('2017-05-27 08:30:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544835
;
-- 2017-05-27T08:30:11.413
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=20,Updated=TO_TIMESTAMP('2017-05-27 08:30:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544841
;
-- 2017-05-27T08:30:11.421
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=30,Updated=TO_TIMESTAMP('2017-05-27 08:30:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544842
;
-- 2017-05-27T08:30:11.426
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=40,Updated=TO_TIMESTAMP('2017-05-27 08:30:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544846
; | the_stack |
SET client_encoding TO UTF8;
CREATE SCHEMA collate_tests;
SET search_path = collate_tests;
CREATE TABLE collate_test1 (
a int,
b text COLLATE "en_US" NOT NULL
);
\d collate_test1
CREATE TABLE collate_test_fail (
a int,
b text COLLATE "ja_JP.eucjp"
);
CREATE TABLE collate_test_fail (
a int,
b text COLLATE "foo"
);
CREATE TABLE collate_test_fail (
a int COLLATE "en_US",
b text
);
CREATE TABLE collate_test_like (
LIKE collate_test1
);
\d collate_test_like
CREATE TABLE collate_test2 (
a int,
b text COLLATE "sv_SE"
);
CREATE TABLE collate_test3 (
a int,
b text COLLATE "C"
);
INSERT INTO collate_test1
VALUES (1, 'abc'), (2, 'äbc'), (3, 'bbc'), (4, 'ABC');
INSERT INTO collate_test2
SELECT
*
FROM
collate_test1;
INSERT INTO collate_test3
SELECT
*
FROM
collate_test1;
SELECT
*
FROM
collate_test1
WHERE
b >= 'bbc';
SELECT
*
FROM
collate_test2
WHERE
b >= 'bbc';
SELECT
*
FROM
collate_test3
WHERE
b >= 'bbc';
SELECT
*
FROM
collate_test3
WHERE
b >= 'BBC';
SELECT
*
FROM
collate_test1
WHERE
b COLLATE "C" >= 'bbc';
SELECT
*
FROM
collate_test1
WHERE
b >= 'bbc' COLLATE "C";
SELECT
*
FROM
collate_test1
WHERE
b COLLATE "C" >= 'bbc' COLLATE "C";
SELECT
*
FROM
collate_test1
WHERE
b COLLATE "C" >= 'bbc' COLLATE "en_US";
CREATE DOMAIN testdomain_sv AS text COLLATE "sv_SE";
CREATE DOMAIN testdomain_i AS int COLLATE "sv_SE";
-- fails
CREATE TABLE collate_test4 (
a int,
b testdomain_sv
);
INSERT INTO collate_test4
SELECT
*
FROM
collate_test1;
SELECT
a,
b
FROM
collate_test4
ORDER BY
b;
CREATE TABLE collate_test5 (
a int,
b testdomain_sv COLLATE "en_US"
);
INSERT INTO collate_test5
SELECT
*
FROM
collate_test1;
SELECT
a,
b
FROM
collate_test5
ORDER BY
b;
SELECT
a,
b
FROM
collate_test1
ORDER BY
b;
SELECT
a,
b
FROM
collate_test2
ORDER BY
b;
SELECT
a,
b
FROM
collate_test3
ORDER BY
b;
SELECT
a,
b
FROM
collate_test1
ORDER BY
b COLLATE "C";
-- star expansion
SELECT
*
FROM
collate_test1
ORDER BY
b;
SELECT
*
FROM
collate_test2
ORDER BY
b;
SELECT
*
FROM
collate_test3
ORDER BY
b;
-- constant expression folding
SELECT
'bbc' COLLATE "en_US" > 'äbc' COLLATE "en_US" AS "true";
SELECT
'bbc' COLLATE "sv_SE" > 'äbc' COLLATE "sv_SE" AS "false";
-- upper/lower
CREATE TABLE collate_test10 (
a int,
x text COLLATE "en_US",
y text COLLATE "tr_TR"
);
INSERT INTO collate_test10
VALUES (1, 'hij', 'hij'), (2, 'HIJ', 'HIJ');
SELECT
a,
lower(x),
lower(y),
upper(x),
upper(y),
initcap(x),
initcap(y)
FROM
collate_test10;
SELECT
a,
lower(x COLLATE "C"),
lower(y COLLATE "C")
FROM
collate_test10;
SELECT
a,
x,
y
FROM
collate_test10
ORDER BY
lower(y),
a;
-- LIKE/ILIKE
SELECT
*
FROM
collate_test1
WHERE
b LIKE 'abc';
SELECT
*
FROM
collate_test1
WHERE
b LIKE 'abc%';
SELECT
*
FROM
collate_test1
WHERE
b LIKE '%bc%';
SELECT
*
FROM
collate_test1
WHERE
b ILIKE 'abc';
SELECT
*
FROM
collate_test1
WHERE
b ILIKE 'abc%';
SELECT
*
FROM
collate_test1
WHERE
b ILIKE '%bc%';
SELECT
'Türkiye' COLLATE "en_US" ILIKE '%KI%' AS "true";
SELECT
'Türkiye' COLLATE "tr_TR" ILIKE '%KI%' AS "false";
SELECT
'bıt' ILIKE 'BIT' COLLATE "en_US" AS "false";
SELECT
'bıt' ILIKE 'BIT' COLLATE "tr_TR" AS "true";
-- The following actually exercises the selectivity estimation for ILIKE.
SELECT
relname
FROM
pg_class
WHERE
relname ILIKE 'abc%';
-- regular expressions
SELECT
*
FROM
collate_test1
WHERE
b ~ '^abc$';
SELECT
*
FROM
collate_test1
WHERE
b ~ '^abc';
SELECT
*
FROM
collate_test1
WHERE
b ~ 'bc';
SELECT
*
FROM
collate_test1
WHERE
b ~* '^abc$';
SELECT
*
FROM
collate_test1
WHERE
b ~* '^abc';
SELECT
*
FROM
collate_test1
WHERE
b ~* 'bc';
CREATE TABLE collate_test6 (
a int,
b text COLLATE "en_US"
);
INSERT INTO collate_test6
VALUES (1, 'abc'), (2, 'ABC'), (3, '123'), (4, 'ab1'), (5, 'a1!'), (6, 'a c'), (7, '!.;'), (8, ' '), (9, 'äbç'), (10, 'ÄBÇ');
SELECT
b,
b ~ '^[[:alpha:]]+$' AS is_alpha,
b ~ '^[[:upper:]]+$' AS is_upper,
b ~ '^[[:lower:]]+$' AS is_lower,
b ~ '^[[:digit:]]+$' AS is_digit,
b ~ '^[[:alnum:]]+$' AS is_alnum,
b ~ '^[[:graph:]]+$' AS is_graph,
b ~ '^[[:print:]]+$' AS is_print,
b ~ '^[[:punct:]]+$' AS is_punct,
b ~ '^[[:space:]]+$' AS is_space
FROM
collate_test6;
SELECT
'Türkiye' COLLATE "en_US" ~* 'KI' AS "true";
SELECT
'Türkiye' COLLATE "tr_TR" ~* 'KI' AS "false";
SELECT
'bıt' ~* 'BIT' COLLATE "en_US" AS "false";
SELECT
'bıt' ~* 'BIT' COLLATE "tr_TR" AS "true";
-- The following actually exercises the selectivity estimation for ~*.
SELECT
relname
FROM
pg_class
WHERE
relname ~* '^abc';
-- to_char
SET lc_time TO 'tr_TR';
SELECT
to_char(date '2010-02-01', 'DD TMMON YYYY');
SELECT
to_char(date '2010-02-01', 'DD TMMON YYYY' COLLATE "tr_TR");
SELECT
to_char(date '2010-04-01', 'DD TMMON YYYY');
SELECT
to_char(date '2010-04-01', 'DD TMMON YYYY' COLLATE "tr_TR");
-- backwards parsing
CREATE VIEW collview1 AS
SELECT
*
FROM
collate_test1
WHERE
b COLLATE "C" >= 'bbc';
CREATE VIEW collview2 AS
SELECT
a,
b
FROM
collate_test1
ORDER BY
b COLLATE "C";
CREATE VIEW collview3 AS
SELECT
a,
lower((x || x)
COLLATE "C")
FROM
collate_test10;
SELECT
table_name,
view_definition
FROM
information_schema.views
WHERE
table_name LIKE 'collview%'
ORDER BY
1;
-- collation propagation in various expression types
SELECT
a,
coalesce(b, 'foo')
FROM
collate_test1
ORDER BY
2;
SELECT
a,
coalesce(b, 'foo')
FROM
collate_test2
ORDER BY
2;
SELECT
a,
coalesce(b, 'foo')
FROM
collate_test3
ORDER BY
2;
SELECT
a,
lower(coalesce(x, 'foo')),
lower(coalesce(y, 'foo'))
FROM
collate_test10;
SELECT
a,
b,
greatest (b, 'CCC')
FROM
collate_test1
ORDER BY
3;
SELECT
a,
b,
greatest (b, 'CCC')
FROM
collate_test2
ORDER BY
3;
SELECT
a,
b,
greatest (b, 'CCC')
FROM
collate_test3
ORDER BY
3;
SELECT
a,
x,
y,
lower(greatest (x, 'foo')),
lower(greatest (y, 'foo'))
FROM
collate_test10;
SELECT
a,
nullif (b, 'abc')
FROM
collate_test1
ORDER BY
2;
SELECT
a,
nullif (b, 'abc')
FROM
collate_test2
ORDER BY
2;
SELECT
a,
nullif (b, 'abc')
FROM
collate_test3
ORDER BY
2;
SELECT
a,
lower(nullif (x, 'foo')),
lower(nullif (y, 'foo'))
FROM
collate_test10;
SELECT
a,
CASE b
WHEN 'abc' THEN
'abcd'
ELSE
b
END
FROM
collate_test1
ORDER BY
2;
SELECT
a,
CASE b
WHEN 'abc' THEN
'abcd'
ELSE
b
END
FROM
collate_test2
ORDER BY
2;
SELECT
a,
CASE b
WHEN 'abc' THEN
'abcd'
ELSE
b
END
FROM
collate_test3
ORDER BY
2;
CREATE DOMAIN testdomain AS text;
SELECT
a,
b::testdomain
FROM
collate_test1
ORDER BY
2;
SELECT
a,
b::testdomain
FROM
collate_test2
ORDER BY
2;
SELECT
a,
b::testdomain
FROM
collate_test3
ORDER BY
2;
SELECT
a,
b::testdomain_sv
FROM
collate_test3
ORDER BY
2;
SELECT
a,
lower(x::testdomain),
lower(y::testdomain)
FROM
collate_test10;
SELECT
min(b),
max(b)
FROM
collate_test1;
SELECT
min(b),
max(b)
FROM
collate_test2;
SELECT
min(b),
max(b)
FROM
collate_test3;
SELECT
array_agg(b ORDER BY b)
FROM
collate_test1;
SELECT
array_agg(b ORDER BY b)
FROM
collate_test2;
SELECT
array_agg(b ORDER BY b)
FROM
collate_test3;
SELECT
a,
b
FROM
collate_test1
UNION ALL
SELECT
a,
b
FROM
collate_test1
ORDER BY
2;
SELECT
a,
b
FROM
collate_test2
UNION
SELECT
a,
b
FROM
collate_test2
ORDER BY
2;
SELECT
a,
b
FROM
collate_test3
WHERE
a < 4
INTERSECT
SELECT
a,
b
FROM
collate_test3
WHERE
a > 1
ORDER BY
2;
SELECT
a,
b
FROM
collate_test3
EXCEPT
SELECT
a,
b
FROM
collate_test3
WHERE
a < 2
ORDER BY
2;
SELECT
a,
b
FROM
collate_test1
UNION ALL
SELECT
a,
b
FROM
collate_test3
ORDER BY
2;
-- fail
SELECT
a,
b
FROM
collate_test1
UNION ALL
SELECT
a,
b
FROM
collate_test3;
-- ok
SELECT
a,
b
FROM
collate_test1
UNION
SELECT
a,
b
FROM
collate_test3
ORDER BY
2;
-- fail
SELECT
a,
b COLLATE "C"
FROM
collate_test1
UNION
SELECT
a,
b
FROM
collate_test3
ORDER BY
2;
-- ok
SELECT
a,
b
FROM
collate_test1
INTERSECT
SELECT
a,
b
FROM
collate_test3
ORDER BY
2;
-- fail
SELECT
a,
b
FROM
collate_test1
EXCEPT
SELECT
a,
b
FROM
collate_test3
ORDER BY
2;
-- fail
CREATE TABLE test_u AS
SELECT
a,
b
FROM
collate_test1
UNION ALL
SELECT
a,
b
FROM
collate_test3;
-- fail
-- ideally this would be a parse-time error, but for now it must be run-time:
SELECT
x < y
FROM
collate_test10;
-- fail
SELECT
x || y
FROM
collate_test10;
-- ok, because || is not collation aware
SELECT
x,
y
FROM
collate_test10
ORDER BY
x || y;
-- not so ok
-- collation mismatch between recursive and non-recursive term
WITH RECURSIVE foo (
x
) AS (
SELECT
x
FROM (
VALUES ('a' COLLATE "en_US"),
('b')) t (x)
UNION ALL
SELECT
(x || 'c')
COLLATE "de_DE"
FROM
foo
WHERE
length(x) < 10
)
SELECT
*
FROM
foo;
-- casting
SELECT
CAST('42' AS text COLLATE "C");
SELECT
a,
CAST(b AS varchar)
FROM
collate_test1
ORDER BY
2;
SELECT
a,
CAST(b AS varchar)
FROM
collate_test2
ORDER BY
2;
SELECT
a,
CAST(b AS varchar)
FROM
collate_test3
ORDER BY
2;
-- propagation of collation in SQL functions (inlined and non-inlined cases)
-- and plpgsql functions too
CREATE FUNCTION mylt (text, text)
RETURNS boolean
LANGUAGE sql
AS $$
SELECT
$1 < $2
$$;
CREATE FUNCTION mylt_noninline (text, text)
RETURNS boolean
LANGUAGE sql
AS $$
SELECT
$1 < $2
LIMIT 1
$$;
CREATE FUNCTION mylt_plpgsql (text, text)
RETURNS boolean
LANGUAGE plpgsql
AS $$
BEGIN
RETURN $1 < $2;
END
$$;
SELECT
a.b AS a,
b.b AS b,
a.b < b.b AS lt,
mylt (a.b, b.b),
mylt_noninline (a.b, b.b),
mylt_plpgsql (a.b, b.b)
FROM
collate_test1 a,
collate_test1 b
ORDER BY
a.b,
b.b;
SELECT
a.b AS a,
b.b AS b,
a.b < b.b COLLATE "C" AS lt,
mylt (a.b, b.b COLLATE "C"),
mylt_noninline (a.b, b.b COLLATE "C"),
mylt_plpgsql (a.b, b.b COLLATE "C")
FROM
collate_test1 a,
collate_test1 b
ORDER BY
a.b,
b.b;
-- collation override in plpgsql
CREATE FUNCTION mylt2 (x text, y text)
RETURNS boolean
LANGUAGE plpgsql
AS $$
DECLARE
xx text := x;
yy text := y;
BEGIN
RETURN xx < yy;
END
$$;
SELECT
mylt2 ('a', 'B' COLLATE "en_US") AS t,
mylt2 ('a', 'B' COLLATE "C") AS f;
CREATE OR REPLACE FUNCTION mylt2 (x text, y text)
RETURNS boolean
LANGUAGE plpgsql
AS $$
DECLARE
xx text COLLATE "POSIX" := x;
yy text := y;
BEGIN
RETURN xx < yy;
END
$$;
SELECT
mylt2 ('a', 'B') AS f;
SELECT
mylt2 ('a', 'B' COLLATE "C") AS fail;
-- conflicting collations
SELECT
mylt2 ('a', 'B' COLLATE "POSIX") AS f;
-- polymorphism
SELECT
*
FROM
unnest((
SELECT
array_agg(b ORDER BY b)
FROM collate_test1))
ORDER BY
1;
SELECT
*
FROM
unnest((
SELECT
array_agg(b ORDER BY b)
FROM collate_test2))
ORDER BY
1;
SELECT
*
FROM
unnest((
SELECT
array_agg(b ORDER BY b)
FROM collate_test3))
ORDER BY
1;
CREATE FUNCTION dup (anyelement)
RETURNS anyelement
AS 'select $1'
LANGUAGE sql;
SELECT
a,
dup (b)
FROM
collate_test1
ORDER BY
2;
SELECT
a,
dup (b)
FROM
collate_test2
ORDER BY
2;
SELECT
a,
dup (b)
FROM
collate_test3
ORDER BY
2;
-- indexes
CREATE INDEX collate_test1_idx1 ON collate_test1 (b);
CREATE INDEX collate_test1_idx2 ON collate_test1 (b COLLATE "C");
CREATE INDEX collate_test1_idx3 ON collate_test1 ((b COLLATE "C"));
-- this is different grammatically
CREATE INDEX collate_test1_idx4 ON collate_test1 (((b || 'foo') COLLATE "POSIX"));
CREATE INDEX collate_test1_idx5 ON collate_test1 (a COLLATE "C");
-- fail
CREATE INDEX collate_test1_idx6 ON collate_test1 ((a COLLATE "C"));
-- fail
SELECT
relname,
pg_get_indexdef(oid)
FROM
pg_class
WHERE
relname LIKE 'collate_test%_idx%'
ORDER BY
1;
-- schema manipulation commands
CREATE ROLE regress_test_role;
CREATE SCHEMA test_schema;
-- We need to do this this way to cope with varying names for encodings:
DO $$
BEGIN
EXECUTE 'CREATE COLLATION test0 (locale = ' || quote_literal(current_setting('lc_collate')) || ');';
END
$$;
CREATE COLLATION test0
FROM
"C";
-- fail, duplicate name
CREATE COLLATION IF NOT EXISTS test0
FROM
"C";
-- ok, skipped
CREATE COLLATION IF NOT EXISTS test0 (
locale = 'foo'
);
-- ok, skipped
DO $$
BEGIN
EXECUTE 'CREATE COLLATION test1 (lc_collate = ' || quote_literal(current_setting('lc_collate')) || ', lc_ctype = ' || quote_literal(current_setting('lc_ctype')) || ');';
END
$$;
CREATE COLLATION test3 (
LC_COLLATE = 'en_US.utf8'
);
-- fail, need lc_ctype
CREATE COLLATION testx (
locale = 'nonsense'
);
-- fail
CREATE COLLATION testy (
locale = 'en_US.utf8',
version = 'foo'
);
-- fail, no versions for libc
CREATE COLLATION test4
FROM
nonsense;
CREATE COLLATION test5
FROM
test0;
SELECT
collname
FROM
pg_collation
WHERE
collname LIKE 'test%'
ORDER BY
1;
ALTER COLLATION test1 RENAME TO test11;
ALTER COLLATION test0 RENAME TO test11;
-- fail
ALTER COLLATION test1 RENAME TO test22;
-- fail
ALTER COLLATION test11 OWNER TO regress_test_role;
ALTER COLLATION test11 OWNER TO nonsense;
ALTER COLLATION test11 SET SCHEMA test_schema;
COMMENT ON COLLATION test0 IS 'US English';
SELECT
collname,
nspname,
obj_description(pg_collation.oid, 'pg_collation')
FROM
pg_collation
JOIN pg_namespace ON (collnamespace = pg_namespace.oid)
WHERE
collname LIKE 'test%'
ORDER BY
1;
DROP COLLATION test0, test_schema.test11, test5;
DROP COLLATION test0;
-- fail
DROP COLLATION IF EXISTS test0;
SELECT
collname
FROM
pg_collation
WHERE
collname LIKE 'test%';
DROP SCHEMA test_schema;
DROP ROLE regress_test_role;
-- ALTER
ALTER COLLATION "en_US" REFRESH VERSION;
-- dependencies
CREATE COLLATION test0
FROM
"C";
CREATE TABLE collate_dep_test1 (
a int,
b text COLLATE test0
);
CREATE DOMAIN collate_dep_dom1 AS text COLLATE test0;
CREATE TYPE collate_dep_test2 AS (
x int,
y text COLLATE test0
);
CREATE VIEW collate_dep_test3 AS
SELECT
text 'foo' COLLATE test0 AS foo;
CREATE TABLE collate_dep_test4t (
a int,
b text
);
CREATE INDEX collate_dep_test4i ON collate_dep_test4t (b COLLATE test0);
DROP COLLATION test0 RESTRICT;
-- fail
DROP COLLATION test0 CASCADE;
\d collate_dep_test1
\d collate_dep_test2
DROP TABLE collate_dep_test1, collate_dep_test4t;
DROP TYPE collate_dep_test2;
-- test range types and collations
CREATE TYPE textrange_c AS RANGE (
subtype = text,
COLLATION = "C"
);
CREATE TYPE textrange_en_us AS RANGE (
subtype = text,
COLLATION = "en_US"
);
SELECT
textrange_c ('A', 'Z') @> 'b'::text;
SELECT
textrange_en_us ('A', 'Z') @> 'b'::text;
DROP TYPE textrange_c;
DROP TYPE textrange_en_us;
-- nondeterministic collations
-- (not supported with libc provider)
CREATE COLLATION ctest_det (
locale = 'en_US.utf8',
deterministic = TRUE
);
CREATE COLLATION ctest_nondet (
locale = 'en_US.utf8',
deterministic = FALSE
);
-- cleanup
SET client_min_messages TO warning;
DROP SCHEMA collate_tests CASCADE; | the_stack |
-- This scripts contains following object's definition:
-- =============================================================================
-- 1. View: DBA_DETAIL_PRIVILEGES
-- 2. View: DBA_ALL_PRIVILEGES
-- 3. Function: PG_DROP_USER_CASCADE
-- 1. View: DBA_DETAIL_PRIVILEGES
drop VIEW DBA_DETAIL_PRIVILEGES CASCADE;
CREATE OR REPLACE VIEW DBA_DETAIL_PRIVILEGES
AS
SELECT *
FROM (select oid, 'pg_default_acl' as oid_class
, case defaclobjtype when 'r' then 'RELATION' when 'S' then 'SEQUENCE' when 'f' then 'FUNCTION' when 'T' then 'TYPE' when 'n' then 'SCHEMA' else defaclobjtype::text end as type
, 'DEFAULT PRIVILEGES' as privilege_type
, defaclrole::regrole::text as owner
, defaclnamespace::regnamespace::text as schema
, null::text as NAME
, NULL::text as column_name
, (aclexplode(defaclacl)).grantor::regrole::text AS grantor
, (aclexplode(defaclacl)).grantee::regrole::text AS grantee
, (aclexplode(defaclacl)).privilege_type AS privilege
, (aclexplode(defaclacl)).is_grantable AS is_grantable
from pg_default_acl
where defaclacl is not null
union all
select oid, 'pg_class' as oid_class
, case relkind when 'r' then 'TABLE' when 'S' then 'SEQUENCE' when 'v' then 'VIEW' when 'm' then 'MATERIALIZED VIEW' when 'f' then 'FOREIGN TABLE' when 'p' then 'PARTITIONED TABLE' else relkind::text end as type
, case relkind when 'S' then 'SEQUENCE' else 'TABLE' end as privilege_type
, relowner::regrole::text as owner
, relnamespace::regnamespace::text as schema
, relname::text as NAME
, NULL::text as column_name
, (aclexplode(relacl)).grantor::regrole::text AS grantor
, (aclexplode(relacl)).grantee::regrole::text AS grantee
, (aclexplode(relacl)).privilege_type AS privilege
, (aclexplode(relacl)).is_grantable AS is_grantable
from pg_class
where relacl is not null
union all
select c.oid, 'pg_class' as oid_class
, 'COLUMN' as type
, 'TABLE (COLUMN)' as privilege_type
, c.relowner::regrole::text as owner
, c.relnamespace::regnamespace::text as schema
, c.relname::text as name
, a.attname::text as column_name
, (aclexplode(a.attacl)).grantor::regrole::text AS grantor
, (aclexplode(a.attacl)).grantee::regrole::text AS grantee
, (aclexplode(a.attacl)).privilege_type AS privilege
, (aclexplode(a.attacl)).is_grantable AS is_grantable
from pg_attribute as a
join pg_class as c on a.attrelid = c.oid
where a.attacl is not null
union all
select oid, 'pg_database' as oid_class
, 'DATABASE' as type
, 'DATABASE' as privilege_type
, datdba::regrole::text as owner
, null::text as schema
, datname::text as name
, null::text as column_name
, (aclexplode(datacl)).grantor::regrole::text AS grantor
, (aclexplode(datacl)).grantee::regrole::text AS grantee
, (aclexplode(datacl)).privilege_type AS privilege
, (aclexplode(datacl)).is_grantable AS is_grantable
from pg_database
where datacl is not null
union all
select oid, 'pg_foreign_data_wrapper' as oid_class
, 'FOREIGN DATA WRAPPER' as type
, 'FOREIGN DATA WRAPPER' as privilege_type
, fdwowner::regrole::text as owner
, null::text as schema
, fdwname::text as name
, null::text as column_name
, (aclexplode(fdwacl)).grantor::regrole::text AS grantor
, (aclexplode(fdwacl)).grantee::regrole::text AS grantee
, (aclexplode(fdwacl)).privilege_type AS privilege
, (aclexplode(fdwacl)).is_grantable AS is_grantable
from pg_foreign_data_wrapper
where fdwacl is not null
union all
select oid, 'pg_foreign_server' as oid_class
, 'FOREIGN SERVER' as type
, 'FOREIGN SERVER' as privilege_type
, srvowner::regrole::text as owner
, null::text as schema
, srvname::text as name
, null::text as column_name
, (aclexplode(srvacl)).grantor::regrole::text AS grantor
, (aclexplode(srvacl)).grantee::regrole::text AS grantee
, (aclexplode(srvacl)).privilege_type AS privilege
, (aclexplode(srvacl)).is_grantable AS is_grantable
from pg_foreign_server
where srvacl is not null
union all
select oid, 'pg_type' as oid_class
, case typtype when 'b' then 'BASE' when 'c' then 'COMPOSITE' when 'd' then 'DOMAIN' when 'e' then 'ENUM' when 'p' then 'PSEUDO' when 'r' then 'RANGE' else typtype::text end as type
, case typtype when 'd' then 'DOMAIN' else 'TYPE' end as privilege_type
, typowner::regrole::text as owner
, typnamespace::regnamespace::text as schema
, typname::text as name
, null::text as column_name
, (aclexplode(typacl)).grantor::regrole::text AS grantor
, (aclexplode(typacl)).grantee::regrole::text AS grantee
, (aclexplode(typacl)).privilege_type AS privilege
, (aclexplode(typacl)).is_grantable AS is_grantable
from pg_type
where typacl is not null
union all
select oid, 'pg_proc' as oid_class
, case prokind when 'f' then 'FUNCTION' when 'p' then 'PROCEDURE' when 'a' then 'AGGREGATE' when 'w' then 'WINDOW' else prokind::text end as type
, case prokind when 'p' then 'PROCEDURE' else 'FUNCTION' end as privilege_type
, proowner::regrole::text as owner
, pronamespace::regnamespace::text as schema
, proname::text as name
, null::text as column_name
, (aclexplode(proacl)).grantor::regrole::text AS grantor
, (aclexplode(proacl)).grantee::regrole::text AS grantee
, (aclexplode(proacl)).privilege_type AS privilege
, (aclexplode(proacl)).is_grantable AS is_grantable
from pg_proc
where proacl is not null
union all
select oid, 'pg_language' as oid_class
, 'LANGUAGE' as type
, 'LANGUAGE' as privilege_type
, lanowner::regrole::text as owner
, null::text as schema
, lanname::text as name
, null::text as column_name
, (aclexplode(lanacl)).grantor::regrole::text AS grantor
, (aclexplode(lanacl)).grantee::regrole::text AS grantee
, (aclexplode(lanacl)).privilege_type AS privilege
, (aclexplode(lanacl)).is_grantable AS is_grantable
from pg_language
where lanacl is not null
union all
select oid, 'pg_largeobject_metadata' as oid_class
, 'LARGE OBJECT' as type
, 'LARGE OBJECT' as privilege_type
, lomowner::regrole::text as owner
, null::text as schema
, oid::text as name
, null::text as column_name
, (aclexplode(lomacl)).grantor::regrole::text AS grantor
, (aclexplode(lomacl)).grantee::regrole::text AS grantee
, (aclexplode(lomacl)).privilege_type AS privilege
, (aclexplode(lomacl)).is_grantable AS is_grantable
from pg_largeobject_metadata
where lomacl is not null
union all
select oid, 'pg_namespace' as oid_class
, 'SCHEMA' as type
, 'SCHEMA' as privilege_type
, nspowner::regrole::text as owner
, null::text as schema
, nspname::text as name
, null::text as column_name
, (aclexplode(nspacl)).grantor::regrole::text AS grantor
, (aclexplode(nspacl)).grantee::regrole::text AS grantee
, (aclexplode(nspacl)).privilege_type AS privilege
, (aclexplode(nspacl)).is_grantable AS is_grantable
from pg_namespace
where nspacl is not null
union all
select oid, 'pg_tablespace' as oid_class
, 'TABLESPACE' as type
, 'TABLESPACE' as privilege_type
, spcowner::regrole::text as owner
, null::text as schema
, spcname::text as name
, null::text as column_name
, (aclexplode(spcacl)).grantor::regrole::text AS grantor
, (aclexplode(spcacl)).grantee::regrole::text AS grantee
, (aclexplode(spcacl)).privilege_type AS privilege
, (aclexplode(spcacl)).is_grantable AS is_grantable
from pg_tablespace
where spcacl is not null
) t
where t.grantee != t.grantor
and t.grantee != '-';
-- 2. View: DBA_ALL_PRIVILEGES
drop VIEW DBA_ALL_PRIVILEGES CASCADE;
CREATE OR REPLACE VIEW DBA_ALL_PRIVILEGES
AS
with all_privs as (select oid, oid_class, type, privilege_type, owner, schema, name, column_name, grantor, grantee, is_grantable
from dba_detail_privileges
group by oid, oid_class, type, privilege_type, owner, schema, name, column_name, grantor, grantee, is_grantable
having (privilege_type = 'TABLE' and count(*) = 7)
or (privilege_type = 'TABLE (COLUMN)' and count(*) = 4)
or (privilege_type = 'SEQUENCE' and count(*) = 3)
or (privilege_type = 'DATABASE' and count(*) = 3)
or (privilege_type = 'LARGE OBJECT' and count(*) = 2)
or (privilege_type = 'SCHEMA' and count(*) = 2)
or (privilege_type = 'DEFAULT PRIVILEGES' and type = 'RELATION' and count(*) = 7)
or (privilege_type = 'DEFAULT PRIVILEGES' and type = 'SEQUENCE' and count(*) = 3)
or (privilege_type = 'DEFAULT PRIVILEGES' and type = 'SCHEMA' and count(*) = 2)
)
SELECT t.*
, case when privilege_type = 'TABLE (COLUMN)'
then 'GRANT '||privilege||' ('||column_name||') on TABLE '||schema||'.'||name||' to '||grantee
when privilege_type = 'DEFAULT PRIVILEGES'
then 'alter default privileges for user '||grantor||' GRANT '||privilege||' on '||(case type when 'RELATION' then 'TABLE' else type end)||'S to '||grantee
else 'GRANT '||privilege||' on '||privilege_type||' '||(case when schema is not null then schema||'.'||name else name end)||' to '||grantee
end as grant_sql
, case when privilege_type = 'TABLE (COLUMN)'
then 'REVOKE '||privilege||' ('||column_name||') on TABLE '||schema||'.'||name||' from '||grantee
when privilege_type = 'DEFAULT PRIVILEGES'
then 'alter default privileges for user '||grantor||' REVOKE '||privilege||' on '||(case type when 'RELATION' then 'TABLE' else type end)||'S from '||grantee
else 'REVOKE '||privilege||' on '||privilege_type||' '||(case when schema is not null then schema||'.'||name else name end)||' from '||grantee
end as revoke_sql
from (select oid, oid_class, type, privilege_type, owner, schema, name, column_name, grantor, grantee, 'ALL' as privilege, is_grantable
from all_privs
union all
select oid, oid_class, type, privilege_type, owner, schema, name, column_name, grantor, grantee, privilege, is_grantable
from dba_detail_privileges x
where not exists (select 1 from all_privs where oid = x.oid and grantor = x.grantor and grantee = x.grantee)
) t;
-- 3. Function: PG_DROP_USER_CASCADE
create or replace function PG_DROP_USER_CASCADE ( pi_user text
, pi_schema_cascade boolean default 'false')
returns void
as $$
declare
l_record record;
l_user text := lower(pi_user);
l_exists bigint;
begin
if pi_schema_cascade
then
raise notice '0. drop schemas: %', clock_timestamp();
for l_record in select nspname::regnamespace::text as nspname
from pg_namespace
where nspowner = l_user::regrole
loop
raise notice ' drop schema if exists % cascade', l_record.nspname;
execute 'drop schema if exists '||l_record.nspname||' cascade';
end loop;
end if;
select count(*) into l_exists from pg_user where usename = l_user;
if l_exists > 0 then
raise notice '1. revoke privileges: %', clock_timestamp();
for l_record in select 'revoke '||privilege||' on '||privilege_type||' '||(case when schema is not null then schema||'.'||name else name end)||' from '||grantee as revoke_sql
from dba_all_privileges
where privilege_type not in ('TABLE (COLUMN)', 'DEFAULT PRIVILEGES')
and (grantee = l_user or grantor = l_user or owner = l_user)
union all
select 'revoke '||privilege||' ('||string_agg(column_name, ',')||') on TABLE '||schema||'.'||name||' from '||grantee as revoke_sql
from dba_all_privileges
where privilege_type = 'TABLE (COLUMN)'
and (grantee = l_user or grantor = l_user or owner = l_user)
group by privilege, privilege_type, schema, name, grantee
union all
select 'alter default privileges for user '||grantor||' revoke '||privilege||' on '||(case type when 'RELATION' then 'TABLE' else type end)||'S from '||grantee as revoke_sql
from dba_all_privileges
where privilege_type = 'DEFAULT PRIVILEGES'
and (grantee = l_user or grantor = l_user or owner = l_user)
loop
execute l_record.revoke_sql;
end loop;
raise notice '2. drop user mappings: %', clock_timestamp();
for l_record in select srvname::text as srvname from pg_foreign_server where oid in (select umserver from pg_user_mapping where umuser = l_user::regrole)
loop
raise notice ' drop user mapping if exists for % server %', l_user, l_record.srvname;
execute 'drop user mapping if exists for '||l_user||' server '||l_record.srvname;
end loop;
raise notice '3. drop user: %', clock_timestamp();
raise notice ' drop user %', l_user;
execute 'drop user '||l_user;
end if;
end;
$$ language plpgsql; | the_stack |
-- fix order no
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Sales_InOut_Description ( IN Record_ID numeric, IN AD_Language Character Varying (6) );
DROP TABLE IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Sales_InOut_Description;
CREATE TABLE de_metas_endcustomer_fresh_reports.Docs_Sales_InOut_Description
(
Description Character Varying (255),
DocumentNo Character Varying (30),
MovementDate Timestamp Without Time Zone,
Reference Character Varying (40),
BP_Value Character Varying (40),
Cont_Name Character Varying (40),
Cont_Phone Character Varying (40),
Cont_Fax Character Varying (40),
Cont_Email Character Varying (60),
SR_Name Text,
SR_Phone Character Varying (40),
SR_Fax Character Varying (40),
SR_Email Character Varying (60),
PrintName Character Varying (60),
order_docno Character Varying (30)
);
CREATE FUNCTION de_metas_endcustomer_fresh_reports.Docs_Sales_InOut_Description ( IN Record_ID numeric, IN AD_Language Character Varying (6) )
RETURNS SETOF de_metas_endcustomer_fresh_reports.Docs_Sales_InOut_Description AS
$$
SELECT
io.description as description,
io.documentno as documentno,
io.movementdate,
io.poreference as reference,
bp.value as bp_value,
Coalesce(cogr.name, '')||
Coalesce(' ' || cont.title, '') ||
Coalesce(' ' || cont.firstName, '') ||
Coalesce(' ' || cont.lastName, '') as cont_name,
cont.phone as cont_phone,
cont.fax as cont_fax,
cont.email as cont_email,
Coalesce(srgr.name, '')||
Coalesce(' ' || srep.title, '') ||
Coalesce(' ' || srep.firstName, '') ||
Coalesce(' ' || srep.lastName, '') as sr_name,
srep.phone as sr_phone,
srep.fax as sr_fax,
srep.email as sr_email,
COALESCE ( dtt.printname, dt.printname ) AS printname,
o.docno AS order_docno
FROM
m_inout io
INNER JOIN C_DocType dt ON io.C_DocType_ID = dt.C_DocType_ID AND dt.isActive = 'Y'
LEFT OUTER JOIN C_DocType_Trl dtt ON dt.C_DocType_ID = dtt.C_DocType_ID AND dtt.AD_Language = $2 AND dtt.isActive = 'Y'
INNER JOIN c_bpartner bp ON io.c_bpartner_id = bp.c_bpartner_id AND bp.isActive = 'Y'
LEFT OUTER JOIN AD_User srep ON io.SalesRep_ID = srep.AD_User_ID AND srep.AD_User_ID<>100 AND srep.isActive = 'Y'
LEFT OUTER JOIN AD_User cont ON io.AD_User_ID = cont.AD_User_ID AND cont.isActive = 'Y'
LEFT OUTER JOIN C_Greeting cogr ON cont.C_Greeting_ID = cogr.C_Greeting_ID AND cogr.isActive = 'Y'
LEFT OUTER JOIN C_Greeting srgr ON srep.C_Greeting_ID = srgr.C_Greeting_ID AND srgr.isActive = 'Y'
LEFT JOIN LATERAL
(
SELECT
First_Agg ( o.DocumentNo ORDER BY o.DocumentNo ) ||
CASE WHEN Count( distinct o.documentNo ) > 1 THEN ' ff.' ELSE '' END AS DocNo
FROM M_InOutLine iol
JOIN C_OrderLine ol ON iol.C_OrderLine_ID = ol.C_OrderLine_ID
JOIN C_Order o ON ol.C_Order_ID = o.C_Order_ID
WHERE iol.M_InOut_ID = $1
) o ON TRUE
WHERE
io.m_inout_id = $1 AND io.isActive = 'Y'
$$
LANGUAGE sql STABLE
;
------------------------
--- add qtyordered , orderUOMSymbol and qtydeliveredcatch
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Sales_InOut_Details ( IN Record_ID numeric, IN AD_Language Character Varying(6) );
DROP TABLE IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Sales_InOut_Details;
CREATE TABLE de_metas_endcustomer_fresh_reports.Docs_Sales_InOut_Details
(
Line Numeric(10, 0),
Name Character Varying,
Attributes Text,
HUQty Numeric,
HUName Text,
qtyEntered Numeric,
PriceEntered Numeric,
UOMSymbol Character Varying(10),
StdPrecision Numeric(10, 0),
LineNetAmt Numeric,
Discount Numeric,
IsDiscountPrinted Character(1),
QtyPattern text,
Description Character Varying,
bp_product_no character varying(30),
bp_product_name character varying(100),
best_before_date text,
lotno character varying,
p_value character varying(30),
p_description character varying(255),
inout_description character varying(255),
iscampaignprice character(1),
qtyordered Numeric,
orderUOMSymbol Character Varying(10)
);
CREATE FUNCTION de_metas_endcustomer_fresh_reports.Docs_Sales_InOut_Details(IN Record_ID numeric,
IN AD_Language Character Varying(6))
RETURNS SETOF de_metas_endcustomer_fresh_reports.Docs_Sales_InOut_Details AS
$$
SELECT
iol.line,
COALESCE(pt.Name, p.name) AS Name,
CASE WHEN Length(att.Attributes) > 15
THEN att.Attributes || E'\n'
ELSE att.Attributes
END AS Attributes,
iol.QtyEnteredTU AS HUQty,
pi.name AS HUName,
(case when qtydeliveredcatch is not null
then qtydeliveredcatch
else iol.QtyEntered * COALESCE(multiplyrate, 1) end) AS QtyEntered,
COALESCE(ic.PriceEntered_Override, ic.PriceEntered) AS PriceEntered,
(case when qtydeliveredcatch is not null
then COALESCE(uomct.UOMSymbol, uomc.UOMSymbol)
else COALESCE(uomt.UOMSymbol, uom.UOMSymbol) end) AS UOMSymbol,
uom.stdPrecision,
COALESCE(ic.PriceActual_Override, ic.PriceActual) * iol.MovementQty * COALESCE(multiplyrate, 1) AS linenetamt,
COALESCE(ic.Discount_Override, ic.Discount) AS Discount,
bp.isDiscountPrinted,
CASE WHEN uom.StdPrecision = 0
THEN '#,##0'
ELSE Substring('#,##0.000' FROM 0 FOR 7 + uom.StdPrecision :: integer) END AS QtyPattern,
iol.Description,
-- in case there is no C_BPartner_Product, fallback to the default ones
COALESCE(NULLIF(bpp.ProductNo, ''), p.value) as bp_product_no,
COALESCE(NULLIF(bpp.ProductName, ''), pt.Name, p.name) as bp_product_name,
to_char(att.best_before_date :: date, 'MM.YYYY') AS best_before_date,
att.lotno,
p.value AS p_value,
p.description AS p_description,
io.description AS inout_description,
ol.iscampaignprice,
ol.qtyordered,
COALESCE(uomt_ol.UOMSymbol, uom_ol.UOMSymbol) AS orderUOMSymbol
FROM
M_InOutLine iol
INNER JOIN M_InOut io ON iol.M_InOut_ID = io.M_InOut_ID AND io.isActive = 'Y'
LEFT OUTER JOIN C_BPartner bp ON io.C_BPartner_ID = bp.C_BPartner_ID AND bp.isActive = 'Y'
LEFT OUTER JOIN (
SELECT
AVG(ic.PriceEntered_Override) AS PriceEntered_Override,
AVG(ic.PriceEntered) AS PriceEntered,
AVG(ic.PriceActual_Override) AS PriceActual_Override,
AVG(ic.PriceActual) AS PriceActual,
AVG(ic.Discount_Override) AS Discount_Override,
AVG(ic.Discount) AS Discount,
Price_UOM_ID,
iciol.M_InOutLine_ID
FROM C_InvoiceCandidate_InOutLine iciol
INNER JOIN C_Invoice_Candidate ic
ON iciol.C_Invoice_Candidate_ID = ic.C_Invoice_Candidate_ID AND ic.isActive = 'Y'
INNER JOIN M_InOutLine iol ON iol.M_InOutLine_ID = iciol.M_InOutLine_ID AND iol.isActive = 'Y'
WHERE iol.M_InOut_ID = $1 AND iciol.isActive = 'Y'
GROUP BY Price_UOM_ID, iciol.M_InOutLine_ID
) ic ON iol.M_InOutLine_ID = ic.M_InOutLine_ID
-- get details from order line
LEFT OUTER JOIN c_orderline ol ON ol.c_orderline_id = iol.c_orderline_id
LEFT OUTER JOIN C_UOM uom_ol ON uom_ol.C_UOM_ID = ol.C_UOM_ID AND uom_ol.isActive = 'Y'
LEFT OUTER JOIN C_UOM_Trl uomt_ol
ON uomt_ol.C_UOM_ID = uom_ol.C_UOM_ID AND uomt_ol.AD_Language = $2 AND uomt_ol.isActive = 'Y'
-- Get Packing instruction
LEFT OUTER JOIN
(
SELECT
String_Agg(DISTINCT name, E'\n'
ORDER BY name) AS Name,
M_InOutLine_ID
FROM
(
SELECT DISTINCT
-- 08604 - in IT1 only one PI was shown though 2 were expected. Only the fallback can do this, so we use it first
COALESCE(pifb.name, pi.name) AS name,
iol.M_InOutLine_ID
FROM
M_InOutLine iol
-- Get PI directly from InOutLine (1 to 1)
LEFT OUTER JOIN M_HU_PI_Item_Product pi
ON iol.M_HU_PI_Item_Product_ID = pi.M_HU_PI_Item_Product_ID AND pi.isActive = 'Y'
LEFT OUTER JOIN M_HU_PI_Item piit ON piit.M_HU_PI_Item_ID = pi.M_HU_PI_Item_ID AND piit.isActive = 'Y'
-- Get PI from HU assignments (1 to n)
-- if the HU was set manually don't check the assignments
LEFT OUTER JOIN M_HU_Assignment asgn ON asgn.AD_Table_ID = ((SELECT get_Table_ID('M_InOutLine')))
AND asgn.Record_ID = iol.M_InOutLine_ID AND asgn.isActive = 'Y' and
iol.ismanualpackingmaterial = 'N'
LEFT OUTER JOIN M_HU tu ON asgn.M_TU_HU_ID = tu.M_HU_ID
LEFT OUTER JOIN M_HU_PI_Item_Product pifb
ON tu.M_HU_PI_Item_Product_ID = pifb.M_HU_PI_Item_Product_ID AND pifb.isActive = 'Y'
LEFT OUTER JOIN M_HU_PI_Item pit ON pifb.M_HU_PI_Item_ID = pit.M_HU_PI_Item_ID AND pit.isActive = 'Y'
--
LEFT OUTER JOIN M_HU_PI_Version piv
ON piv.M_HU_PI_Version_ID = COALESCE(pit.M_HU_PI_Version_ID, piit.M_HU_PI_Version_ID) AND piv.isActive = 'Y'
WHERE
piv.M_HU_PI_Version_ID != 101
AND iol.M_InOut_ID = $1 AND iol.isActive = 'Y'
) x
GROUP BY M_InOutLine_ID
) pi ON iol.M_InOutLine_ID = pi.M_InOutLine_ID
-- Product and its translation
LEFT OUTER JOIN M_Product p ON iol.M_Product_ID = p.M_Product_ID AND p.isActive = 'Y'
LEFT OUTER JOIN M_Product_Trl pt ON iol.M_Product_ID = pt.M_Product_ID AND pt.AD_Language = $2 AND pt.isActive = 'Y'
LEFT OUTER JOIN M_Product_Category pc ON p.M_Product_Category_ID = pc.M_Product_Category_ID AND pc.isActive = 'Y'
-- Unit of measurement and its translation
LEFT OUTER JOIN C_UOM uom ON ic.Price_UOM_ID = uom.C_UOM_ID AND uom.isActive = 'Y'
LEFT OUTER JOIN C_UOM_Trl uomt ON ic.Price_UOM_ID = uomt.C_UOM_ID AND uomt.AD_Language = $2 AND uomt.isActive = 'Y'
LEFT OUTER JOIN C_UOM_Conversion conv ON conv.C_UOM_ID = iol.C_UOM_ID
AND conv.C_UOM_To_ID = ic.Price_UOM_ID
AND iol.M_Product_ID = conv.M_Product_ID
AND conv.isActive = 'Y'
-- Unit of measurement and its translation for catch weight
LEFT OUTER JOIN C_UOM uomc ON uomc.C_UOM_ID = iol.catch_uom_id
LEFT OUTER JOIN C_UOM_Trl uomct on uomct.c_UOM_ID = uom.C_UOM_ID and uomct.AD_Language = $2
-- Attributes
LEFT OUTER JOIN (
SELECT
String_agg(at.ai_value, ', '
ORDER BY Length(at.ai_value), at.ai_value)
FILTER (WHERE at.at_value not in ('HU_BestBeforeDate', 'Lot-Nummer'))
AS Attributes,
at.M_AttributeSetInstance_ID,
String_agg(replace(at.ai_value, 'MHD: ', ''), ', ')
FILTER (WHERE at.at_value like 'HU_BestBeforeDate')
AS best_before_date,
String_agg(ai_value, ', ')
FILTER (WHERE at.at_value like 'Lot-Nummer') AS lotno
FROM Report.fresh_Attributes at
JOIN M_InOutLine iol
ON at.M_AttributeSetInstance_ID = iol.M_AttributeSetInstance_ID AND iol.isActive = 'Y'
WHERE at.at_value IN ('1000002', '1000001', '1000030', '1000015', 'HU_BestBeforeDate', 'Lot-Nummer')
-- Label, Herkunft, Aktionen, Marke (ADR)
AND iol.M_InOut_ID = $1
GROUP BY at.M_AttributeSetInstance_ID
) att ON iol.M_AttributeSetInstance_ID = att.M_AttributeSetInstance_ID
LEFT OUTER JOIN
de_metas_endcustomer_fresh_reports.getC_BPartner_Product_Details(p.M_Product_ID, bp.C_BPartner_ID,
att.M_AttributeSetInstance_ID) as bpp on 1 = 1
WHERE
iol.M_InOut_ID = $1 AND iol.isActive = 'Y'
AND (COALESCE(pc.M_Product_Category_ID, -1) !=
getSysConfigAsNumeric('PackingMaterialProductCategoryID', iol.AD_Client_ID, iol.AD_Org_ID))
AND iol.QtyEntered != 0 -- Don't display lines without a Qty. See 08293
ORDER BY
line
$$
LANGUAGE sql
STABLE;
----------------
-- add phone2
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Generics_Org_Report( IN Email Character Varying(60), IN IsSOTrx Character Varying(1), IN AD_Org_ID Numeric );
DROP TABLE IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Generics_Org_Report;
CREATE TABLE de_metas_endcustomer_fresh_reports.Docs_Generics_Org_Report
(
Name Character Varying(60),
Address Character Varying(100),
VATaxID Character Varying(60),
TaxID Character Varying(60),
Phone Character Varying,
Phone2 Character Varying,
Fax Character Varying,
Postal Character Varying(10),
City Character Varying(60),
Email Character Varying(60),
URL Character Varying
);
CREATE FUNCTION de_metas_endcustomer_fresh_reports.Docs_Generics_Org_Report( IN Email Character Varying(60), IN IsSOTrx Character Varying(1), IN AD_Org_ID Numeric )
RETURNS SETOF de_metas_endcustomer_fresh_reports.Docs_Generics_Org_Report
AS
$$
(
SELECT
org_bp.name AS name,
loc.address1 AS address,
org_bp.vataxid,
org_bp.taxid,
COALESCE(us.phone, org_bpl.phone, '-') AS phone,
us.phone2,
COALESCE(us.fax, org_bpl.fax, '-') AS fax,
loc.postal,
loc.city,
COALESCE($1, us.email) as email,
org_bp.URL
FROM
ad_org ad_org
INNER JOIN c_bpartner org_bp ON ad_org.ad_org_id = org_bp.ad_orgbp_id AND org_bp.isActive = 'Y'
INNER JOIN C_BPartner_Location org_bpl ON org_bpl.C_BPartner_Location_ID =
(
SELECT C_BPartner_Location_ID FROM C_BPartner_Location sub_bpl
WHERE sub_bpl.c_bpartner_id = org_bp.c_bpartner_id AND sub_bpl.isActive = 'Y'
ORDER BY IsBillToDefault DESC, IsBillTo DESC
LIMIT 1
)
INNER JOIN c_location loc ON org_bpl.c_location_id = loc.c_location_id AND loc.isActive = 'Y'
LEFT OUTER JOIN c_country cou ON loc.c_country_id = cou.c_country_id AND cou.isActive = 'Y'
LEFT OUTER JOIN AD_User us ON us.AD_User_ID =
(
SELECT AD_User_ID FROM AD_User sub_us
WHERE org_bp.c_bpartner_id = sub_us.c_bpartner_id AND sub_us.isActive = 'Y'
AND (($2 = 'Y' AND IsSalesContact = 'Y') OR ($2 = 'N' AND IsPurchaseContact = 'Y'))
ORDER BY IsDefaultContact DESC
LIMIT 1
)
WHERE
ad_org.ad_org_id = $3 AND ad_org.isActive = 'Y'
)
$$
LANGUAGE sql STABLE
; | the_stack |
-- 2018-11-22T12:57:47.590
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,563606,570691,0,441,TO_TIMESTAMP('2018-11-22 12:57:47','YYYY-MM-DD HH24:MI:SS'),100,225,'D','Y','N','N','N','N','N','N','N','AD_User_ExternalId',TO_TIMESTAMP('2018-11-22 12:57:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-11-22T12:57:47.600
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Field_ID=570691 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2018-11-22T12:57:47.710
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,563607,570692,0,441,TO_TIMESTAMP('2018-11-22 12:57:47','YYYY-MM-DD HH24:MI:SS'),100,255,'D','Y','N','N','N','N','N','N','N','C_BPartner_ExternalId',TO_TIMESTAMP('2018-11-22 12:57:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-11-22T12:57:47.710
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Field_ID=570692 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2018-11-22T12:57:47.780
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,563608,570693,0,441,TO_TIMESTAMP('2018-11-22 12:57:47','YYYY-MM-DD HH24:MI:SS'),100,255,'D','Y','N','N','N','N','N','N','N','C_BPartner_Location_ExternalId',TO_TIMESTAMP('2018-11-22 12:57:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-11-22T12:57:47.790
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Field_ID=570693 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2018-11-22T12:58:27.423
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,570693,0,441,554399,541264,'F',TO_TIMESTAMP('2018-11-22 12:58:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'C_BPartner_Location_ExternalId',100,0,0,TO_TIMESTAMP('2018-11-22 12:58:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-11-22T12:59:12.148
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,570692,0,441,554400,541263,'F',TO_TIMESTAMP('2018-11-22 12:59:12','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'C_BPartner_ExternalId',15,0,0,TO_TIMESTAMP('2018-11-22 12:59:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-11-22T12:59:43.226
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,570691,0,441,554401,541263,'F',TO_TIMESTAMP('2018-11-22 12:59:43','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'AD_User_ExternalId',16,0,0,TO_TIMESTAMP('2018-11-22 12:59:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-11-22T13:06:33.364
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Contact ExternalId',Updated=TO_TIMESTAMP('2018-11-22 13:06:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=554401
;
-- 2018-11-22T13:06:47.588
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Partner ExternalId',Updated=TO_TIMESTAMP('2018-11-22 13:06:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=554400
;
-- 2018-11-22T13:07:02.284
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Location ExternalId',Updated=TO_TIMESTAMP('2018-11-22 13:07:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=554399
;
-- 2018-11-22T13:10:58.437
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-22 13:10:58','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Contact ExternalId',PrintName='Contact ExternalId' WHERE AD_Element_ID=575886 AND AD_Language='de_DE'
;
-- 2018-11-22T13:10:58.457
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575886,'de_DE')
;
-- 2018-11-22T13:10:58.713
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(575886,'de_DE')
;
-- 2018-11-22T13:10:58.720
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='AD_User_ExternalId', Name='Contact ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID=575886
;
-- 2018-11-22T13:10:58.722
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='AD_User_ExternalId', Name='Contact ExternalId', Description=NULL, Help=NULL, AD_Element_ID=575886 WHERE UPPER(ColumnName)='AD_USER_EXTERNALID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-11-22T13:10:58.725
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='AD_User_ExternalId', Name='Contact ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID=575886 AND IsCentrallyMaintained='Y'
;
-- 2018-11-22T13:10:58.727
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Contact ExternalId', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=575886) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 575886)
;
-- 2018-11-22T13:10:58.739
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Contact ExternalId', Name='Contact ExternalId' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=575886)
;
-- 2018-11-22T13:10:58.743
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Contact ExternalId', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 575886
;
-- 2018-11-22T13:10:58.745
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Contact ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID = 575886
;
-- 2018-11-22T13:10:58.748
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name='Contact ExternalId', Description=NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 575886
;
-- 2018-11-22T13:11:54.521
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-22 13:11:54','YYYY-MM-DD HH24:MI:SS'),Name='Benutzer ExternalId',PrintName='Benutzer ExternalId' WHERE AD_Element_ID=575886 AND AD_Language='de_DE'
;
-- 2018-11-22T13:11:54.527
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575886,'de_DE')
;
-- 2018-11-22T13:11:54.572
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(575886,'de_DE')
;
-- 2018-11-22T13:11:54.639
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='AD_User_ExternalId', Name='Benutzer ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID=575886
;
-- 2018-11-22T13:11:54.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='AD_User_ExternalId', Name='Benutzer ExternalId', Description=NULL, Help=NULL, AD_Element_ID=575886 WHERE UPPER(ColumnName)='AD_USER_EXTERNALID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-11-22T13:11:54.652
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='AD_User_ExternalId', Name='Benutzer ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID=575886 AND IsCentrallyMaintained='Y'
;
-- 2018-11-22T13:11:54.657
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Benutzer ExternalId', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=575886) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 575886)
;
-- 2018-11-22T13:11:54.677
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Benutzer ExternalId', Name='Benutzer ExternalId' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=575886)
;
-- 2018-11-22T13:11:54.681
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Benutzer ExternalId', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 575886
;
-- 2018-11-22T13:11:54.685
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Benutzer ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID = 575886
;
-- 2018-11-22T13:11:54.687
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name='Benutzer ExternalId', Description=NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 575886
;
-- 2018-11-22T13:12:06.930
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-22 13:12:06','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Contact ExternalId',PrintName='Contact ExternalId' WHERE AD_Element_ID=575886 AND AD_Language='en_US'
;
-- 2018-11-22T13:12:06.936
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575886,'en_US')
;
-- 2018-11-22T13:12:33.478
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-22 13:12:33','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Standort ExternalId',PrintName='Standort ExternalId' WHERE AD_Element_ID=575887 AND AD_Language='de_DE'
;
-- 2018-11-22T13:12:33.484
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575887,'de_DE')
;
-- 2018-11-22T13:12:33.518
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(575887,'de_DE')
;
-- 2018-11-22T13:12:33.527
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='C_BPartner_ExternalId', Name='Standort ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID=575887
;
-- 2018-11-22T13:12:33.533
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_BPartner_ExternalId', Name='Standort ExternalId', Description=NULL, Help=NULL, AD_Element_ID=575887 WHERE UPPER(ColumnName)='C_BPARTNER_EXTERNALID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-11-22T13:12:33.536
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_BPartner_ExternalId', Name='Standort ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID=575887 AND IsCentrallyMaintained='Y'
;
-- 2018-11-22T13:12:33.540
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Standort ExternalId', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=575887) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 575887)
;
-- 2018-11-22T13:12:33.555
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Standort ExternalId', Name='Standort ExternalId' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=575887)
;
-- 2018-11-22T13:12:33.558
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Standort ExternalId', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 575887
;
-- 2018-11-22T13:12:33.560
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Standort ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID = 575887
;
-- 2018-11-22T13:12:33.563
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name='Standort ExternalId', Description=NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 575887
;
-- 2018-11-22T13:12:39.584
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-22 13:12:39','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=575887 AND AD_Language='en_US'
;
-- 2018-11-22T13:12:39.590
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575887,'en_US')
;
-- 2018-11-22T13:12:50.882
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-22 13:12:50','YYYY-MM-DD HH24:MI:SS'),Name='Geschaftspartner ExternalId',PrintName='Geschaftspartner ExternalId' WHERE AD_Element_ID=575887 AND AD_Language='de_DE'
;
-- 2018-11-22T13:12:50.888
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575887,'de_DE')
;
-- 2018-11-22T13:12:50.912
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(575887,'de_DE')
;
-- 2018-11-22T13:12:50.914
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='C_BPartner_ExternalId', Name='Geschaftspartner ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID=575887
;
-- 2018-11-22T13:12:50.918
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_BPartner_ExternalId', Name='Geschaftspartner ExternalId', Description=NULL, Help=NULL, AD_Element_ID=575887 WHERE UPPER(ColumnName)='C_BPARTNER_EXTERNALID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-11-22T13:12:50.921
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_BPartner_ExternalId', Name='Geschaftspartner ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID=575887 AND IsCentrallyMaintained='Y'
;
-- 2018-11-22T13:12:50.924
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Geschaftspartner ExternalId', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=575887) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 575887)
;
-- 2018-11-22T13:12:50.936
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Geschaftspartner ExternalId', Name='Geschaftspartner ExternalId' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=575887)
;
-- 2018-11-22T13:12:50.938
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Geschaftspartner ExternalId', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 575887
;
-- 2018-11-22T13:12:50.940
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Geschaftspartner ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID = 575887
;
-- 2018-11-22T13:12:50.942
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name='Geschaftspartner ExternalId', Description=NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 575887
;
-- 2018-11-22T13:13:04.218
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-22 13:13:04','YYYY-MM-DD HH24:MI:SS'),Name='Partner ExternalId',PrintName='Partner ExternalId' WHERE AD_Element_ID=575887 AND AD_Language='en_US'
;
-- 2018-11-22T13:13:04.225
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575887,'en_US')
;
-- 2018-11-22T13:13:32.178
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-22 13:13:32','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Standort ExternalId',PrintName='Standort ExternalId' WHERE AD_Element_ID=575888 AND AD_Language='de_DE'
;
-- 2018-11-22T13:13:32.185
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575888,'de_DE')
;
-- 2018-11-22T13:13:32.228
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(575888,'de_DE')
;
-- 2018-11-22T13:13:32.233
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='C_BPartner_Location_ExternalId', Name='Standort ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID=575888
;
-- 2018-11-22T13:13:32.236
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_BPartner_Location_ExternalId', Name='Standort ExternalId', Description=NULL, Help=NULL, AD_Element_ID=575888 WHERE UPPER(ColumnName)='C_BPARTNER_LOCATION_EXTERNALID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-11-22T13:13:32.238
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_BPartner_Location_ExternalId', Name='Standort ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID=575888 AND IsCentrallyMaintained='Y'
;
-- 2018-11-22T13:13:32.241
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Standort ExternalId', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=575888) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 575888)
;
-- 2018-11-22T13:13:32.254
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Standort ExternalId', Name='Standort ExternalId' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=575888)
;
-- 2018-11-22T13:13:32.257
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Standort ExternalId', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 575888
;
-- 2018-11-22T13:13:32.261
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Standort ExternalId', Description=NULL, Help=NULL WHERE AD_Element_ID = 575888
;
-- 2018-11-22T13:13:32.263
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name='Standort ExternalId', Description=NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 575888
;
-- 2018-11-22T13:13:45.618
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-22 13:13:45','YYYY-MM-DD HH24:MI:SS'),Name='Location ExternalId',PrintName='Location ExternalId' WHERE AD_Element_ID=575888 AND AD_Language='en_US'
;
-- 2018-11-22T13:13:45.625
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575888,'en_US')
;
-- 2018-11-22T13:13:48.058
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-22 13:13:48','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=575888 AND AD_Language='en_US'
;
-- 2018-11-22T13:13:48.064
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575888,'en_US')
; | the_stack |
elapsedtime on;
set spark.sql.shuffle.partitions=29;
SELECT CompanyName FROM Customers WHERE CustomerID = (SELECT CustomerID FROM Orders WHERE OrderID = 10290) --GEMFIREXD-PROPERTIES executionEngine=Spark
;
SELECT CompanyName FROM Customers WHERE CustomerID IN (SELECT CustomerID FROM Orders WHERE OrderDate BETWEEN Cast('1997-01-01' as TIMESTAMP) AND Cast('1997-12-31' as TIMESTAMP));
SELECT ProductName, SupplierID FROM Products WHERE SupplierID IN (SELECT SupplierID FROM Suppliers WHERE CompanyName IN ('Exotic Liquids', 'Grandma Kelly''s Homestead', 'Tokyo Traders'));
SELECT ProductName FROM Products WHERE CategoryID = (SELECT CategoryID FROM Categories WHERE CategoryName = 'Seafood') --GEMFIREXD-PROPERTIES executionEngine=Spark
;
SELECT CompanyName FROM Suppliers WHERE SupplierID IN (SELECT SupplierID FROM Products WHERE CategoryID = 8) --GEMFIREXD-PROPERTIES executionEngine=Spark
;
SELECT CompanyName FROM Suppliers WHERE SupplierID IN (SELECT SupplierID FROM Products WHERE CategoryID = (SELECT CategoryID FROM Categories WHERE CategoryName = 'Seafood')) --GEMFIREXD-PROPERTIES executionEngine=Spark
;
SELECT Employees.EmployeeID, Employees.FirstName, Employees.LastName, Orders.OrderID, Orders.OrderDate FROM Employees JOIN Orders ON (Employees.EmployeeID = Orders.EmployeeID) ORDER BY Orders.OrderDate;
SELECT o.OrderID, c.CompanyName, e.FirstName, e.LastName FROM Orders o JOIN Employees e ON (e.EmployeeID = o.EmployeeID) JOIN Customers c ON (c.CustomerID = o.CustomerID) WHERE o.ShippedDate > o.RequiredDate AND o.OrderDate > Cast ('1998-01-01' as TIMESTAMP) ORDER BY c.CompanyName;
SELECT e.FirstName, e.LastName, o.OrderID FROM Employees e JOIN Orders o ON (e.EmployeeID = o.EmployeeID) WHERE o.RequiredDate < o.ShippedDate ORDER BY e.LastName, e.FirstName;
SELECT p.ProductName, SUM(od.Quantity) AS TotalUnits FROM Order_Details od JOIN Products p ON (p.ProductID = od.ProductID) GROUP BY p.ProductName HAVING SUM(Quantity) < 200;
SELECT COUNT(DISTINCT e.EmployeeID) AS numEmployees, COUNT(DISTINCT c.CustomerID) AS numCompanies, e.City, c.City FROM Employees e JOIN Customers c ON (e.City = c.City) GROUP BY e.City, c.City ORDER BY numEmployees DESC;
SELECT COUNT(DISTINCT e.EmployeeID) AS numEmployees, COUNT(DISTINCT c.CustomerID) AS numCompanies, e.City, c.City FROM Employees e LEFT JOIN Customers c ON (e.City = c.City) GROUP BY e.City, c.City ORDER BY numEmployees DESC;
SELECT COUNT(DISTINCT e.EmployeeID) AS numEmployees, COUNT(DISTINCT c.CustomerID) AS numCompanies, e.City, c.City FROM Employees e RIGHT JOIN Customers c ON (e.City = c.City) GROUP BY e.City, c.City ORDER BY numEmployees DESC;
SELECT COUNT(DISTINCT e.EmployeeID) AS numEmployees, COUNT(DISTINCT c.CustomerID) AS numCompanies, e.City, c.City FROM Employees e FULL JOIN Customers c ON (e.City = c.City) GROUP BY e.City, c.City ORDER BY numEmployees DESC;
select s.supplierid,s.companyname,p.productid,p.productname from suppliers s join products p on(s.supplierid= p.supplierid) and s.companyname IN('Grandma Kelly''s Homestead','Tokyo Traders','Exotic Liquids');
SELECT c.customerID, o.orderID FROM customers c INNER JOIN orders o ON c.CustomerID = o.CustomerID;
SELECT order_details.OrderID,ShipCountry,UnitPrice,Quantity,Discount FROM orders INNER JOIN Order_Details ON Orders.OrderID = Order_Details.OrderID;
SELECT ShipCountry, Sum(Order_Details.UnitPrice * Quantity * Discount) AS ProductSales FROM Orders INNER JOIN Order_Details ON Orders.OrderID = Order_Details.OrderID GROUP BY ShipCountry;
SELECT * FROM orders LEFT SEMI JOIN order_details ON orders.OrderID = order_details.OrderId;
select distinct (a.ShippedDate) as ShippedDate, a.OrderID, b.Subtotal, year(a.ShippedDate) as Year from Orders a
inner join ( select distinct OrderID, sum(UnitPrice * Quantity * (1 - Discount)) as Subtotal
from order_details group by OrderID ) b on a.OrderID = b.OrderID
where a.ShippedDate is not null and a.ShippedDate > Cast('1996-12-24' as TIMESTAMP) and a.ShippedDate < Cast('1997-09-30' as TIMESTAMP)
order by ShippedDate;
select distinct a.CategoryID, a.CategoryName, b.ProductName, sum(c.ExtendedPrice) as ProductSales
from Categories a
inner join Products b on a.CategoryID = b.CategoryID
inner join ( select distinct y.OrderID, y.ProductID, x.ProductName, y.UnitPrice, y.Quantity, y.Discount,
round(y.UnitPrice * y.Quantity * (1 - y.Discount), 2) as ExtendedPrice
from Products x
inner join Order_Details y on x.ProductID = y.ProductID
order by y.OrderID
) c on c.ProductID = b.ProductID
inner join Orders d on d.OrderID = c.OrderID
where d.OrderDate > Cast('1997-01-01' as TIMESTAMP) and d.OrderDate < Cast('1997-12-31' as TIMESTAMP)
group by a.CategoryID, a.CategoryName, b.ProductName
order by a.CategoryName, b.ProductName, ProductSales;
select c.CategoryName as Product_Category, case when s.Country in ('UK','Spain','Sweden','Germany','Norway','Denmark','Netherlands','Finland','Italy','France')
then 'Europe' when s.Country in ('USA','Canada','Brazil') then 'America' else 'Asia-Pacific' end as Supplier_Continent, sum(p.UnitsInStock)
as UnitsInStock from Suppliers s inner join Products p on p.SupplierID=s.SupplierID inner join Categories c on c.CategoryID=p.CategoryID
group by c.CategoryName, case when s.Country in ('UK','Spain','Sweden','Germany','Norway', 'Denmark','Netherlands','Finland','Italy','France')
then 'Europe' when s.Country in ('USA','Canada','Brazil') then 'America' else 'Asia-Pacific'
end --GEMFIREXD-PROPERTIES executionEngine=Spark
;
select CategoryName, format_number(sum(ProductSales), 2) as CategorySales from (select distinct a.CategoryName, b.ProductName,
format_number(sum(c.UnitPrice * c.Quantity * (1 - c.Discount)), 2) as ProductSales, concat('Qtr ', quarter(d.ShippedDate))
as ShippedQuarter from Categories as a inner join Products as b on a.CategoryID = b.CategoryID inner join Order_Details
as c on b.ProductID = c.ProductID inner join Orders as d on d.OrderID = c.OrderID where d.ShippedDate > Cast('1997-01-01' as TIMESTAMP) and d.ShippedDate < Cast('1997-12-31' as TIMESTAMP)
group by a.CategoryName, b.ProductName, concat('Qtr ', quarter(d.ShippedDate)) order by a.CategoryName, b.ProductName, ShippedQuarter )
as x group by CategoryName order by CategoryName;
set spark.sql.crossJoin.enabled=true;
SELECT count(*) FROM orders JOIN order_details;
SELECT count(*) FROM orders LEFT JOIN order_details;
SELECT count(*) FROM orders RIGHT JOIN order_details;
SELECT count(*) FROM orders FULL OUTER JOIN order_details;
SELECT count(*) FROM orders FULL JOIN order_details;
select distinct b.ShipName, b.ShipAddress, b.ShipCity, b.ShipRegion, b.ShipPostalCode, b.ShipCountry, b.CustomerID,
c.CompanyName, c.Address, c.City, c.Region, c.PostalCode, c.Country, concat(d.FirstName, ' ', d.LastName) as Salesperson,
b.OrderID, b.OrderDate, b.RequiredDate, b.ShippedDate, a.CompanyName, e.ProductID, f.ProductName, e.UnitPrice, e.Quantity,
e.Discount, e.UnitPrice * e.Quantity * (1 - e.Discount) as ExtendedPrice, b.Freight
from Shippers a
inner join Orders b on a.ShipperID = b.ShipVia
inner join Customers c on c.CustomerID = b.CustomerID
inner join Employees d on d.EmployeeID = b.EmployeeID
inner join Order_Details e on b.OrderID = e.OrderID
inner join Products f on f.ProductID = e.ProductID
order by b.ShipName;
--This query shows how to use UNION to merge Customers and Suppliers into one result set by
--identifying them as having different relationships to Northwind Traders - Customers and Suppliers.
select City, CompanyName, ContactName, 'Customers' as Relationship
from Customers
union
select City, CompanyName, ContactName, 'Suppliers'
from Suppliers
order by City, CompanyName;
--In the query below, we have two sub-queries in the FROM clause and each sub-query returns a single
-- value. Because the results of the two sub-queries are basically temporary tables, we can join
--them like joining two real tables. In the SELECT clause, we simply list the two counts.
select a.CustomersCount, b.SuppliersCount
from
(select count(CustomerID) as CustomersCount from customers) as a
join
(select count(SupplierID) as SuppliersCount from suppliers) as b;
-- The second query below uses the two values again but this time it calculates the ratio
--between customers count and suppliers count. The round and concat function are used to
--the result.
select concat(round(a.CustomersCount / b.SuppliersCount), ':1') as Customer_vs_Supplier_Ratio
from
(select count(CustomerID) as CustomersCount from customers) as a
join
(select count(SupplierID) as SuppliersCount from suppliers) as b;
-- This query shows how to convert order dates to the corresponding quarters. It also
--demonstrates how SUM function is used together with CASE statement to get sales for each
--quarter, where quarters are converted from OrderDate column.
--This query is commented due to SNAP-1434
select a.ProductName,
d.CompanyName,
year(OrderDate) as OrderYear,
format_number(sum(case quarter(c.OrderDate) when '1'
then b.UnitPrice*b.Quantity*(1-b.Discount) else 0 end), 0) "Qtr_1",
format_number(sum(case quarter(c.OrderDate) when '2'
then b.UnitPrice*b.Quantity*(1-b.Discount) else 0 end), 0) "Qtr_2",
format_number(sum(case quarter(c.OrderDate) when '3'
then b.UnitPrice*b.Quantity*(1-b.Discount) else 0 end), 0) "Qtr_3",
format_number(sum(case quarter(c.OrderDate) when '4'
then b.UnitPrice*b.Quantity*(1-b.Discount) else 0 end), 0) "Qtr_4"
from Products a
inner join Order_Details b on a.ProductID = b.ProductID
inner join Orders c on c.OrderID = b.OrderID
inner join Customers d on d.CustomerID = c.CustomerID
where c.OrderDate between Cast('1997-01-01' as TIMESTAMP) and Cast('1997-12-31' as TIMESTAMP)
group by a.ProductName,
d.CompanyName,
year(OrderDate)
order by a.ProductName, d.CompanyName;
SELECT CompanyName FROM Customers WHERE CustomerID = (SELECT CustomerID FROM Orders WHERE OrderID = 10295);
SELECT CompanyName FROM Customers WHERE CustomerID = (SELECT CustomerID FROM Orders WHERE OrderID = 10391);
SELECT CompanyName FROM Customers WHERE CustomerID IN (SELECT CustomerID FROM Orders WHERE OrderDate BETWEEN Cast('1997-09-30' as TIMESTAMP) AND Cast('1997-12-24' as TIMESTAMP)) ;
SELECT CompanyName FROM Customers WHERE CustomerID IN (SELECT CustomerID FROM Orders WHERE OrderDate BETWEEN Cast('1997-10-01' as TIMESTAMP) AND Cast('1997-12-31' as TIMESTAMP)) ;
SELECT ProductName, SupplierID FROM Products WHERE SupplierID IN (SELECT SupplierID FROM Suppliers WHERE CompanyName IN ('Pavlova Ltd.')) ;
SELECT ProductName, SupplierID FROM Products WHERE SupplierID IN (SELECT SupplierID FROM Suppliers WHERE CompanyName IN ('Pavlova Ltd.', 'Karkki Oy')) ;
SELECT ProductName, SupplierID FROM Products WHERE SupplierID IN (SELECT SupplierID FROM Suppliers WHERE CompanyName IN ('Grandma Kellys Homestead')) ;
SELECT ProductName, SupplierID FROM Products WHERE SupplierID IN (SELECT SupplierID FROM Suppliers WHERE CompanyName IN ('Exotic Liquids', 'Karkki Oy')) ;
SELECT ProductName FROM Products WHERE CategoryID = (SELECT CategoryID FROM Categories WHERE CategoryName = 'Condiments') ;
SELECT ProductName FROM Products WHERE CategoryID = (SELECT CategoryID FROM Categories WHERE CategoryName = 'Produce') ;
SELECT CompanyName FROM Suppliers WHERE SupplierID IN (SELECT SupplierID FROM Products WHERE CategoryID = 5) ;
SELECT CompanyName FROM Suppliers WHERE SupplierID IN (SELECT SupplierID FROM Products WHERE CategoryID = 3) ;
SELECT CompanyName FROM Suppliers WHERE SupplierID IN (SELECT SupplierID FROM Products WHERE CategoryID = (SELECT CategoryID FROM Categories WHERE CategoryName = 'Condiments')) ;
SELECT CompanyName FROM Suppliers WHERE SupplierID IN (SELECT SupplierID FROM Products WHERE CategoryID = (SELECT CategoryID FROM Categories WHERE CategoryName = 'Confections')) ;
SELECT Employees.EmployeeID, Employees.FirstName, Employees.LastName, Orders.OrderID, Orders.OrderDate FROM Employees JOIN Orders ON (Employees.EmployeeID = Orders.EmployeeID) where Orders.EmployeeID < 5 ORDER BY Orders.OrderDate ;
SELECT Employees.EmployeeID, Employees.FirstName, Employees.LastName, Orders.OrderID, Orders.OrderDate FROM Employees JOIN Orders ON (Employees.EmployeeID = Orders.EmployeeID) where Orders.EmployeeID > 5 ORDER BY Orders.OrderDate ;
SELECT Employees.EmployeeID, Employees.FirstName, Employees.LastName, Orders.OrderID, Orders.OrderDate FROM Employees JOIN Orders ON (Employees.EmployeeID = Orders.EmployeeID) where Orders.EmployeeID < 3 ORDER BY Orders.OrderDate ;
SELECT Employees.EmployeeID, Employees.FirstName, Employees.LastName, Orders.OrderID, Orders.OrderDate FROM Employees JOIN Orders ON (Employees.EmployeeID = Orders.EmployeeID) where Orders.EmployeeID > 3 ORDER BY Orders.OrderDate ;
SELECT o.OrderID, c.CompanyName, e.FirstName, e.LastName FROM Orders o JOIN Employees e ON (e.EmployeeID = o.EmployeeID) JOIN Customers c ON (c.CustomerID = o.CustomerID) WHERE o.ShippedDate < o.RequiredDate AND o.OrderDate > Cast('1997-12-01' as TIMESTAMP) ORDER BY c.CompanyName ;
SELECT e.FirstName, e.LastName, o.OrderID FROM Employees e JOIN Orders o ON (e.EmployeeID = o.EmployeeID) WHERE o.RequiredDate > o.ShippedDate ORDER BY e.LastName, e.FirstName ;
SELECT p.ProductName, SUM(od.Quantity) AS TotalUnits FROM Order_Details od JOIN Products p ON (p.ProductID = od.ProductID) GROUP BY p.ProductName HAVING SUM(Quantity) >10 and SUM(Quantity) <100 ;
SELECT p.ProductName, SUM(od.Quantity) AS TotalUnits FROM Order_Details od JOIN Products p ON (p.ProductID = od.ProductID) GROUP BY p.ProductName HAVING SUM(Quantity) >100 and SUM(Quantity) <200 ;
SELECT COUNT(DISTINCT e.EmployeeID) AS numEmployees, COUNT(DISTINCT c.CustomerID) AS numCompanies, e.City as employeeCity, c.City as customerCity FROM Employees e JOIN Customers c ON (e.City = c.City) where e.EmployeeID > 5 GROUP BY e.City, c.City ORDER BY numEmployees DESC ;
SELECT COUNT(DISTINCT e.EmployeeID) AS numEmployees, COUNT(DISTINCT c.CustomerID) AS numCompanies, e.City as employeeCity, c.City as customerCity FROM Employees e JOIN Customers c ON (e.City = c.City) where e.EmployeeID > 1 GROUP BY e.City, c.City ORDER BY numEmployees DESC ;
select distinct (a.ShippedDate) as ShippedDate, a.OrderID, b.Subtotal, year(a.ShippedDate) as Year from Orders a inner join ( select distinct OrderID, sum(UnitPrice * Quantity * (1 - Discount)) as Subtotal from order_details group by OrderID ) b on a.OrderID = b.OrderID where a.ShippedDate is not null and a.ShippedDate > Cast('1997-02-24' as TIMESTAMP) and a.ShippedDate < Cast('1997-09-30' as TIMESTAMP) order by ShippedDate ;
select distinct (a.ShippedDate) as ShippedDate, a.OrderID, b.Subtotal, year(a.ShippedDate) as Year from Orders a inner join ( select distinct OrderID, sum(UnitPrice * Quantity * (2 - Discount)) as Subtotal from order_details group by OrderID ) b on a.OrderID = b.OrderID where a.ShippedDate is not null and a.ShippedDate > Cast('1996-02-24' as TIMESTAMP) and a.ShippedDate < Cast('1996-09-30' as TIMESTAMP) order by ShippedDate ;
select distinct b.ShipName, b.ShipAddress, b.ShipCity, b.ShipRegion, b.ShipPostalCode, b.ShipCountry, b.CustomerID, c.CompanyName as custCompanyName, c.Address, c.City, c.Region, c.PostalCode, c.Country, concat(d.FirstName, ' ', d.LastName) as Salesperson, b.OrderID, b.OrderDate, b.RequiredDate, b.ShippedDate, a.CompanyName as shippersCompanyName, e.ProductID, f.ProductName, e.UnitPrice, e.Quantity, e.Discount, e.UnitPrice * e.Quantity * (1 - e.Discount) as ExtendedPrice, b.Freight from Shippers a inner join Orders b on a.ShipperID = b.ShipVia inner join Customers c on c.CustomerID = b.CustomerID inner join Employees d on d.EmployeeID = b.EmployeeID inner join Order_Details e on b.OrderID = e.OrderID inner join Products f on f.ProductID = e.ProductID where b.ShippedDate > Cast('1996-07-10' as TIMESTAMP) order by b.ShipName ;
select distinct b.ShipName, b.ShipAddress, b.ShipCity, b.ShipRegion, b.ShipPostalCode, b.ShipCountry, b.CustomerID, c.CompanyName as custCompanyName, c.Address, c.City, c.Region, c.PostalCode, c.Country, concat(d.FirstName, ' ', d.LastName) as Salesperson, b.OrderID, b.OrderDate, b.RequiredDate, b.ShippedDate, a.CompanyName as shippersCompanyName, e.ProductID, f.ProductName, e.UnitPrice, e.Quantity, e.Discount, e.UnitPrice * e.Quantity * (1 - e.Discount) as ExtendedPrice, b.Freight from Shippers a inner join Orders b on a.ShipperID = b.ShipVia inner join Customers c on c.CustomerID = b.CustomerID inner join Employees d on d.EmployeeID = b.EmployeeID inner join Order_Details e on b.OrderID = e.OrderID inner join Products f on f.ProductID = e.ProductID where b.ShippedDate > Cast('1996-07-29' as TIMESTAMP) order by b.ShipName ;
SELECT c.customerID, o.orderID FROM customers c INNER JOIN orders o ON c.CustomerID = o.CustomerID where c.CustomerID='LINOD' ;
SELECT c.customerID, o.orderID FROM customers c INNER JOIN orders o ON c.CustomerID = o.CustomerID where c.CustomerID='SEVES' ;
SELECT ShipCountry, Sum(Order_Details.UnitPrice * Quantity * Discount) AS ProductSales FROM Orders INNER JOIN Order_Details ON Orders.OrderID = Order_Details.OrderID where orders.OrderID > 11000 GROUP BY ShipCountry ;
SELECT ShipCountry, Sum(Order_Details.UnitPrice * Quantity * Discount) AS ProductSales FROM Orders INNER JOIN Order_Details ON Orders.OrderID = Order_Details.OrderID where orders.OrderID > 11070 GROUP BY ShipCountry ;
SELECT * FROM orders LEFT SEMI JOIN order_details ON orders.OrderID = order_details.OrderId where orders.OrderID > 11067 ;
SELECT * FROM orders LEFT SEMI JOIN order_details ON orders.OrderID = order_details.OrderId where orders.OrderID > 11075 ;
SELECT orders.OrderID as OOID, CustomerID,EmployeeID,OrderDate, RequiredDate, ShippedDate,ShipVia,Freight,ShipName,ShipAddress,ShipCity,ShipRegion,ShipPostalCode, ShipCountry FROM orders FULL JOIN order_details where orders.ShippedDate > Cast('1996-07-29' as TIMESTAMP) ;
SELECT orders.OrderID as OOID, CustomerID,EmployeeID,OrderDate, RequiredDate, ShippedDate,ShipVia,Freight,ShipName,ShipAddress,ShipCity,ShipRegion,ShipPostalCode, ShipCountry FROM orders FULL JOIN order_details where orders.ShippedDate > Cast('1996-07-10' as TIMESTAMP) ;
SELECT orders.OrderID as OOID, CustomerID,EmployeeID,OrderDate, RequiredDate, ShippedDate,ShipVia,Freight,ShipName,ShipAddress,ShipCity,ShipRegion,ShipPostalCode, ShipCountry FROM orders LEFT JOIN order_details ON Orders.OrderID = Order_Details.OrderID where orders.ShippedDate > Cast('1996-07-10' as TIMESTAMP) ;
SELECT orders.OrderID as OOID, CustomerID,EmployeeID,OrderDate, RequiredDate, ShippedDate,ShipVia,Freight,ShipName,ShipAddress,ShipCity,ShipRegion,ShipPostalCode, ShipCountry FROM orders LEFT JOIN order_details ON Orders.OrderID = Order_Details.OrderID where orders.ShippedDate > Cast('1996-07-29' as TIMESTAMP) ;
select c.CategoryName as Product_Category, case when s.Country in ('UK','Spain','Sweden','Germany','Norway', 'Denmark','Netherlands','Finland','Italy','France') then 'Europe' when s.Country in ('USA','Canada','Brazil') then 'America' else 'Asia-Pacific' end as Supplier_Continent, sum(p.UnitsInStock) as UnitsInStock from Suppliers s inner join Products p on p.SupplierID=s.SupplierID inner join Categories c on c.CategoryID=p.CategoryID where s.Country IN ('USA','UK') group by c.CategoryName, case when s.Country in ('UK','Spain','Sweden','Germany','Norway', 'Denmark','Netherlands','Finland','Italy','France') then 'Europe' when s.Country in ('USA','Canada','Brazil') then 'America' else 'Asia-Pacific' end ;
select c.CategoryName as Product_Category, case when s.Country in ('UK','Spain','Sweden','Germany','Norway', 'Denmark','Netherlands','Finland','Italy','France') then 'Europe' when s.Country in ('USA','Canada','Brazil') then 'America' else 'Asia-Pacific' end as Supplier_Continent, sum(p.UnitsInStock) as UnitsInStock from Suppliers s inner join Products p on p.SupplierID=s.SupplierID inner join Categories c on c.CategoryID=p.CategoryID where s.Country IN ('Canada','France') group by c.CategoryName, case when s.Country in ('UK','Spain','Sweden','Germany','Norway', 'Denmark','Netherlands','Finland','Italy','France') then 'Europe' when s.Country in ('USA','Canada','Brazil') then 'America' else 'Asia-Pacific' end ;
select CategoryName, format_number(sum(ProductSales), 2) as CategorySales from ( select distinct a.CategoryName, b.ProductName, format_number(sum(c.UnitPrice * c.Quantity * (1 - c.Discount)), 2) as ProductSales, concat('Qtr ', quarter(d.ShippedDate)) as ShippedQuarter from Categories as a inner join Products as b on a.CategoryID = b.CategoryID inner join Order_Details as c on b.ProductID = c.ProductID inner join Orders as d on d.OrderID = c.OrderID where d.ShippedDate > Cast('1996-12-01' as TIMESTAMP) and d.ShippedDate < Cast('1997-07-10' as TIMESTAMP) group by a.CategoryName, b.ProductName, concat('Qtr ', quarter(d.ShippedDate)) order by a.CategoryName, b.ProductName, ShippedQuarter ) as x group by CategoryName order by CategoryName ;
select CategoryName, format_number(sum(ProductSales), 2) as CategorySales from ( select distinct a.CategoryName, b.ProductName, format_number(sum(c.UnitPrice * c.Quantity * (1 - c.Discount)), 2) as ProductSales, concat('Qtr ', quarter(d.ShippedDate)) as ShippedQuarter from Categories as a inner join Products as b on a.CategoryID = b.CategoryID inner join Order_Details as c on b.ProductID = c.ProductID inner join Orders as d on d.OrderID = c.OrderID where d.ShippedDate < Cast('1998-01-01' as TIMESTAMP) and d.ShippedDate > Cast('1996-07-29' as TIMESTAMP) group by a.CategoryName, b.ProductName, concat('Qtr ', quarter(d.ShippedDate)) order by a.CategoryName, b.ProductName, ShippedQuarter ) as x group by CategoryName order by CategoryName ;
select CategoryName, format_number(sum(ProductSales), 2) as CategorySales from ( select distinct a.CategoryName, b.ProductName, format_number(sum(c.UnitPrice * c.Quantity * (1 - c.Discount)), 2) as ProductSales, concat('Qtr ', quarter(d.ShippedDate)) as ShippedQuarter from Categories as a inner join Products as b on a.CategoryID = b.CategoryID inner join Order_Details as c on b.ProductID = c.ProductID inner join Orders as d on d.OrderID = c.OrderID where d.ShippedDate < Cast('1998-12-01' as TIMESTAMP) and d.ShippedDate > Cast('1996-07-10' as TIMESTAMP) group by a.CategoryName, b.ProductName, concat('Qtr ', quarter(d.ShippedDate)) order by a.CategoryName, b.ProductName, ShippedQuarter ) as x group by CategoryName order by CategoryName ; | the_stack |
insert into concept_stage
select *
from basic_concept_stage
where concept_code not in (select concept_code from concept_stage)
;
-- delete from basic_con_rel_stage where invalid_reason is not null
;
insert into concept_relationship_stage select * from basic_con_rel_stage
;
/*
delete from concept_stage a
using concept_stage b
WHERE
a.ctid < b.ctid
AND a.concept_code = b.concept_code
;
delete from concept_stage a
using concept_stage b
where
a.concept_name is null and
b.concept_name is not null and
a.concept_code = b.concept_code
;*/
;
delete from concept_stage a
where a.concept_name is null
;
drop table if exists insulins;
create table insulins
(
drug_code varchar,
drug_concept_name varchar,
gemscript_code varchar,
concept_id int4,
concept_name varchar
)
;
/*WbImport -file=/home/ekorchmar/Downloads/NN_map_full_prdcode.txt
-type=text
-table=insulins
-encoding="UTF-8"
-header=true
-decode=false
-dateFormat="yyyy-MM-dd"
-timestampFormat="yyyy-MM-dd HH:mm:ss"
-delimiter='\t'
-quotechar='"'
-decimal=.
-fileColumns=drug_code,drug_concept_name,gemscript_code,concept_id,concept_name
-quoteCharEscaping=none
-ignoreIdentityColumns=false
-deleteTarget=true
-continueOnError=false
-batchSize=100*/
;
/*--preserve nn_patch
insert into insulins
select distinct
null :: int4, --don't mix cprd & thin codes
n.source_name as concept_name,
lpad (c.concept_code,8,'0'),
n.concept_id_2,
null :: varchar
from nn_patch n
join concept c on
n.concept_id_1 = c.concept_id and
n.concept_id_1 != 0 and
c.concept_id is null and
-- c.standard_concept = 'S' and
--avoid dupes
not exists
(
select
from insulins
where
lpad (gemscript_code,8,'0') = lpad (c.concept_code,8,'0')
)
;*/
--deprecate all old relations of concept_id = 0
insert into concept_relationship_stage
select distinct
null :: int4,
null :: int4,
c.concept_code,
c2.concept_code,
'Gemscript',
c2.vocabulary_id,
'Maps to',
r.valid_start_date,
current_date - 1,
'D'
from concept c
join insulins i on
c.vocabulary_id = 'Gemscript' and
c.concept_code = lpad (i.gemscript_code,8,'0') and
i.concept_id = 0
join concept_relationship r on
r.concept_id_1 = c.concept_id and
relationship_id = 'Maps to' and
r.invalid_reason is null
join concept c2 on
c2.concept_id = r.concept_id_2
;
--not device, intentionally left unmapped
delete from concept_relationship_stage where concept_code_1 in (select gemscript_code from insulins where concept_id = 0) and concept_code_1 != concept_code_2 and invalid_reason is null
;
--fix deprecated
-- update insulins set concept_id = 19094121 where drug_code = '60951';
-- update insulins set concept_id = 19078603 where drug_code = '7300'
;
drop table if exists manual_rel
;
create table manual_rel as
select
lpad (i.gemscript_code,8,'0') as concept_code_1,
'Gemscript' as vocabulary_id_1,
c.concept_code as concept_code_2,
c.vocabulary_id as vocabulary_id_2
from insulins i
join concept c on
c.concept_id = i.concept_id
where c.domain_id = 'Drug'
;/*
--manual fix for 1 influenza vaccine: should be fixed with future dm+d update
insert into manual_rel
values
(
'81761021',
'Gemscript',
'141',
'CVX'
)
;*/
;
insert into manual_rel
with source_to_code as
(
select
source_code,
unnest(string_to_array(old_code_agg, '-')) as code
from manual_2020
),
source_to_concept as
(
select
source_code,
c.concept_code,
c.vocabulary_id
from source_to_code
left join concept c on
c.vocabulary_id ~ '^RxN' and
c.concept_code = code
)
select
source_code,
'Gemscript',
concept_code,
vocabulary_id
from source_to_concept
where
(
source_code,
'Gemscript',
concept_code,
vocabulary_id
)
not in
(select * from manual_rel)
;
delete from concept_relationship_stage where concept_code_1 in (select concept_code_1 from manual_rel)
;
insert into concept_relationship_stage
(
concept_code_1,
vocabulary_id_1,
concept_code_2,
vocabulary_id_2,
relationship_id,
valid_start_date,
valid_end_date
)
select
concept_code_1,
vocabulary_id_1,
concept_code_2,
vocabulary_id_2,
'Maps to',
CURRENT_DATE,
to_date('20991231', 'yyyymmdd')
from manual_rel
;
update concept_stage
set standard_concept = 'S'
where
domain_id = 'Device'
and concept_code not in (select concept_code_1 from concept_relationship_stage where vocabulary_id_2 in ('dm+d','SNOMED') and invalid_reason is null)
;
-- Working with replacement mappings
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.CheckReplacementMappings();
END $_$;
-- Deprecate 'Maps to' mappings to deprecated and upgraded concepts
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.DeprecateWrongMAPSTO();
END $_$;
-- Add mapping from deprecated to fresh concepts
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.AddFreshMAPSTO();
END $_$;
-- Delete ambiguous 'Maps to' mappings
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.DeleteAmbiguousMAPSTO();
END $_$;
/*
--manualy deprecate
insert into concept_relationship_stage
(
concept_code_1,
vocabulary_id_1,
concept_code_2,
vocabulary_id_2,
relationship_id,
valid_start_date,
valid_end_date,
invalid_reason
)
values
(
'63790020',
'Gemscript',
'OMOP3095547',
'RxNorm Extension',
'Maps to',
to_date ('2017-08-02', 'yyyy-mm-dd'),
current_date - 1,
'D'
)
;*/
--we don't need dose form concepts
delete from concept_stage where concept_class_id = 'Dose Form'
;
--Checked: dose forms exclusively
delete from concept_relationship_stage where concept_code_1 not in (select concept_code from concept_stage)
;
--for new vaccine and device mappings, since old mappings to RxN* are not deprecated automatically
insert into concept_relationship_stage
select distinct
null :: int4,
null :: int4,
c.concept_code,
c2.concept_code,
'Gemscript',
c2.vocabulary_id,
'Maps to',
r.valid_start_date,
current_date - 1,
'D'
from concept_relationship r
join concept c on
c.concept_id = r.concept_id_1 and
c.vocabulary_id = 'Gemscript' and
r.relationship_id = 'Maps to' and
r.invalid_reason is null
join concept c2 on
c2.concept_id = r.concept_id_2 and
c2.vocabulary_id like 'RxN%'
join concept_relationship_stage t on
c.concept_code = t.concept_code_1 and
t.vocabulary_id_2 not like 'RxN%'
where (c.concept_code, c2.concept_code) not in (select concept_code_1, concept_code_2 from concept_relationship_stage)
;
--if there is a mapping to gemscript (where from?) and any other vocab, deprecate it
/*
update concept_relationship_stage x
set
invalid_reason = 'D',
valid_end_date = current_date - 1 */
--delete it entirely
delete from concept_relationship_stage x
where
invalid_reason is null and
vocabulary_id_2 = 'Gemscript' and
x.concept_code_1 in
(
select concept_code_1
from concept_relationship_stage
where
invalid_reason is null and
vocabulary_id_2 != 'Gemscript'
)
;
delete from concept_relationship_stage x
where
x.invalid_reason is null and
x.vocabulary_id_2 like 'RxN%' and
x.relationship_id = 'Maps to' and
exists
(
select
from concept_relationship_stage y
where
x.concept_code_1 = y.concept_code_1 and
y.invalid_reason is null and
y.relationship_id = 'Maps to' and
y.vocabulary_id_2 not like 'RxN%' and
y.vocabulary_id_2 != 'Gemscript' --not inside itself
)
;
--there are old concept codes that are less than 8 characters in length
--we just deprecate them and their existing mappings
with concept_set as
(
select concept_code, concept_id
from concept
where
vocabulary_id = 'Gemscript' and
length (concept_code) < 8
)
insert into concept_relationship_stage
select
null :: int4,
null :: int4,
c.concept_code,
g.concept_code,
'Gemscript',
g.vocabulary_id,
r.relationship_id,
r.valid_start_date as valid_start_date,
current_date - 1 as valid_end_date,
'D'
from concept_set c
join concept_relationship r on
c.concept_id = r.concept_id_1
join concept g on
g.concept_id = r.concept_id_2 and
r.invalid_reason is null
;
--deprecate concepts too
with concept_set as
(
select *
from concept
where
vocabulary_id = 'Gemscript' and
length (concept_code) < 8
)
insert into concept_stage
select distinct
null :: int4 as concept_id,
c.concept_name,
c.domain_id,
c.vocabulary_id,
c.concept_class_id,
null ::varchar as standard_concept,
c.concept_code,
c.valid_start_date,
current_date - 1 as valid_end_date,
'D' as invalid_reason
from concept_set c
;
--if there is a duplicate relationship inside a vocabulary, remove it
delete from concept_relationship_stage x
where
x.invalid_reason is not null and
exists
(
select
from concept_relationship_stage y
where
(y.concept_code_1,y.concept_code_2,y.vocabulary_id_1,y.vocabulary_id_2) = (x.concept_code_1,x.concept_code_2,x.vocabulary_id_1,x.vocabulary_id_2) and
y.invalid_reason is null
)
;
-- if there is a mapping to SNOMED, remove other maps to
delete from concept_relationship_stage x
where
x.vocabulary_id_2 != 'SNOMED' and
x.relationship_id = 'Maps to' and
exists
(
select
from concept_relationship_stage y
where
(y.concept_code_1,y.vocabulary_id_1) = (x.concept_code_1,x.vocabulary_id_1) and
y.invalid_reason is null and
y.vocabulary_id_2 = 'SNOMED' and
y.relationship_id = 'Maps to'
)
;
-- if there is a mapping to CVX in crs, manually deprecate other maps to
insert into concept_relationship_stage
select
null :: int4,
null :: int4,
crs.concept_code_1,
t.concept_code,
crs.vocabulary_id_1,
t.vocabulary_id,
r.relationship_id,
r.valid_start_date,
current_date - 1,
'D' as invalid_reason
from concept_relationship_stage crs
join concept x on
crs.concept_code_1 = x.concept_code and
crs.vocabulary_id_1 = x.vocabulary_id
join concept_relationship r on
r.invalid_reason is null and
r.relationship_id = 'Maps to' and
x.concept_id = r.concept_id_1
join concept t on
t.vocabulary_id != 'CVX' and
t.concept_id = r.concept_id_2
where
crs.vocabulary_id_2 = 'CVX' and
crs.relationship_id = 'Maps to' and
crs.invalid_reason is null and
not exists
(
select
from concept_relationship_stage y
where
(y.concept_code_1, y.concept_code_2, y.vocabulary_id_1, y.vocabulary_id_2) = (crs.concept_code_1, t.concept_code, crs.vocabulary_id_1, t.vocabulary_id)
)
;
--no standard concepts can have mappings to other vocabs
update concept_stage
set standard_concept = null
where
concept_code in (select concept_code_1 from concept_relationship_stage where invalid_reason is null and relationship_id = 'Maps to' and vocabulary_id_2 != 'Gemscript') and
standard_concept is not null
;
-- Working with replacement mappings
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.CheckReplacementMappings();
end; $_$;
-- Deprecate 'Maps to' mappings to deprecated and upgraded concepts
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.DeprecateWrongMAPSTO();
end; $_$;
-- Add mapping from deprecated to fresh concepts, and also from non-standard to standard concepts
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.AddFreshMAPSTO();
end; $_$;
;
analyze concept_relationship_stage
;
-- Delete ambiguous 'Maps to' mappings
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.DeleteAmbiguousMAPSTO();
end; $_$;
--deprecated relationships are meaningless if they never existed in the first place
-- explain
delete from concept_relationship_stage c
where
c.invalid_reason is not null and
c.relationship_id = 'Maps to' and
(c.concept_code_1, c.concept_code_2, c.vocabulary_id_1, c.vocabulary_id_2) not in
(
select c1.concept_code, c2.concept_code, c1.vocabulary_id, c2.vocabulary_id
from concept_relationship r
join concept c1 on c1.concept_id = r.concept_id_1 and r.invalid_reason is null and r.relationship_id = 'Maps to' and c1.vocabulary_id = 'Gemscript'
join concept c2 on c2.concept_id = r.concept_id_2
)
;
--if Gemscript device remains standard, restore a mapping to it from THIN
-- explain
insert into concept_relationship_stage
select distinct
null :: int4,
null :: int4,
cs.concept_code,
tc.concept_code,
cs.vocabulary_id,
tc.vocabulary_id,
'Maps to',
m.valid_start_date,
m.valid_end_date,
null :: varchar as invalid_reason
from concept_stage cs
join thin_gemsc_dmd t on
cs.concept_class_id = 'Gemscript THIN' and
cs.concept_code = t.encrypted_drugcode
join concept_stage tc on
tc.concept_code = t.gemscript_drugcode and
tc.domain_id = 'Device' and
tc.vocabulary_id = 'Gemscript'
join concept_relationship_stage m on -- has mapping to itself ergo standard
m.concept_code_1 = tc.concept_code and
m.concept_code_2 = tc.concept_code and
m.vocabulary_id_1 = 'Gemscript' and
m.vocabulary_id_2 = 'Gemscript'
where
not exists
(
select
from concept_relationship_stage
where
(concept_code_1, concept_code_2, vocabulary_id_1, vocabulary_id_2) = (cs.concept_code,tc.concept_code,cs.vocabulary_id,tc.vocabulary_id)
) and
cs.concept_code not in (select concept_code_1 from concept_relationship_stage where invalid_reason is null)
;
--fix domains (mapping target sets for mapping source)
update concept_stage s
set domain_id =
(
select distinct c2.domain_id
from concept_relationship_stage r
join concept_stage c1 on (c1.concept_code, c1.vocabulary_id) = (r.concept_code_1, r.vocabulary_id_1)
join concept_stage c2 on (c2.concept_code, c2.vocabulary_id) = (r.concept_code_2, r.vocabulary_id_2) and c1.domain_id != c2.domain_id
where c1.concept_code = s.concept_code
)
where concept_code in
(
select c1.concept_code
from concept_relationship_stage r
join concept_stage c1 on (c1.concept_code, c1.vocabulary_id) = (r.concept_code_1, r.vocabulary_id_1)
join concept_stage c2 on (c2.concept_code, c2.vocabulary_id) = (r.concept_code_2, r.vocabulary_id_2) and c1.domain_id != c2.domain_id
)
;
--likewise, restore mapping for THIN concepts after thin_need_to_map
-- explain
insert into concept_relationship_stage
select distinct
null :: int4,
null :: int4,
cs.concept_code,
m.concept_code_2,
cs.vocabulary_id,
m.vocabulary_id_2,
'Maps to',
m.valid_start_date,
m.valid_end_date,
null :: varchar as invalid_reason
from concept_stage cs
join thin_gemsc_dmd t on
cs.concept_class_id = 'Gemscript THIN' and
cs.concept_code = t.encrypted_drugcode
join concept_stage tc on
tc.concept_code = t.gemscript_drugcode and
tc.vocabulary_id = 'Gemscript'
join concept_relationship_stage m on -- has mapping to standard
m.concept_code_1 = tc.concept_code and
m.invalid_reason is null and
m.relationship_id = 'Maps to' and
m.vocabulary_id_2 in ('RxNorm', 'RxNorm Extension', 'dm+d', 'SNOMED')
where
not exists
(
select
from concept_relationship_stage
where
(concept_code_1, concept_code_2, vocabulary_id_1, vocabulary_id_2) = (cs.concept_code,m.concept_code_2,cs.vocabulary_id,m.vocabulary_id_2)
) and
cs.concept_code not in (select concept_code_1 from concept_relationship_stage where invalid_reason is null)
;
delete from concept_stage where concept_name = concept_code --bug
;
--mapping to gemscript and another vocab? deprecate to gemscript
update concept_relationship_stage x
set
invalid_reason = 'D',
valid_end_date = current_date - 1
where
invalid_reason is null and
vocabulary_id_2 = 'Gemscript' and
x.concept_code_1 in
(
select concept_code_1
from concept_relationship_stage
where
invalid_reason is null and
vocabulary_id_2 != 'Gemscript'
)
;
update concept_stage s
set domain_id =
(
select distinct c2.domain_id
from concept_relationship_stage r
join concept_stage c1 on (c1.concept_code, c1.vocabulary_id) = (r.concept_code_1, r.vocabulary_id_1)
join concept c2 on (c2.concept_code, c2.vocabulary_id) = (r.concept_code_2, r.vocabulary_id_2) and c1.domain_id != c2.domain_id
where c1.concept_code = s.concept_code
)
where concept_code in
(
select c1.concept_code
from concept_relationship_stage r
join concept_stage c1 on (c1.concept_code, c1.vocabulary_id) = (r.concept_code_1, r.vocabulary_id_1)
join concept c2 on (c2.concept_code, c2.vocabulary_id) = (r.concept_code_2, r.vocabulary_id_2) and c1.domain_id != c2.domain_id
)
;
delete from concept_relationship_stage where
relationship_id = 'Maps to' and
vocabulary_id_2 = 'Gemscript' and
invalid_reason is null and
concept_code_2 in
(
select concept_code
from concept_stage
where domain_id = 'Drug'
)
;
update concept_stage
set standard_concept = null
where domain_id = 'Drug'
;
create index if not exists idx_crs_targets on concept_relationship_stage (concept_code_2, vocabulary_id_2)
;
analyze concept_relationship_stage
;
delete from concept_relationship_stage r1
where
exists
(
select
from concept c1
join concept_ancestor ca on
ca.ancestor_concept_id = c1.concept_id and
-- ca.min_levels_of_separation > 0 and
(c1.concept_code, c1.vocabulary_id) = (r1.concept_code_2, r1.vocabulary_id_2)
join concept c2 on
c2.concept_id = ca.descendant_concept_id
join concept_relationship_stage r2 on
(r1.concept_code_1) = (r2.concept_code_1) and
(r2.concept_code_2, r2.vocabulary_id_2) != (r1.concept_code_2, r1.vocabulary_id_2) and
(c2.concept_code, c2.vocabulary_id) = (r2.concept_code_2, r2.vocabulary_id_2) and
r2.invalid_reason is null
)
-- and r1.vocabulary_id_2 in ('RxNorm', 'RxNorm Extension')
and r1.invalid_reason is null
;
update concept_stage set concept_name = trim (concept_name)
;
update concept_relationship_stage
set invalid_reason = null,
valid_end_date = to_date ('20991231','yyyymmdd')
where valid_start_date > valid_end_date
;
delete from concept_relationship_stage where concept_code_2 is null
;
insert into concept_relationship_stage (concept_code_1,concept_code_2,vocabulary_id_1,vocabulary_id_2,relationship_id,valid_start_date,valid_end_date)
values
('35204020','OMOP4742295','Gemscript','RxNorm Extension','Maps to','2020-08-01','2099-12-31'),
('42961021','OMOP2784462','Gemscript','RxNorm Extension','Maps to','2020-08-01','2099-12-31'),
('63784020','OMOP552650','Gemscript','RxNorm Extension','Maps to','2020-08-01','2099-12-31'),
('63787020','1360482','Gemscript','RxNorm','Maps to','2020-08-01','2099-12-31'),
('09790020','OMOP302708','Gemscript','RxNorm Extension','Maps to','2020-08-01','2099-12-31'),
('13628020','OMOP2781193','Gemscript','RxNorm Extension','Maps to','2020-08-01','2099-12-31'),
('98505998','343099','Gemscript','RxNorm','Maps to','2020-08-01','2099-12-31'),
('53971020','343099','Gemscript','RxNorm','Maps to','2020-08-01','2099-12-31'),
('60642021','OMOP319607','Gemscript','RxNorm Extension','Maps to','2020-08-01','2099-12-31'),
('09794020','OMOP2782332','Gemscript','RxNorm Extension','Maps to','2020-08-01','2099-12-31'),
('09796020','OMOP2610438','Gemscript','RxNorm Extension','Maps to','2020-08-01','2099-12-31'),
('60643021','OMOP319607','Gemscript','RxNorm Extension','Maps to','2020-08-01','2099-12-31')
;
update concept_relationship_stage
set vocabulary_id_2 = 'CVX', concept_code_2 = '129'
where concept_code_1 in ('88913998', '84802020')
;
insert into concept_relationship_stage (concept_code_1,concept_code_2,vocabulary_id_1,vocabulary_id_2,relationship_id,valid_start_date,valid_end_date)
values
('89503021','141','Gemscript','CVX','Maps to','2020-08-01','2099-12-31'),
('83346021','141','Gemscript','CVX','Maps to','2020-08-01','2099-12-31'),
('85480021','141','Gemscript','CVX','Maps to','2020-08-01','2099-12-31')
;
update concept_stage s
set standard_concept = 'S',
domain_id = 'Device'
where domain_id = 'Drug' and
concept_code not in (select concept_code_1 from concept_relationship_stage where invalid_reason is null and concept_code_1 = s.concept_code) and
exists
(
select 1
from devv5.concept
where
domain_id = 'Device' and
vocabulary_id = 'Gemscript' and
concept_code = s.concept_code
)
;
update concept_relationship_stage set
concept_code_2 = '378923' and
vocabulary_id_2 = 'RxNorm'
where concept_code_1 in ('98222998','55101020') | the_stack |
;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
SET NAMES utf8mb4;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table t_address_key
# ------------------------------------------------------------
CREATE TABLE `t_address_key` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`symbol` varchar(128) NOT NULL COMMENT '币种',
`address` varchar(64) NOT NULL COMMENT '地址',
`pwd` varchar(512) NOT NULL COMMENT '加密私钥',
`use_tag` int(11) NOT NULL DEFAULT '0' COMMENT '占用标志
-1 作为热钱包占用\n0 未占用\n>0 作为用户冲币地址占用',
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
UNIQUE KEY `t_address_key_address_idx` (`address`,`symbol`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_app_config_int
# ------------------------------------------------------------
CREATE TABLE `t_app_config_int` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`k` varchar(64) NOT NULL DEFAULT '' COMMENT '配置键名',
`v` bigint(20) NOT NULL COMMENT '配置键值',
PRIMARY KEY (`id`),
UNIQUE KEY `k` (`k`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_app_config_str
# ------------------------------------------------------------
CREATE TABLE `t_app_config_str` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`k` varchar(64) NOT NULL DEFAULT '' COMMENT '配置键名',
`v` varchar(1024) NOT NULL COMMENT '配置键值',
PRIMARY KEY (`id`),
UNIQUE KEY `k` (`k`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_app_config_token
# ------------------------------------------------------------
CREATE TABLE `t_app_config_token` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`token_address` varchar(128) NOT NULL DEFAULT '',
`token_decimals` int(11) unsigned NOT NULL,
`token_symbol` varchar(128) NOT NULL,
`cold_address` varchar(128) NOT NULL DEFAULT '',
`hot_address` varchar(128) NOT NULL DEFAULT '',
`org_min_balance` varchar(128) NOT NULL DEFAULT '0',
`create_time` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `token_address` (`token_address`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_app_config_token_btc
# ------------------------------------------------------------
CREATE TABLE `t_app_config_token_btc` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`token_index` int(11) unsigned NOT NULL,
`token_symbol` varchar(128) NOT NULL DEFAULT '',
`cold_address` varchar(128) NOT NULL DEFAULT '',
`hot_address` varchar(128) NOT NULL DEFAULT '',
`fee_address` varchar(128) NOT NULL,
`tx_org_min_balance` varchar(128) NOT NULL DEFAULT '',
`create_at` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `token_symbol` (`token_symbol`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_app_lock
# ------------------------------------------------------------
CREATE TABLE `t_app_lock` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`k` varchar(64) NOT NULL DEFAULT '' COMMENT '上锁键值',
`v` tinyint(2) NOT NULL COMMENT '是否锁定',
`create_time` bigint(20) unsigned NOT NULL COMMENT '上锁时间',
PRIMARY KEY (`id`),
UNIQUE KEY `k_2` (`k`),
KEY `k` (`k`,`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_app_status_int
# ------------------------------------------------------------
CREATE TABLE `t_app_status_int` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`k` varchar(64) NOT NULL DEFAULT '' COMMENT '配置键名',
`v` bigint(20) NOT NULL COMMENT '配置键值',
PRIMARY KEY (`id`),
UNIQUE KEY `k` (`k`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_product
# ------------------------------------------------------------
CREATE TABLE `t_product` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`app_name` varchar(128) NOT NULL DEFAULT '' COMMENT '应用名',
`app_sk` varchar(64) NOT NULL DEFAULT '' COMMENT '应用私钥',
`cb_url` varchar(512) NOT NULL COMMENT '回调地址',
`whitelist_ip` varchar(1024) NOT NULL DEFAULT '' COMMENT 'ip白名单',
PRIMARY KEY (`id`),
UNIQUE KEY `app_name` (`app_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_product_nonce
# ------------------------------------------------------------
CREATE TABLE `t_product_nonce` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`c` varchar(128) NOT NULL DEFAULT '',
`create_time` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `c` (`c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_product_notify
# ------------------------------------------------------------
CREATE TABLE `t_product_notify` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`nonce` varchar(128) NOT NULL DEFAULT '',
`product_id` int(11) NOT NULL,
`item_type` int(11) NOT NULL,
`item_id` int(11) NOT NULL,
`notify_type` int(11) NOT NULL,
`token_symbol` varchar(128) NOT NULL,
`url` varchar(512) NOT NULL DEFAULT '',
`msg` varchar(4089) NOT NULL,
`handle_status` int(11) NOT NULL,
`handle_msg` varchar(512) NOT NULL,
`create_time` bigint(20) unsigned NOT NULL,
`update_time` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `product_id` (`product_id`,`item_type`,`item_id`,`notify_type`,`token_symbol`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_send
# ------------------------------------------------------------
CREATE TABLE `t_send` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`related_type` tinyint(4) NOT NULL COMMENT '关联类型 1 零钱整理 2 提币',
`related_id` int(11) unsigned NOT NULL COMMENT '关联id',
`token_id` int(11) unsigned NOT NULL,
`tx_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'tx hash',
`from_address` varchar(128) NOT NULL DEFAULT '' COMMENT '打币地址',
`to_address` varchar(128) NOT NULL COMMENT '收币地址',
`balance_real` varchar(128) NOT NULL COMMENT '打币金额 Ether',
`gas` bigint(20) NOT NULL COMMENT 'gas消耗',
`gas_price` bigint(20) NOT NULL COMMENT 'gasPrice',
`nonce` int(11) NOT NULL COMMENT 'nonce',
`hex` varchar(2048) NOT NULL COMMENT 'tx raw hex',
`create_time` bigint(20) NOT NULL COMMENT '创建时间',
`handle_status` tinyint(4) NOT NULL COMMENT '处理状态',
`handle_msg` varchar(1024) NOT NULL DEFAULT '' COMMENT '处理消息',
`handle_time` bigint(20) NOT NULL COMMENT '处理时间',
PRIMARY KEY (`id`),
UNIQUE KEY `related_id` (`related_id`,`related_type`,`tx_id`) USING BTREE,
KEY `tx_id` (`tx_id`) USING BTREE,
KEY `t_send_from_address_idx` (`from_address`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_send_btc
# ------------------------------------------------------------
CREATE TABLE `t_send_btc` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`related_type` tinyint(4) NOT NULL COMMENT '关联类型 1 零钱整理 2 提币',
`related_id` int(11) unsigned NOT NULL COMMENT '关联id',
`token_id` int(11) unsigned NOT NULL,
`tx_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'tx hash',
`from_address` varchar(128) NOT NULL DEFAULT '' COMMENT '打币地址',
`to_address` varchar(128) NOT NULL COMMENT '收币地址',
`balance_real` varchar(128) NOT NULL COMMENT '打币金额 Ether',
`gas` bigint(20) NOT NULL COMMENT 'gas消耗',
`gas_price` bigint(20) NOT NULL COMMENT 'gasPrice',
`hex` mediumtext NOT NULL COMMENT 'tx raw hex',
`create_time` bigint(20) NOT NULL COMMENT '创建时间',
`handle_status` tinyint(4) NOT NULL COMMENT '处理状态',
`handle_msg` varchar(1024) NOT NULL DEFAULT '' COMMENT '处理消息',
`handle_time` bigint(20) NOT NULL COMMENT '处理时间',
PRIMARY KEY (`id`),
UNIQUE KEY `related_id` (`related_id`,`related_type`) USING BTREE,
KEY `tx_id` (`tx_id`) USING BTREE,
KEY `t_send_from_address_idx` (`from_address`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_send_eos
# ------------------------------------------------------------
CREATE TABLE `t_send_eos` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`withdraw_id` int(11) unsigned NOT NULL COMMENT '关联id',
`tx_hash` varchar(128) NOT NULL DEFAULT '' COMMENT 'tx hash',
`log_index` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'log_index',
`from_address` varchar(128) NOT NULL DEFAULT '' COMMENT '打币地址',
`to_address` varchar(128) NOT NULL COMMENT '收币地址',
`memo` varchar(256) NOT NULL COMMENT '收币地址',
`balance_real` varchar(128) NOT NULL COMMENT '打币金额 Ether',
`hex` varchar(2048) NOT NULL COMMENT 'tx raw hex',
`create_time` bigint(20) NOT NULL COMMENT '创建时间',
`handle_status` tinyint(4) NOT NULL COMMENT '处理状态',
`handle_msg` varchar(1024) NOT NULL DEFAULT '' COMMENT '处理消息',
`handle_at` bigint(20) NOT NULL COMMENT '处理时间',
PRIMARY KEY (`id`),
UNIQUE KEY `withdraw_id` (`withdraw_id`) USING BTREE,
KEY `tx_hash` (`tx_hash`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_tx
# ------------------------------------------------------------
CREATE TABLE `t_tx` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(11) unsigned NOT NULL,
`tx_id` varchar(128) NOT NULL DEFAULT '' COMMENT '交易id',
`from_address` varchar(128) NOT NULL DEFAULT '' COMMENT '来源地址',
`to_address` varchar(128) NOT NULL DEFAULT '' COMMENT '目标地址',
`balance_real` varchar(128) NOT NULL COMMENT '到账金额Ether',
`create_time` bigint(20) unsigned NOT NULL COMMENT '创建时间戳',
`handle_status` tinyint(4) NOT NULL COMMENT '处理状态',
`handle_msg` varchar(128) NOT NULL DEFAULT '' COMMENT '处理消息',
`handle_time` bigint(20) unsigned NOT NULL COMMENT '处理时间戳',
`org_status` tinyint(4) NOT NULL COMMENT '零钱整理状态',
`org_msg` varchar(128) NOT NULL COMMENT '零钱整理消息',
`org_time` bigint(20) unsigned NOT NULL COMMENT '零钱整理时间',
PRIMARY KEY (`id`),
UNIQUE KEY `tx_id` (`tx_id`),
KEY `t_tx_org_status_idx` (`org_status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_tx_btc
# ------------------------------------------------------------
CREATE TABLE `t_tx_btc` (
`id` bigint(22) unsigned NOT NULL AUTO_INCREMENT,
`product_id` bigint(22) unsigned NOT NULL,
`block_hash` varchar(128) NOT NULL DEFAULT '',
`tx_id` varchar(128) NOT NULL DEFAULT '',
`vout_n` int(11) NOT NULL,
`vout_address` varchar(128) NOT NULL DEFAULT '',
`vout_value` varchar(128) NOT NULL DEFAULT '',
`create_time` bigint(22) unsigned NOT NULL,
`handle_status` tinyint(4) NOT NULL,
`handle_msg` varchar(128) NOT NULL DEFAULT '',
`handle_time` bigint(22) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `tx_id` (`tx_id`,`vout_n`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_tx_btc_token
# ------------------------------------------------------------
CREATE TABLE `t_tx_btc_token` (
`id` bigint(22) unsigned NOT NULL AUTO_INCREMENT,
`product_id` bigint(22) unsigned NOT NULL,
`token_index` int(11) NOT NULL,
`token_symbol` varchar(128) NOT NULL,
`block_hash` varchar(128) NOT NULL DEFAULT '',
`tx_id` varchar(128) NOT NULL DEFAULT '',
`from_address` varchar(128) NOT NULL DEFAULT '',
`to_address` varchar(128) NOT NULL DEFAULT '',
`value` varchar(128) NOT NULL DEFAULT '',
`blocktime` bigint(20) NOT NULL,
`create_at` bigint(22) unsigned NOT NULL,
`handle_status` tinyint(4) NOT NULL,
`handle_msg` varchar(128) NOT NULL DEFAULT '',
`handle_at` bigint(22) unsigned NOT NULL,
`org_status` tinyint(4) NOT NULL,
`org_msg` varchar(128) NOT NULL,
`org_at` bigint(22) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `tx_id` (`tx_id`),
KEY `t_tx_btc_token_org_status_idx` (`org_status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_tx_btc_uxto
# ------------------------------------------------------------
CREATE TABLE `t_tx_btc_uxto` (
`id` bigint(22) unsigned NOT NULL AUTO_INCREMENT,
`uxto_type` tinyint(4) NOT NULL,
`block_hash` varchar(128) NOT NULL DEFAULT '',
`tx_id` varchar(128) NOT NULL DEFAULT '',
`vout_n` int(11) NOT NULL,
`vout_address` varchar(128) NOT NULL DEFAULT '',
`vout_value` varchar(128) NOT NULL DEFAULT '',
`vout_script` varchar(256) NOT NULL,
`create_time` bigint(22) unsigned NOT NULL,
`spend_tx_id` varchar(128) NOT NULL DEFAULT '',
`spend_n` int(11) NOT NULL,
`handle_status` tinyint(4) NOT NULL,
`handle_msg` varchar(128) NOT NULL DEFAULT '',
`handle_time` bigint(22) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `tx_id` (`tx_id`,`vout_n`),
KEY `handle_status` (`handle_status`,`uxto_type`,`id`) USING BTREE,
KEY `t_tx_btc_uxto_vout_address_handle_status_uxto_type_idx` (`vout_address`,`handle_status`,`uxto_type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_tx_eos
# ------------------------------------------------------------
CREATE TABLE `t_tx_eos` (
`id` bigint(22) unsigned NOT NULL AUTO_INCREMENT,
`product_id` bigint(22) unsigned NOT NULL,
`tx_hash` varchar(128) NOT NULL DEFAULT '',
`log_index` bigint(20) unsigned NOT NULL,
`from_address` varchar(128) NOT NULL DEFAULT '',
`to_address` varchar(128) NOT NULL,
`memo` varchar(256) NOT NULL DEFAULT '',
`balance_real` varchar(128) NOT NULL DEFAULT '',
`create_at` bigint(22) unsigned NOT NULL,
`handle_status` tinyint(4) NOT NULL,
`handle_msg` varchar(128) NOT NULL DEFAULT '',
`handle_at` bigint(22) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `tx_hash` (`tx_hash`,`log_index`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_tx_erc20
# ------------------------------------------------------------
CREATE TABLE `t_tx_erc20` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`token_id` int(11) unsigned NOT NULL,
`product_id` int(11) unsigned NOT NULL,
`tx_id` varchar(128) NOT NULL DEFAULT '' COMMENT '交易id',
`from_address` varchar(128) NOT NULL DEFAULT '' COMMENT '来源地址',
`to_address` varchar(128) NOT NULL DEFAULT '' COMMENT '目标地址',
`balance_real` varchar(128) NOT NULL COMMENT '到账金额Ether',
`create_time` bigint(20) unsigned NOT NULL COMMENT '创建时间戳',
`handle_status` tinyint(4) NOT NULL COMMENT '处理状态',
`handle_msg` varchar(128) NOT NULL DEFAULT '' COMMENT '处理消息',
`handle_time` bigint(20) unsigned NOT NULL COMMENT '处理时间戳',
`org_status` tinyint(4) NOT NULL COMMENT '零钱整理状态',
`org_msg` varchar(128) NOT NULL COMMENT '零钱整理消息',
`org_time` bigint(20) unsigned NOT NULL COMMENT '零钱整理时间',
PRIMARY KEY (`id`),
UNIQUE KEY `tx_id` (`tx_id`),
KEY `t_tx_erc20_org_status_idx` (`org_status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table t_withdraw
# ------------------------------------------------------------
CREATE TABLE `t_withdraw` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(11) unsigned NOT NULL COMMENT '产品id',
`out_serial` varchar(64) NOT NULL DEFAULT '' COMMENT '提币唯一标示',
`to_address` varchar(128) NOT NULL DEFAULT '' COMMENT '提币地址',
`memo` varchar(256) NOT NULL DEFAULT '',
`symbol` varchar(128) NOT NULL,
`balance_real` varchar(128) NOT NULL DEFAULT '' COMMENT '提币金额',
`tx_hash` varchar(128) NOT NULL DEFAULT '' COMMENT '提币tx hash',
`create_time` bigint(20) unsigned NOT NULL COMMENT '创建时间',
`handle_status` int(11) NOT NULL COMMENT '处理状态',
`handle_msg` varchar(128) NOT NULL COMMENT '处理消息',
`handle_time` bigint(20) unsigned NOT NULL COMMENT '处理时间',
PRIMARY KEY (`id`),
UNIQUE KEY `out_serial` (`out_serial`,`product_id`) USING BTREE,
KEY `t_withdraw_tx_hash_idx` (`tx_hash`) USING BTREE,
KEY `t_withdraw_handle_status_symbol_idx` (`handle_status`,`symbol`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | the_stack |
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
/*PatientData table*/
IF exists(SELECT * FROM sys.objects where object_id = OBJECT_ID(N'[dbo].[PatientData]') and TYPE in (N'U'))
begin
DROP TABLE [dbo].[PatientData]
end
CREATE TABLE [dbo].[PatientData](
[FirstName] [nvarchar](50) NULL,
[MiddleName] [nvarchar](50) NULL,
[LastName] [nvarchar](50) NULL,
[eid] [int] NOT NULL,
[vdate] [date] NULL,
[rcount] [nvarchar](5) NOT NULL,
[gender] [nvarchar](1) NOT NULL,
[dialysisrenalendstage] [int] NOT NULL,
[asthma] [int] NOT NULL,
[irondef] [int] NOT NULL,
[pneum] [int] NOT NULL,
[substancedependence] [int] NOT NULL,
[psychologicaldisordermajor] [int] NOT NULL,
[depress] [int] NOT NULL,
[psychother] [int] NOT NULL,
[fibrosisandother] [int] NOT NULL,
[malnutrition] [int] NOT NULL,
[hemo] [int] NOT NULL,
[hematocrit] [float] NOT NULL,
[neutrophils] [float] NOT NULL,
[sodium] [float] NOT NULL,
[glucose] [float] NOT NULL,
[bloodureanitro] [float] NOT NULL,
[creatinine] [float] NOT NULL,
[bmi] [float] NOT NULL,
[pulse] [int] NOT NULL,
[respiration] [float] NOT NULL,
[secondarydiagnosisnonicd9] [int] NOT NULL,
[discharged] [date] NULL,
[facid] [nvarchar](1) NOT NULL,
[lengthofstay] [int] NULL,
CONSTRAINT PK_PatientData_eid PRIMARY KEY CLUSTERED (eid)
)
GO
IF exists(SELECT * FROM sys.objects where object_id = OBJECT_ID(N'[dbo].[MetaData_Facilities]') and TYPE in (N'U'))
begin
DROP TABLE [dbo].[MetaData_Facilities]
end
CREATE TABLE [dbo].[MetaData_Facilities](
[Capacity] [int] NOT NULL,
[Id] [nvarchar](50) NOT NULL,
[Name] [nvarchar](50) NOT NULL
)
GO
IF exists(SELECT * FROM sys.objects where object_id = OBJECT_ID(N'[dbo].[Train_Id]') and TYPE in (N'U'))
begin
DROP TABLE [dbo].[Train_Id]
end
CREATE TABLE [dbo].[Train_Id](
[eid] [int] NOT NULL
)
GO
/*Patient type hold select query result on PatientData to avoid repeat select to PatientData table*/
IF TYPE_ID('[dbo].[Patient]') IS NOT NULL
begin
DROP TYPE [dbo].[Patient]
end
CREATE TYPE [dbo].[Patient] AS TABLE(
[eid] [int] NULL,
[vdate] [date] NULL,
[lengthofstay] [int] NULL
)
GO
/*AdmitPatient Stored Procedure
* admit the patient if not already admitted
*/
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[AdmitPatient]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[AdmitPatient]
end
GO
/*DischargePatient Stored Procedure
* discharge the patient and update the lengthofstay with duration patient
* actually stayed in hospital.
*/
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[DischargePatient]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[DischargePatient]
end
GO
CREATE PROCEDURE [dbo].[DischargePatient]
@Eid INT,
@DischargeDate DATETIME,
@result INT OUTPUT
AS
BEGIN
DECLARE @patientAdmissionDate AS DATETIME;
DECLARE @patientDischargedDate AS DATETIME;
DECLARE @patient AS Patient;
DECLARE @lengthOfStay AS INT;
BEGIN TRY
BEGIN TRANSACTION;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
INSERT INTO @patient (eid, vdate, lengthofstay)
SELECT eid,
vdate,
lengthofstay
FROM PatientData
WHERE eid = @Eid;
IF EXISTS (SELECT *
FROM @patient
WHERE eid = @Eid)
BEGIN
SELECT @patientAdmissionDate = (SELECT vdate
FROM @patient);
SELECT @patientDischargedDate = (SELECT @DischargeDate);
SELECT @lengthOfStay = (SELECT DATEDIFF(DAY, @patientAdmissionDate, @patientDischargedDate));
UPDATE PatientData
SET discharged = @patientDischargedDate,
lengthofstay = @lengthOfStay
WHERE eid = @Eid;
SELECT @result = @Eid;
END
ELSE
BEGIN
SET @result = -1;
END
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
ROLLBACK;
SET @result = -200;
END CATCH
END
GO
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[compute_stats]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[compute_stats]
end
GO
CREATE PROCEDURE [dbo].[compute_stats] @input varchar(max) = 'LengthOfStay'
AS
BEGIN
-- Create an empty table that will store the Statistics.
DROP TABLE if exists [dbo].[Stats]
CREATE TABLE [dbo].[Stats](
[variable_name] [varchar](30) NOT NULL,
[type] [varchar](30) NOT NULL,
[mode] [varchar](30) NULL,
[mean] [float] NULL,
[std] [float] NULL
)
-- Get the names and variable types of the columns to analyze.
DECLARE @sql nvarchar(max);
SELECT @sql = N'
INSERT INTO Stats(variable_name, type)
SELECT *
FROM (SELECT COLUMN_NAME as variable_name, DATA_TYPE as type
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = ''' + @input + '''
AND COLUMN_NAME NOT IN (''eid'', ''lengthofstay'', ''vdate'', ''discharged'')) as t ';
EXEC sp_executesql @sql;
-- Loops to compute the Mode for categorical variables.
DECLARE @name1 NVARCHAR(100)
DECLARE @getname1 CURSOR
SET @getname1 = CURSOR FOR
SELECT variable_name FROM [dbo].[Stats] WHERE type IN('varchar', 'nvarchar', 'int')
OPEN @getname1
FETCH NEXT
FROM @getname1 INTO @name1
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @sql1 nvarchar(max);
SELECT @sql1 = N'
UPDATE Stats
SET Stats.mode = T.mode
FROM (SELECT TOP(1) ' + @name1 + ' as mode, count(*) as cnt
FROM ' + @input + '
GROUP BY ' + @name1 + '
ORDER BY cnt desc) as T
WHERE Stats.variable_name = ''' + @name1 + '''';
EXEC sp_executesql @sql1;
FETCH NEXT
FROM @getname1 INTO @name1
END
CLOSE @getname1
DEALLOCATE @getname1
-- Loops to compute the Mean and Standard Deviation for continuous variables.
DECLARE @name2 NVARCHAR(100)
DECLARE @getname2 CURSOR
SET @getname2 = CURSOR FOR
SELECT variable_name FROM [dbo].[Stats] WHERE type IN('float')
OPEN @getname2
FETCH NEXT
FROM @getname2 INTO @name2
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @sql2 nvarchar(max);
SELECT @sql2 = N'
UPDATE Stats
SET Stats.mean = T.mean,
Stats.std = T.std
FROM (SELECT AVG(' + @name2 + ') as mean, STDEV(' + @name2 + ') as std
FROM ' + @input + ') as T
WHERE Stats.variable_name = ''' + @name2 + '''';
EXEC sp_executesql @sql2;
FETCH NEXT
FROM @getname2 INTO @name2
END
CLOSE @getname2
DEALLOCATE @getname2
END
GO
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[evaluate]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[evaluate]
end
GO
CREATE PROCEDURE [dbo].[evaluate] @model_name varchar(20),
@predictions_table varchar(max)
AS
BEGIN
-- Create an empty table to be filled with the Metrics.
IF NOT EXISTS (SELECT * FROM sysobjects WHERE name = 'Metrics' AND xtype = 'U')
CREATE TABLE [dbo].[Metrics](
[model_name] [varchar](30) NOT NULL,
[mean_absolute_error] [float] NULL,
[root_mean_squared_error] [float] NULL,
[relative_absolute_error] [float] NULL,
[relative_squared_error] [float] NULL,
[coefficient_of_determination] [float] NULL
)
-- Import the Predictions Table as an input to the R code, and get the current database name.
DECLARE @inquery nvarchar(max) = N' SELECT * FROM ' + @predictions_table
DECLARE @database_name varchar(max) = db_name();
INSERT INTO Metrics
EXECUTE sp_execute_external_script @language = N'R',
@script = N'
##########################################################################################################################################
## Define the connection string
##########################################################################################################################################
connection_string <- paste("Driver=SQL Server;Server=localhost;Database=", database_name, ";Trusted_Connection=true;", sep="")
##########################################################################################################################################
## Model evaluation metrics.
##########################################################################################################################################
evaluate_model <- function(observed, predicted, model) {
mean_observed <- mean(observed)
se <- (observed - predicted)^2
ae <- abs(observed - predicted)
sem <- (observed - mean_observed)^2
aem <- abs(observed - mean_observed)
mae <- mean(ae)
rmse <- sqrt(mean(se))
rae <- sum(ae) / sum(aem)
rse <- sum(se) / sum(sem)
rsq <- 1 - rse
metrics <- c(model, mae, rmse, rae, rse, rsq)
print(model)
print("Summary statistics of the absolute error")
print(summary(abs(observed-predicted)))
return(metrics)
}
##########################################################################################################################################
## Random forest Evaluation
##########################################################################################################################################
if(model_name == "RF"){
OutputDataSet <- data.frame(rbind(evaluate_model(observed = InputDataSet$lengthofstay,
predicted = InputDataSet$lengthofstay_Pred,
model = "Random Forest (rxDForest)")))
}
##########################################################################################################################################
## Boosted tree Evaluation.
##########################################################################################################################################
if(model_name == "GBT"){
library("MicrosoftML")
OutputDataSet <- data.frame(rbind(evaluate_model(observed = InputDataSet$lengthofstay,
predicted = InputDataSet$Score,
model = "Boosted Trees (rxFastTrees)")))
}'
, @input_data_1 = @inquery
, @params = N' @model_name varchar(20), @predictions_table varchar(max), @database_name varchar(max)'
, @model_name = @model_name
, @predictions_table = @predictions_table
, @database_name = @database_name
;
END
GO
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[feature_engineering]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[feature_engineering]
end
GO
CREATE PROCEDURE [dbo].[feature_engineering] @input varchar(max), @output varchar(max), @is_production int
AS
BEGIN
-- Drop the output table if it has been created in R in the same database.
DECLARE @sql0 nvarchar(max);
SELECT @sql0 = N'
IF OBJECT_ID (''' + @output + ''', ''U'') IS NOT NULL
DROP TABLE ' + @output ;
EXEC sp_executesql @sql0
-- Drop the output view if it already exists.
DECLARE @sql1 nvarchar(max);
SELECT @sql1 = N'
IF OBJECT_ID (''' + @output + ''', ''V'') IS NOT NULL
DROP VIEW ' + @output ;
EXEC sp_executesql @sql1
-- Create a View with new features:
-- 1- Standardize the health numeric variables by substracting the mean and dividing by the standard deviation.
-- 2- Create number_of_issues variable corresponding to the total number of preidentified medical conditions.
-- lengthofstay variable is only selected if it exists (ie. in Modeling pipeline).
DECLARE @sql2 nvarchar(max);
SELECT @sql2 = N'
CREATE VIEW ' + @output + '
AS
SELECT eid, vdate, rcount, gender, dialysisrenalendstage, asthma, irondef, pneum, substancedependence, psychologicaldisordermajor, depress,
psychother, fibrosisandother, malnutrition, hemo,
(hematocrit - (SELECT mean FROM [dbo].[Stats] WHERE variable_name = ''hematocrit''))/(SELECT std FROM [dbo].[Stats] WHERE variable_name = ''hematocrit'') AS hematocrit,
(neutrophils - (SELECT mean FROM [dbo].[Stats] WHERE variable_name = ''neutrophils''))/(SELECT std FROM [dbo].[Stats] WHERE variable_name = ''neutrophils'') AS neutrophils,
(sodium - (SELECT mean FROM [dbo].[Stats] WHERE variable_name = ''sodium ''))/(SELECT std FROM [dbo].[Stats] WHERE variable_name = ''sodium '') AS sodium,
(glucose - (SELECT mean FROM [dbo].[Stats] WHERE variable_name = ''glucose''))/(SELECT std FROM [dbo].[Stats] WHERE variable_name = ''glucose'') AS glucose,
(bloodureanitro - (SELECT mean FROM [dbo].[Stats] WHERE variable_name = ''bloodureanitro''))/(SELECT std FROM [dbo].[Stats] WHERE variable_name = ''bloodureanitro'') AS bloodureanitro,
(creatinine - (SELECT mean FROM [dbo].[Stats] WHERE variable_name = ''creatinine''))/(SELECT std FROM [dbo].[Stats] WHERE variable_name = ''creatinine'') AS creatinine,
(bmi - (SELECT mean FROM [dbo].[Stats] WHERE variable_name = ''bmi''))/(SELECT std FROM [dbo].[Stats] WHERE variable_name = ''bmi'') AS bmi,
(pulse - (SELECT mean FROM [dbo].[Stats] WHERE variable_name = ''pulse''))/(SELECT std FROM [dbo].[Stats] WHERE variable_name = ''pulse'') AS pulse,
(respiration - (SELECT mean FROM [dbo].[Stats] WHERE variable_name = ''respiration''))/(SELECT std FROM [dbo].[Stats] WHERE variable_name = ''respiration'') AS respiration,
CAST((CAST(hemo as int) + CAST(dialysisrenalendstage as int) + CAST(asthma as int) + CAST(irondef as int) + CAST(pneum as int) +
CAST(substancedependence as int) + CAST(psychologicaldisordermajor as int) + CAST(depress as int) +
CAST(psychother as int) + CAST(fibrosisandother as int) + CAST(malnutrition as int)) as varchar(2))
AS number_of_issues,
secondarydiagnosisnonicd9, discharged, facid, '+
(CASE WHEN @is_production = 0 THEN 'lengthofstay' else 'NULL as lengthofstay' end) + '
FROM ' + @input;
EXEC sp_executesql @sql2
;
END
GO
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[fill_NA_explicit]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[fill_NA_explicit]
end
GO
CREATE PROCEDURE [dbo].[fill_NA_explicit] @input varchar(max), @output varchar(max)
AS
BEGIN
-- Drop the output table if it has been created in R in the same database.
DECLARE @sql0 nvarchar(max);
SELECT @sql0 = N'
IF OBJECT_ID (''' + @output + ''', ''U'') IS NOT NULL
DROP TABLE ' + @output ;
EXEC sp_executesql @sql0
-- Create a View with the raw data.
DECLARE @sqlv1 nvarchar(max);
SELECT @sqlv1 = N'
IF OBJECT_ID (''' + @output + ''', ''V'') IS NOT NULL
DROP VIEW ' + @output ;
EXEC sp_executesql @sqlv1
DECLARE @sqlv2 nvarchar(max);
SELECT @sqlv2 = N'
CREATE VIEW ' + @output + '
AS
SELECT *
FROM ' + @input;
EXEC sp_executesql @sqlv2
-- Loops to fill missing values for the character variables with 'missing'.
DECLARE @name1 NVARCHAR(100)
DECLARE @getname1 CURSOR
SET @getname1 = CURSOR FOR
SELECT variable_name FROM [dbo].[Stats] WHERE type IN ('varchar', 'nvarchar')
OPEN @getname1
FETCH NEXT
FROM @getname1 INTO @name1
WHILE @@FETCH_STATUS = 0
BEGIN
-- Check whether the variable contains a missing value. We perform cleaning only for variables containing NULL.
DECLARE @missing1 varchar(50)
DECLARE @sql10 nvarchar(max);
DECLARE @Parameter10 nvarchar(500);
SELECT @sql10 = N'
SELECT @missingOUT1 = missing
FROM (SELECT count(*) - count(' + @name1 + ') as missing
FROM ' + @output + ') as t';
SET @Parameter10 = N'@missingOUT1 varchar(max) OUTPUT';
EXEC sp_executesql @sql10, @Parameter10, @missingOUT1=@missing1 OUTPUT;
IF (@missing1 > 0)
BEGIN
-- Replace character variables with 'missing'.
DECLARE @sql11 nvarchar(max)
SET @sql11 =
'UPDATE ' + @output + '
SET ' + @name1 + ' = ISNULL(' + @name1 + ',''missing'')';
EXEC sp_executesql @sql11;
END;
FETCH NEXT
FROM @getname1 INTO @name1
END
CLOSE @getname1
DEALLOCATE @getname1
-- Loops to fill numeric variables with '-1'.
DECLARE @name2 NVARCHAR(100)
DECLARE @getname2 CURSOR
SET @getname2 = CURSOR FOR
SELECT variable_name FROM [dbo].[Stats] WHERE type IN ('int', 'float')
OPEN @getname2
FETCH NEXT
FROM @getname2 INTO @name2
WHILE @@FETCH_STATUS = 0
BEGIN
-- Check whether the variable contains a missing value. We perform cleaning only for variables containing NULL.
DECLARE @missing2 varchar(50)
DECLARE @sql20 nvarchar(max);
DECLARE @Parameter20 nvarchar(500);
SELECT @sql20 = N'
SELECT @missingOUT2 = missing
FROM (SELECT count(*) - count(' + @name2 + ') as missing
FROM ' + @output + ') as t';
SET @Parameter20 = N'@missingOUT2 varchar(max) OUTPUT';
EXEC sp_executesql @sql20, @Parameter20, @missingOUT2=@missing2 OUTPUT;
IF (@missing2 > 0)
BEGIN
-- Replace numeric variables with '-1'.
DECLARE @sql21 nvarchar(max)
SET @sql21 =
'UPDATE ' + @output + '
SET ' + @name2 + ' = ISNULL(' + @name2 + ', -1)';
EXEC sp_executesql @sql21;
END;
FETCH NEXT
FROM @getname2 INTO @name2
END
CLOSE @getname2
DEALLOCATE @getname2
END
GO
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[fill_NA_mode_mean]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[fill_NA_mode_mean]
end
GO
CREATE PROCEDURE [dbo].[fill_NA_mode_mean] @input varchar(max), @output varchar(max)
AS
BEGIN
-- Drop the output table if it has been created in R in the same database.
DECLARE @sql0 nvarchar(max);
SELECT @sql0 = N'
IF OBJECT_ID (''' + @output + ''', ''U'') IS NOT NULL
DROP TABLE ' + @output ;
EXEC sp_executesql @sql0
-- Create a View with the raw data.
DECLARE @sqlv1 nvarchar(max);
SELECT @sqlv1 = N'
IF OBJECT_ID (''' + @output + ''', ''V'') IS NOT NULL
DROP VIEW ' + @output ;
EXEC sp_executesql @sqlv1
DECLARE @sqlv2 nvarchar(max);
SELECT @sqlv2 = N'
CREATE VIEW ' + @output + '
AS
SELECT *
FROM ' + @input;
EXEC sp_executesql @sqlv2
-- Loops to fill missing values for the categorical variables with the mode.
DECLARE @name1 NVARCHAR(100)
DECLARE @getname1 CURSOR
SET @getname1 = CURSOR FOR
SELECT variable_name FROM [dbo].[Stats] WHERE type IN ('varchar', 'nvarchar', 'int')
OPEN @getname1
FETCH NEXT
FROM @getname1 INTO @name1
WHILE @@FETCH_STATUS = 0
BEGIN
-- Check whether the variable contains a missing value. We perform cleaning only for variables containing NULL.
DECLARE @missing1 varchar(50)
DECLARE @sql10 nvarchar(max);
DECLARE @Parameter10 nvarchar(500);
SELECT @sql10 = N'
SELECT @missingOUT1 = missing
FROM (SELECT count(*) - count(' + @name1 + ') as missing
FROM ' + @output + ') as t';
SET @Parameter10 = N'@missingOUT1 varchar(max) OUTPUT';
EXEC sp_executesql @sql10, @Parameter10, @missingOUT1=@missing1 OUTPUT;
IF (@missing1 > 0)
BEGIN
-- Replace categorical variables with the mode.
DECLARE @sql11 nvarchar(max)
SET @sql11 =
'UPDATE ' + @output + '
SET ' + @name1 + ' = ISNULL(' + @name1 + ', (SELECT mode FROM [dbo].[Stats] WHERE variable_name = ''' + @name1 + '''))';
EXEC sp_executesql @sql11;
END;
FETCH NEXT
FROM @getname1 INTO @name1
END
CLOSE @getname1
DEALLOCATE @getname1
-- Loops to fill continous variables with the mean.
DECLARE @name2 NVARCHAR(100)
DECLARE @getname2 CURSOR
SET @getname2 = CURSOR FOR
SELECT variable_name FROM [dbo].[Stats] WHERE type IN ('float')
OPEN @getname2
FETCH NEXT
FROM @getname2 INTO @name2
WHILE @@FETCH_STATUS = 0
BEGIN
-- Check whether the variable contains a missing value. We perform cleaning only for variables containing NULL.
DECLARE @missing2 varchar(50)
DECLARE @sql20 nvarchar(max);
DECLARE @Parameter20 nvarchar(500);
SELECT @sql20 = N'
SELECT @missingOUT2 = missing
FROM (SELECT count(*) - count(' + @name2 + ') as missing
FROM ' + @output + ') as t';
SET @Parameter20 = N'@missingOUT2 varchar(max) OUTPUT';
EXEC sp_executesql @sql20, @Parameter20, @missingOUT2=@missing2 OUTPUT;
IF (@missing2 > 0)
BEGIN
-- Replace numeric variables with '-1'.
DECLARE @sql21 nvarchar(max)
SET @sql21 =
'UPDATE ' + @output + '
SET ' + @name2 + ' = ISNULL(' + @name2 + ', (SELECT mean FROM [dbo].[Stats] WHERE variable_name = ''' + @name2 + '''))';
EXEC sp_executesql @sql21;
END;
FETCH NEXT
FROM @getname2 INTO @name2
END
CLOSE @getname2
DEALLOCATE @getname2
END
GO
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[get_column_info]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[get_column_info]
end
GO
CREATE PROCEDURE [dbo].[get_column_info] @input varchar(max)
AS
BEGIN
-- Create an empty table to store the serialized column information.
DROP TABLE IF EXISTS [dbo].[ColInfo]
CREATE TABLE [dbo].[ColInfo](
[info] [varbinary](max) NOT NULL
)
-- Serialize the column information.
DECLARE @database_name varchar(max) = db_name()
INSERT INTO ColInfo
EXECUTE sp_execute_external_script @language = N'R',
@script = N'
connection_string <- paste("Driver=SQL Server;Server=localhost;Database=", database_name, ";Trusted_Connection=true;", sep="");
LoS <- RxSqlServerData(sqlQuery = sprintf( "SELECT * FROM [%s]", input),
connectionString = connection_string,
stringsAsFactors = T)
OutputDataSet <- data.frame(payload = as.raw(serialize(rxCreateColInfo(LoS), connection=NULL)))
'
, @params = N'@input varchar(max), @database_name varchar(max)'
, @input = @input
, @database_name = @database_name
;
END
GO
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[prediction_results]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[prediction_results]
end
GO
CREATE PROCEDURE [dbo].[prediction_results]
AS
BEGIN
DROP TABLE if exists LoS_Predictions
SELECT LoS0.eid, CONVERT(DATE, LoS0.vdate, 110) as vdate, LoS0.rcount, LoS0.gender, LoS0.dialysisrenalendstage,
LoS0.asthma, LoS0.irondef, LoS0.pneum, LoS0.substancedependence,
LoS0.psychologicaldisordermajor, LoS0.depress, LoS0.psychother, LoS0.fibrosisandother,
LoS0.malnutrition, LoS0.hemo, LoS0.hematocrit, LoS0.neutrophils, LoS0.sodium,
LoS0.glucose, LoS0.bloodureanitro, LoS0.creatinine, LoS0.bmi, LoS0.pulse, LoS0.respiration, number_of_issues, LoS0.secondarydiagnosisnonicd9,
CONVERT(DATE, LoS0.discharged, 110) as discharged, LoS0.facid, LoS.lengthofstay,
CONVERT(DATE, CONVERT(DATETIME, LoS0.vdate, 110) + CAST(ROUND(Score, 0) as int), 110) as discharged_pred_boosted,
CAST(ROUND(Score, 0) as int) as Score
INTO LoS_Predictions
FROM LoS JOIN Boosted_Prediction ON LoS.eid = Boosted_Prediction.eid JOIN LoS0 ON LoS.eid = LoS0.eid
;
END
GO
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[score]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[score]
end
GO
CREATE PROCEDURE [dbo].[score] @model_name varchar(20),
@inquery varchar(max),
@output varchar(max)
AS
BEGIN
-- Get the trained model, the current database name and the column information.
DECLARE @model varbinary(max) = (select model from [dbo].[Models] where model_name = @model_name);
DECLARE @database_name varchar(max) = db_name();
DECLARE @info varbinary(max) = (select * from [dbo].[ColInfo]);
-- Compute the predictions.
EXECUTE sp_execute_external_script @language = N'R',
@script = N'
##########################################################################################################################################
## Define the connection string
##########################################################################################################################################
connection_string <- paste("Driver=SQL Server;Server=localhost;Database=", database_name, ";Trusted_Connection=true;", sep="")
##########################################################################################################################################
## Get the column information.
##########################################################################################################################################
column_info <- unserialize(info)
##########################################################################################################################################
## Point to the data set to score and use the column_info list to specify the types of the features.
##########################################################################################################################################
LoS_Test <- RxSqlServerData(sqlQuery = sprintf("%s", inquery),
connectionString = connection_string,
colInfo = column_info)
##########################################################################################################################################
## Random forest scoring.
##########################################################################################################################################
# The prediction results are directly written to a SQL table.
if(model_name == "RF" & length(model) > 0){
model <- unserialize(model)
forest_prediction_sql <- RxSqlServerData(table = output, connectionString = connection_string, stringsAsFactors = T)
rxPredict(modelObject = model,
data = LoS_Test,
outData = forest_prediction_sql,
type = "response",
extraVarsToWrite = c("eid", "lengthofstay"),
overwrite = TRUE)
}
##########################################################################################################################################
## Boosted tree scoring.
##########################################################################################################################################
# The prediction results are directly written to a SQL table.
if(model_name == "GBT" & length(model) > 0){
library("MicrosoftML")
model <- unserialize(model)
boosted_prediction_sql <- RxSqlServerData(table = output, connectionString = connection_string, stringsAsFactors = T)
rxPredict(modelObject = model,
data = LoS_Test,
outData = boosted_prediction_sql,
extraVarsToWrite = c("eid", "lengthofstay"),
overwrite = TRUE)
}
'
, @params = N' @model_name varchar(20), @model varbinary(max), @inquery nvarchar(max), @database_name varchar(max), @info varbinary(max), @output varchar(max)'
, @model_name = @model_name
, @model = @model
, @inquery = @inquery
, @database_name = @database_name
, @info = @info
, @output = @output
;
END
GO
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[splitting]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[splitting]
end
GO
CREATE PROCEDURE [dbo].[splitting] @splitting_percent int = 70, @input varchar(max)
AS
BEGIN
DECLARE @sql nvarchar(max);
SET @sql = N'
DROP TABLE IF EXISTS Train_Id
SELECT eid
INTO Train_Id
FROM ' + @input + '
WHERE ABS(CAST(BINARY_CHECKSUM(eid, NEWID()) as int)) % 100 < ' + Convert(Varchar, @splitting_percent);
EXEC sp_executesql @sql
;
END
GO
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[train_model]')
AND type IN ( N'P', N'PC' ) )
begin
DROP PROCEDURE [dbo].[train_model]
end
GO
CREATE PROCEDURE [dbo].[train_model] @modelName varchar(20),
@dataset_name varchar(max)
AS
BEGIN
-- Create an empty table to be filled with the trained models.
IF NOT EXISTS (SELECT * FROM sysobjects WHERE name = 'Models' AND xtype = 'U')
CREATE TABLE [dbo].[Models](
[model_name] [varchar](30) NOT NULL default('default model'),
[model] [varbinary](max) NOT NULL
)
-- Get the database name and the column information.
DECLARE @info varbinary(max) = (select * from [dbo].[ColInfo]);
DECLARE @database_name varchar(max) = db_name();
-- Train the model on the training set.
DELETE FROM Models WHERE model_name = @modelName;
INSERT INTO Models (model)
EXECUTE sp_execute_external_script @language = N'R',
@script = N'
##########################################################################################################################################
## Set the compute context to SQL for faster training
##########################################################################################################################################
# Define the connection string
connection_string <- paste("Driver=SQL Server;Server=localhost;Database=", database_name, ";Trusted_Connection=true;", sep="")
# Set the Compute Context to SQL.
sql <- RxInSqlServer(connectionString = connection_string)
rxSetComputeContext(sql)
##########################################################################################################################################
## Get the column information.
##########################################################################################################################################
column_info <- unserialize(info)
##########################################################################################################################################
## Point to the training set and use the column_info list to specify the types of the features.
##########################################################################################################################################
LoS_Train <- RxSqlServerData(
sqlQuery = sprintf( "SELECT *
FROM [%s]
WHERE eid IN (SELECT eid from Train_Id)", dataset_name),
connectionString = connection_string,
colInfo = column_info)
##########################################################################################################################################
## Specify the variables to keep for the training
##########################################################################################################################################
variables_all <- rxGetVarNames(LoS_Train)
# We remove dates and ID variables.
variables_to_remove <- c("eid", "vdate", "discharged", "facid")
traning_variables <- variables_all[!(variables_all %in% c("lengthofstay", variables_to_remove))]
formula <- as.formula(paste("lengthofstay ~", paste(traning_variables, collapse = "+")))
##########################################################################################################################################
## Training model based on model selection
##########################################################################################################################################
# Parameters of both models have been chosen for illustrative purposes, and can be further optimized.
if (model_name == "RF") {
# Train the Random Forest.
model <- rxDForest(formula = formula,
data = LoS_Train,
nTree = 40,
minBucket = 5,
minSplit = 10,
cp = 0.00005,
seed = 5)
} else{
# Train the Gradient Boosted Trees (rxFastTrees implementation).
library("MicrosoftML")
model <- rxFastTrees(formula = formula,
data = LoS_Train,
type=c("regression"),
numTrees = 40,
learningRate = 0.2,
splitFraction = 5/24,
featureFraction = 1,
minSplit = 10)
}
OutputDataSet <- data.frame(payload = as.raw(serialize(model, connection=NULL)))'
, @params = N' @model_name varchar(20), @dataset_name varchar(max), @info varbinary(max), @database_name varchar(max)'
, @model_name = @modelName
, @dataset_name = @dataset_name
, @info = @info
, @database_name = @database_name
UPDATE Models set model_name = @modelName
WHERE model_name = 'default model'
;
END
GO | the_stack |
--1 range partitioned table which's partition key has single column
-- ****BD: partition's top boundary,
-- ****BD(2): boundary of the second range partition
-- ****-BD(2): one value less than BD(2) and greater than BD(1)
-- ****BD(Z): boundary of the last range partition
-- ****+BD(Z): one value greater than DB(Z)
-- ****BD(N): 1<N<Z
-- ****ITEM: item expression, ITEM(<): < expression
-- ****OTHER: does not support expression for pruning,
-- ****NOKEY: expression which does not contain partition key
-- 1.1 ITEM
-- 1.1.1 </<=
--Y 1.1.1.1 < -BD(1)
--Y 1.1.1.2 <= -BD(1)
--Y 1.1.1.3 < BD(1)
--Y 1.1.1.4 <= BD(1)
--Y 1.1.1.5 < -BD(N)
--N 1.1.1.6 <= -BD(N)
--Y 1.1.1.7 < BD(N)
--Y 1.1.1.8 <= BD(N)
--N 1.1.1.9 < -BD(Z)
--N 1.1.1.10 <= -BD(Z)
--Y 1.1.1.11 < BD(Z)
--Y 1.1.1.12 <= BD(Z)
--Y 1.1.1.13 < +BD(Z)
--Y 1.1.1.14 <= +BD(Z)
-- 1.1.2 =
--Y 1.1.2.1 = -BD(1)
--Y 1.1.2.2 = BD(1)
--Y 1.1.2.3 = -BD(N)
--N 1.1.2.4 = BD(N)
--N 1.1.2.5 = -BD(Z)
--Y 1.1.2.6 = BD(Z)
--Y 1.1.2.7 = +BD(Z)
-- 1.1.3 >/>=
--Y 1.1.3.1 > -BD(1)
--Y 1.1.3.2 >= -BD(1)
--Y 1.1.3.3 > BD(1)
--Y 1.1.3.4 >= BD(1)
--Y 1.1.3.5 > -BD(N)
--Y 1.1.3.6 >= -BD(N)
--Y 1.1.3.7 > BD(N)
--Y 1.1.3.8 >= BD(N)
--N 1.1.3.9 > -BD(Z)
--N 1.1.3.10 >= -BD(Z)
--Y 1.1.3.11 > BD(Z)
--Y 1.1.3.12 >= BD(Z)
--N 1.1.3.13 > +BD(Z)
-- 1.1.4 MAXVALUE
--N 1.1.4.1 < -BD(Z)
--N 1.1.4.2 <= -BD(Z)
--N 1.1.4.3 = -BD(Z)
--N 1.1.4.5 >= -BD(Z)
--N 1.1.4.6 > -DB(Z)
--Y 1.1.5 IN (ArrayExpr)
--N 1.1.6 OTHER
--N 1.1.7 NOKEY
-- 1.2 AND
--Y 1.2.1 ITEM(<) AND ITEM(<)
--Y 1.2.2 ITEM(>) AND ITEM(>)
--Y 1.2.3 ITEM(>) AND ITEM(<) (NOT NULL)
--Y 1.2.4 ITEM(>) AND ITEM(<) (NULL)
--N 1.2.5 ITEM(=) AND ITEM(<) (NOT NULL)
--N 1.2.6 ITEM(=) AND ITEM(<) (NULL)
--Y 1.2.7 ITEM(=) AND ITEM(>) (NOT NULL)
--N 1.2.8 ITEM(=) AND ITEM(>) (NULL)
--N 1.2.9 BETWEEN...AND...
--Y 1.2.10 ITEM(<) AND OTHER
--N 1.2.11 NOKEY AND ITEM(>)
-- 1.3 OR
--Y 1.3.1 ITEM(<) OR ITEM(<)
--Y 1.3.2 ITEM(>) OR ITEM(>)
--Y 1.3.3 ITEM(>) OR ITEM(<) (NOT NULL)
--Y 1.3.4 ITEM(>) OR ITEM(<) (NULL)
--N 1.3.5 ITEM(=) OR ITEM(<) (NOT NULL)
--N 1.3.6 ITEM(=) OR ITEM(<) (NULL)
--Y 1.3.7 ITEM(=) OR ITEM(>) (NOT NULL)
--N 1.3.8 ITEM(=) OR ITEM(>) (NULL)
--Y 1.3.9 ITEM(<) OR OTHER
--N 1.3.10 NOKEY OR ITEM(>)
-- 1.4 COMPOSITE
--Y 1.4.1 ITEM(<) AND ITEM(<) AND ITEM(>)
--Y 1.4.2 ITEM(>) AND ITEM(<) OR ITEM(>)
--Y 1.4.3 ITEM(>) OR ITEM(<) OR ITEM(>) OR ITEM(>)
--Y 1.4.4 ITEM(>) AND ITEM(<) OR ITEM(>) AND ITEM(<)
--Y 1.4.5 (ITEM(>) OR ITEM(<)) AND ITEM(<)
--Y 1.4.6 (ITEM(>) OR ITEM(<)) AND ((ITEM(>) OR ITEM(<)))
--N 1.4.7 (BETWEEN...AND...) OR ITEM(>)
--Y 1.4.8 composite
-- 4 datatype
-- 4.1 int
-- 4.2 smallint
-- 4.3 integer
-- 4.4 bigint
-- 4.5 decimal
-- 4.6 numeric
-- 4.7 real
-- 4.8 double precision
-- 4.9 smallserial
-- 4.10 serial
-- 4.11 bigserial
-- 4.12 character varying(n), varchar(n)
-- 4.13 character(n), char(n)
-- 4.14 character.char
-- 4.15 text
-- 4.16 nvarchar2
-- 4.17 name
-- 4.18 timestamp [ (p) ] [ without time zone ]
-- 4.19 timestamp [ (p) ] with time zone
-- 4.20 date
-- 5 boundary test
--prepare
create table t_pruning_datatype_int32(c1 int,c2 int,c3 int,c4 text)
partition by range(c1)
(partition p1 values less than(100),
partition p2 values less than(200),
partition p3 values less than(300),
partition p4 values less than(500));
insert into t_pruning_datatype_int32 values(-100,20,20,'a'),
(100,300,300,'bb'),
(150,75,500,NULL),
(200,500,50,'ccc'),
(250,50,50,NULL),
(300,700,125,''),
(450,35,150,'dddd');
--partition pruning for int32
--1.1.2.1 = -BD(1)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1=50;
--1.1.2.2 = BD(1)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1=100;
--1.1.2.3 = -BD(N)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1=250;
--1.1.2.6 = BD(Z)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1=500;
--1.1.2.7 = +BD(Z)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1=550;
--1.1.1.1 < -BD(1)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50;
--1.1.1.2 <= -BD(1)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<=50;
--1.1.1.3 < BD(1)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<100;
--1.1.1.4 <= BD(1)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<=100;
--1.1.1.5 < -BD(N)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<150;
--1.1.1.7 < BD(N)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<200;
--1.1.1.8 <= BD(N)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<=200;
--1.1.1.11 < BD(Z)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<500;
--1.1.1.12 <= BD(Z)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<=500;
--1.1.1.13 < +BD(Z)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<700;
--1.1.1.14 <= +BD(Z)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<=700;
--1.1.3.1 > -BD(1)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>50;
--1.1.3.2 >= -BD(1)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=50;
--1.1.3.3 > BD(1)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>100;
--1.1.3.4 >= BD(1)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100;
--1.1.3.5 > -BD(N)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>150;
--1.1.3.6 >= -BD(N)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=150;
--1.1.3.7 > BD(N)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>200;
--1.1.3.8 >= BD(N)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=200;
--1.1.3.11 > BD(Z)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>500;
--1.1.3.12 >= BD(Z)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=500;
--1.1.5 IN (ArrayExpr)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1 IN (230,330,350);
--1.2.1 ITEM(<) AND ITEM(<)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 AND t_pruning_datatype_int32.c1<250;
--1.2.2 ITEM(>) AND ITEM(>)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>50 AND t_pruning_datatype_int32.c1>=150;
--1.2.2 ITEM(>) AND ITEM(>)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>100 AND t_pruning_datatype_int32.c1>=100;
--1.2.3 ITEM(>) AND ITEM(<) (NOT NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 AND t_pruning_datatype_int32.c1>0;
--1.2.3 ITEM(>) AND ITEM(<) (NOT NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100 AND t_pruning_datatype_int32.c1<300;
--1.2.3 ITEM(>) AND ITEM(<) (NOT NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100 AND t_pruning_datatype_int32.c1<550;
--1.2.4 ITEM(>) AND ITEM(<) (NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 AND t_pruning_datatype_int32.c1>100;
--1.2.4 ITEM(>) AND ITEM(<) (NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>250 AND t_pruning_datatype_int32.c1<50;
--1.2.7 ITEM(=) AND ITEM(>) (NOT NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100 AND t_pruning_datatype_int32.c1=100;
--1.2.10 ITEM(<) AND OTHER
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c4 IS NULL AND (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1<t_pruning_datatype_int32.c2) AND (t_pruning_datatype_int32.c2<t_pruning_datatype_int32.c3 OR t_pruning_datatype_int32.c2>100);
--1.3.1 ITEM(<) OR ITEM(<)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 OR t_pruning_datatype_int32.c1<250;
--1.3.2 ITEM(>) OR ITEM(>)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>50 OR t_pruning_datatype_int32.c1>=150;
--1.3.2 ITEM(>) OR ITEM(>)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>100 OR t_pruning_datatype_int32.c1>=100;
--1.3.3 ITEM(>) OR ITEM(<) (NOT NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 OR t_pruning_datatype_int32.c1>0;
--1.3.3 ITEM(>) OR ITEM(<) (NOT NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100 OR t_pruning_datatype_int32.c1<200;
--1.3.4 ITEM(>) OR ITEM(<) (NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 OR t_pruning_datatype_int32.c1>100;
--1.3.4 ITEM(>) OR ITEM(<) (NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250;
--1.3.4 ITEM(>) OR ITEM(<) (NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>250 OR t_pruning_datatype_int32.c1<50;
--1.3.7 ITEM(=) OR ITEM(>) (NOT NULL)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100 OR t_pruning_datatype_int32.c1=100;
--1.3.9 ITEM(<) OR OTHER
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c4 IS NULL OR (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1<t_pruning_datatype_int32.c2) AND (t_pruning_datatype_int32.c2<t_pruning_datatype_int32.c3 OR t_pruning_datatype_int32.c2>100);
--1.4.1 ITEM(<) AND ITEM(<) AND ITEM(>)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>100 AND t_pruning_datatype_int32.c1<=500 AND t_pruning_datatype_int32.c1>=100 AND t_pruning_datatype_int32.c1<500;
--1.4.1 ITEM(<) AND ITEM(<) AND ITEM(>)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>50 AND t_pruning_datatype_int32.c1>100 AND t_pruning_datatype_int32.c1>=100 AND t_pruning_datatype_int32.c1<250 AND t_pruning_datatype_int32.c1<=250 AND t_pruning_datatype_int32.c1=200;
--1.4.2 ITEM(>) AND ITEM(<) OR ITEM(>)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<170 AND ( t_pruning_datatype_int32.c1>600 OR t_pruning_datatype_int32.c1<150);
--1.4.3 ITEM(>) OR ITEM(<) OR ITEM(>) OR ITEM(>)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>100 OR t_pruning_datatype_int32.c1<=300 OR t_pruning_datatype_int32.c1>=100 OR t_pruning_datatype_int32.c1<300;
--1.4.5 (ITEM(>) OR ITEM(<)) AND ITEM(<)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where (t_pruning_datatype_int32.c1<170 OR t_pruning_datatype_int32.c1<250) AND ( t_pruning_datatype_int32.c1>600 OR t_pruning_datatype_int32.c1<150);
--1.4.2 ITEM(>) AND ITEM(<) OR ITEM(>)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 OR t_pruning_datatype_int32.c1>250 AND t_pruning_datatype_int32.c1<400;
--1.4.4 ITEM(>) AND ITEM(<) OR ITEM(>) AND ITEM(<)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=-100 AND t_pruning_datatype_int32.c1<50 OR t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1<700;
--1.4.4 ITEM(>) AND ITEM(<) OR ITEM(>) AND ITEM(<)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=-100 AND t_pruning_datatype_int32.c1<=100 OR t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1<700;
--1.4.6 (ITEM(>) OR ITEM(<)) AND ((ITEM(>) OR ITEM(<)))
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1<t_pruning_datatype_int32.c2) AND (t_pruning_datatype_int32.c2<t_pruning_datatype_int32.c3 OR t_pruning_datatype_int32.c2>100) OR t_pruning_datatype_int32.c4 IS NULL;
--1.4.6 (ITEM(>) OR ITEM(<)) AND ((ITEM(>) OR ITEM(<)))
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1<t_pruning_datatype_int32.c2) AND (t_pruning_datatype_int32.c2<t_pruning_datatype_int32.c3 OR t_pruning_datatype_int32.c2>100) AND t_pruning_datatype_int32.c4 IS NULL;
--1.4.8 composite
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c4 IS NULL) AND (t_pruning_datatype_int32.c2<t_pruning_datatype_int32.c3 OR t_pruning_datatype_int32.c2>100);
--1.4.8 composite
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1<t_pruning_datatype_int32.c2) AND (t_pruning_datatype_int32.c4 IS NULL OR t_pruning_datatype_int32.c2>100);
--1.4.9 param(no pruning)
set enable_hashjoin=off;
set enable_mergejoin=off;
set enable_seqscan=off;
set enable_material=off;
create index t_pruning_datatype_int32_i on t_pruning_datatype_int32(c1) local;
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 where c2 in (select c1 from t_pruning_datatype_int32);
drop index t_pruning_datatype_int32_i;
reset enable_hashjoin;
reset enable_mergejoin;
reset enable_seqscan;
reset enable_material;
--1.4.10 placeholder(no pruning)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int32 t1,
(select * from
(select c3, 2 as "2" from t_pruning_datatype_int32) t2
natural left join
(select c4, 3 as "3" from t_pruning_datatype_int32) t3
) t4
where t1.c1 = t4."3";
--4 datatype
--4.1 int
--Done
--4.2 smallint
create table t_pruning_datatype_int16(c1 smallint,c2 int,c3 int,c4 text)
partition by range(c1)
(partition p1 values less than(100),
partition p2 values less than(200),
partition p3 values less than(300),
partition p4 values less than(500));
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int16 where c1>=-100 AND c1<50 OR c1>300 AND c1<700;
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int16 where c1 IN (150,250,500,600);
--4.3 integer
--Done
--4.4 bigint
create table t_pruning_datatype_int64(c1 bigint,c2 int,c3 int,c4 text)
partition by range(c1)
(partition p1 values less than(100),
partition p2 values less than(200),
partition p3 values less than(300),
partition p4 values less than(500));
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int64 where c1>=-100 AND c1<50 OR c1>300 AND c1<700;
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_int64 where c1 IN (150,250,500,600);
--4.5 decimal
create table t_pruning_datatype_decimal(c1 decimal,c2 int,c3 int,c4 text)
partition by range(c1)
(partition p1 values less than(100.11),
partition p2 values less than(200.22),
partition p3 values less than(300.33),
partition p4 values less than(500.55));
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_decimal where c1>=-100.11 AND c1<50.0 OR c1>300.33 AND c1<700;
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_decimal where c1 IN (100.11,250.0, 300.33,700);
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_decimal where c1 IN (150,250,500,600);
--4.6 numeric
create table t_pruning_datatype_numeric(c1 numeric,c2 int,c3 int,c4 text)
partition by range(c1)
(partition p1 values less than(100.11),
partition p2 values less than(200.22),
partition p3 values less than(300.33),
partition p4 values less than(500.55));
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_numeric where c1>=-100.11 AND c1<50.0 OR c1>300.33 AND c1<700;
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_numeric where c1 IN (100.11,250.0, 300.33,700);
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from t_pruning_datatype_numeric where c1 IN (150,250,500,600);
drop table t_pruning_datatype_int32;
drop table t_pruning_datatype_int16;
drop table t_pruning_datatype_int64;
drop table t_pruning_datatype_decimal;
drop table t_pruning_datatype_numeric; | the_stack |
CREATE OR REPLACE FUNCTION populate_nibrs_representation()
RETURNS VOID
AS
$BODY$
DECLARE
rep_rec RECORD;
rep_cur CURSOR FOR
SELECT (representation->'incident_id')::text::bigint AS incident_id, representation
FROM (
SELECT ROW_TO_JSON(incident) AS representation
FROM (
SELECT incident_id,
cargo_theft_flag,
submission_date,
incident_date,
report_date_flag,
incident_hour,
incident_status,
( SELECT ROW_TO_JSON(innerag)
FROM ( SELECT rat.agency_type_name AS agency_type,
ra.ori,
ra.legacy_ori,
ra.ucr_agency_name,
ra.ncic_agency_name,
ra.pub_agency_name,
ra.agency_status,
ra.judicial_dist_code,
ra.fid_code,
ra.department_id,
ra.added_date,
ra.dormant_year,
( SELECT ROW_TO_JSON(innerst)
FROM ( SELECT rs.state_name,
rs.state_code,
rs.state_abbr,
rs.state_postal_abbr,
rs.state_fips_code,
rs.state_pub_freq_months,
( SELECT ROW_TO_JSON(innerdiv)
FROM ( SELECT rd.division_code,
rd.division_name,
rd.division_desc,
( SELECT ROW_TO_JSON(innerreg)
FROM ( SELECT rr.region_code,
rr.region_name,
rr.region_desc
FROM ref_region rr
WHERE rr.region_id = rd.region_id
) innerreg
) AS region
FROM ref_division rd
WHERE rd.division_id = rs.division_id
) innerdiv
) AS division
FROM ref_state rs
WHERE rs.state_id = ra.state_id
) innerst
) AS state,
rt.tribe_name,
( SELECT ROW_TO_JSON(innerruc)
FROM ( SELECT ruc.campus_name,
ru.university_abbr,
ru.university_name
FROM ref_university_campus ruc
JOIN ref_university ru ON (ruc.university_id = ru.university_id)
WHERE ruc.campus_id = ra.campus_id
) innerruc
) AS campus,
( SELECT ROW_TO_JSON(innercity)
FROM ( SELECT rcity.city_name
FROM ref_city rcity
WHERE rcity.city_id = ra.city_id
) innercity
) AS city,
( SELECT ROW_TO_JSON(innerfo)
FROM ( SELECT rfo.field_office_code,
rfo.field_office_name,
rfo.field_office_alpha_code,
rfo.field_office_numeric_code
FROM ref_field_office rfo
WHERE rfo.field_office_id = ra.field_office_id
) innerfo
) AS field_office,
( SELECT ROW_TO_JSON(innerpf)
FROM ( SELECT rpf.population_family_name,
rpf.population_family_desc
FROM ref_population_family rpf
WHERE rpf.population_family_id = ra.population_family_id
) innerpf
) population_family,
( SELECT ROW_TO_JSON(innersa)
FROM ( SELECT rsa.sai,
rsa.agency_name,
rs.state_abbr,
rsa.agency_email,
rsa.agency_website,
rsa.comments
FROM ref_submitting_agency rsa
LEFT OUTER JOIN ref_state rs ON (rsa.state_id = rs.state_id)
WHERE rsa.agency_id = ra.submitting_agency_id
) innersa
) submitting_agency,
rd.department_name
FROM ref_agency ra
JOIN ref_agency_type rat ON (rat.agency_type_id = ra.agency_type_id)
LEFT OUTER JOIN ref_department rd ON (ra.department_id = rd.department_id)
LEFT OUTER JOIN ref_tribe rt ON (ra.tribe_id = rt.tribe_id)
WHERE ra.agency_id = nibrs_incident.agency_id
) innerag
) AS agency,
( SELECT ARRAY_TO_JSON(ARRAY_AGG(ROW_TO_JSON(inner0)))
FROM ( SELECT no.attempt_complete_flag,
no.num_premises_entered,
no.method_entry_code,
( SELECT ROW_TO_JSON(inner0a)
FROM ( SELECT notyp.offense_code,
notyp.offense_name,
notyp.crime_against,
notyp.ct_flag,
notyp.hc_flag,
notyp.offense_category_name
FROM nibrs_offense_type notyp
WHERE notyp.offense_type_id = no.offense_type_id
) inner0a
) offense_type,
( SELECT ROW_TO_JSON(innerloc)
FROM ( SELECT nlt.location_code,
nlt.location_name
FROM nibrs_location_type nlt
WHERE nlt.location_id = no.location_id
) innerloc
) AS location,
( SELECT ARRAY_TO_JSON(ARRAY_AGG(ROW_TO_JSON(inner0b)))
FROM ( SELECT ncat.criminal_act_code,
ncat.criminal_act_name
FROM nibrs_criminal_act nca
JOIN nibrs_criminal_act_type ncat ON (nca.criminal_act_id = ncat.criminal_act_id)
WHERE nca.offense_id = no.offense_id) inner0b
) criminal_acts,
( SELECT ARRAY_TO_JSON(ARRAY_AGG(ROW_TO_JSON(innerwpn)))
FROM ( SELECT nwt.weapon_code,
nwt.weapon_name
FROM nibrs_weapon nw
JOIN nibrs_weapon_type nwt ON (nwt.weapon_id = nw.weapon_id)
WHERE nw.offense_id = no.offense_id
) innerwpn
) weapons
FROM nibrs_offense no
WHERE no.incident_id = nibrs_incident.incident_id) inner0
) offenses,
( SELECT ROW_TO_JSON(inner1)
FROM ( SELECT nci.cleared_except_code, nci.cleared_except_name
FROM nibrs_cleared_except nci
WHERE nci.cleared_except_id = nibrs_incident.cleared_except_id
) inner1
) cleared_except,
( SELECT ARRAY_TO_JSON(ARRAY_AGG(ROW_TO_JSON(innerprop)))
FROM ( SELECT nplt.prop_loss_name,
np.stolen_count,
np.recovered_count
FROM nibrs_property np
JOIN nibrs_prop_loss_type nplt ON (np.prop_loss_id = nplt.prop_loss_id)
WHERE np.incident_id = nibrs_incident.incident_id
) innerprop
) property,
( SELECT ARRAY_TO_JSON(ARRAY_AGG(ROW_TO_JSON(innervic)))
FROM ( SELECT nvt.victim_type_code,
nvt.victim_type_name,
nast.assignment_type_code,
nast.assignment_type_name,
nat.activity_type_code,
nat.activity_type_name,
nv.sex_code,
nv.age_num, -- TODO: oh noes, the age weirdness
nibrs_age.age_name,
ne.ethnicity_code,
ne.ethnicity_name,
rr.race_code,
rr.race_desc,
nv.resident_status_code,
nv.age_range_low_num,
nv.age_range_high_num,
nv.outside_agency_id -- TODO: what is this?
FROM nibrs_victim nv
JOIN nibrs_victim_type nvt ON (nvt.victim_type_id = nv.victim_type_id)
LEFT OUTER JOIN nibrs_assignment_type nast ON (nv.assignment_type_id = nast.assignment_type_id)
LEFT OUTER JOIN nibrs_age ON (nv.age_id = nibrs_age.age_id)
LEFT OUTER JOIN nibrs_ethnicity ne ON (nv.ethnicity_id = ne.ethnicity_id)
LEFT OUTER JOIN ref_race rr ON (nv.race_id = rr.race_id)
LEFT OUTER JOIN nibrs_activity_type nat ON (nv.activity_type_id = nat.activity_type_id)
WHERE nv.incident_id = nibrs_incident.incident_id
) innervic
) victims,
( SELECT ARRAY_TO_JSON(ARRAY_AGG(ROW_TO_JSON(innerarr)))
FROM ( SELECT narr.arrest_num,
narr.arrest_date,
narr.multiple_indicator,
narr.resident_code,
narr.under_18_disposition_code,
narr.clearance_ind,
narr.sex_code,
narr.age_num, -- TODO: oh noes, the age weirdness
nibrs_age.age_name,
ne.ethnicity_code,
ne.ethnicity_name,
rr.race_code,
rr.race_desc,
narr.age_range_low_num,
narr.age_range_high_num,
( SELECT ROW_TO_JSON(inneroftyp)
FROM ( SELECT notyp.offense_code,
notyp.offense_name,
notyp.crime_against,
notyp.ct_flag,
notyp.hc_flag,
notyp.hc_code,
notyp.offense_category_name
FROM nibrs_offense_type notyp
WHERE notyp.offense_type_id = narr.offense_type_id
) inneroftyp
) offense_type
FROM nibrs_arrestee narr
LEFT OUTER JOIN nibrs_age ON (narr.age_id = nibrs_age.age_id)
LEFT OUTER JOIN nibrs_ethnicity ne ON (narr.ethnicity_id = ne.ethnicity_id)
LEFT OUTER JOIN ref_race rr ON (narr.race_id = rr.race_id)
WHERE narr.incident_id = nibrs_incident.incident_id
) innerarr
) arrestees,
( SELECT ARRAY_TO_JSON(ARRAY_AGG(ROW_TO_JSON(innerofndr)))
FROM ( SELECT
nof.sex_code,
nof.age_num, -- TODO: oh noes, the age weirdness
nibrs_age.age_name,
ne.ethnicity_code,
ne.ethnicity_name,
rr.race_code,
rr.race_desc,
nof.age_range_low_num,
nof.age_range_high_num
FROM nibrs_offender nof
LEFT OUTER JOIN nibrs_age ON (nof.age_id = nibrs_age.age_id)
LEFT OUTER JOIN nibrs_ethnicity ne ON (nof.ethnicity_id = ne.ethnicity_id)
LEFT OUTER JOIN ref_race rr ON (nof.race_id = rr.race_id)
WHERE nof.incident_id = nibrs_incident.incident_id
) innerofndr
) offenders
FROM nibrs_incident
WHERE incident_id > ( SELECT MAX(incident_id) FROM nibrs_incident_representation)
ORDER BY incident_number ASC
LIMIT 100
) incident
) repr;
BEGIN
OPEN rep_cur;
LOOP
BEGIN
FETCH rep_cur INTO rep_rec;
EXIT WHEN NOT FOUND;
INSERT INTO nibrs_incident_representation(incident_id, representation)
VALUES (rep_rec.incident_id, rep_rec.representation);
PERFORM pg_sleep(1);
-- RAISE INFO 'Inserted record';
EXCEPTION
WHEN connection_exception THEN
-- ROLLBACK;
RAISE INFO 'Insert failed, check connection';
PERFORM pg_sleep(10);
RAISE INFO 'Retrying...';
END;
END LOOP;
CLOSE rep_cur;
END; $BODY$
LANGUAGE plpgsql; | the_stack |
-- 24.03.2016 14:05
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543049,0,'QtyPromised_TU',TO_TIMESTAMP('2016-03-24 14:05:59','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Y','Zusagbar (TU)','Zusagbar (TU)',TO_TIMESTAMP('2016-03-24 14:05:59','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 24.03.2016 14:05
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543049 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 24.03.2016 14:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,DefaultValue,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,554283,543049,0,29,540747,'N','QtyPromised_TU',TO_TIMESTAMP('2016-03-24 14:06:36','YYYY-MM-DD HH24:MI:SS'),100,'N','0','de.metas.procurement',10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','N','N','Zusagbar (TU)',0,TO_TIMESTAMP('2016-03-24 14:06:36','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 24.03.2016 14:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=554283 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 24.03.2016 14:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE PMM_QtyReport_Event ADD QtyPromised_TU NUMERIC DEFAULT 0 NOT NULL
;
-- 24.03.2016 14:07
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543050,0,'QtyPromised_TU_Old',TO_TIMESTAMP('2016-03-24 14:07:46','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Y','Old Zusagbar (TU)','Old Zusagbar (TU)',TO_TIMESTAMP('2016-03-24 14:07:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 24.03.2016 14:07
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543050 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 24.03.2016 14:08
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543051,0,'QtyPromised_Old',TO_TIMESTAMP('2016-03-24 14:08:03','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Y','Old Zusagbar','Old Zusagbar',TO_TIMESTAMP('2016-03-24 14:08:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 24.03.2016 14:08
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543051 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 24.03.2016 14:08
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,DefaultValue,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,554284,543050,0,29,540747,'N','QtyPromised_TU_Old',TO_TIMESTAMP('2016-03-24 14:08:49','YYYY-MM-DD HH24:MI:SS'),100,'N','0','de.metas.procurement',10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','N','N','Old Zusagbar (TU)',0,TO_TIMESTAMP('2016-03-24 14:08:49','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 24.03.2016 14:08
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=554284 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 24.03.2016 14:08
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE PMM_QtyReport_Event ADD QtyPromised_TU_Old NUMERIC DEFAULT 0 NOT NULL
;
-- 24.03.2016 14:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsUpdateable='Y',Updated=TO_TIMESTAMP('2016-03-24 14:09:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=554284
;
-- 24.03.2016 14:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,DefaultValue,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,554285,543051,0,29,540747,'N','QtyPromised_Old',TO_TIMESTAMP('2016-03-24 14:09:17','YYYY-MM-DD HH24:MI:SS'),100,'N','0','de.metas.procurement',10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','Y','N','Old Zusagbar',0,TO_TIMESTAMP('2016-03-24 14:09:17','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 24.03.2016 14:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=554285 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 24.03.2016 14:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE PMM_QtyReport_Event ADD QtyPromised_Old NUMERIC DEFAULT 0 NOT NULL
;
-- 24.03.2016 15:16
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,554286,542506,0,29,540745,'N','QtyOrdered_TU',TO_TIMESTAMP('2016-03-24 15:16:20','YYYY-MM-DD HH24:MI:SS'),100,'N','0','Bestellte Menge (TU)','de.metas.procurement',10,'Die "Bestellte Menge" bezeichnet die Menge einer Ware, die bestellt wurde.','Y','N','Y','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','Y','N','Bestellte Menge (TU)',0,TO_TIMESTAMP('2016-03-24 15:16:20','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 24.03.2016 15:16
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=554286 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 24.03.2016 15:16
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE PMM_PurchaseCandidate ADD QtyOrdered_TU NUMERIC DEFAULT 0 NOT NULL
;
-- 24.03.2016 15:16
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,554287,543049,0,29,540745,'N','QtyPromised_TU',TO_TIMESTAMP('2016-03-24 15:16:44','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.procurement',10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','Y','N','Zusagbar (TU)',0,TO_TIMESTAMP('2016-03-24 15:16:44','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 24.03.2016 15:16
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=554287 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 24.03.2016 15:17
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET DefaultValue='0',Updated=TO_TIMESTAMP('2016-03-24 15:17:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=554287
;
-- 24.03.2016 15:17
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE PMM_PurchaseCandidate ADD QtyPromised_TU NUMERIC DEFAULT 0 NOT NULL
;
-- 24.03.2016 15:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543052,0,'QtyToOrder_TU',TO_TIMESTAMP('2016-03-24 15:18:07','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.handlingunits','Y','Quantity to Order (TU)','Qty to Order (TU)',TO_TIMESTAMP('2016-03-24 15:18:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 24.03.2016 15:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543052 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 24.03.2016 15:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,DefaultValue,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,554288,543052,0,29,540745,'N','QtyToOrder_TU',TO_TIMESTAMP('2016-03-24 15:18:13','YYYY-MM-DD HH24:MI:SS'),100,'N','0','de.metas.procurement',10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','Y','N','Quantity to Order (TU)',30,TO_TIMESTAMP('2016-03-24 15:18:13','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 24.03.2016 15:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=554288 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 24.03.2016 15:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE PMM_PurchaseCandidate ADD QtyToOrder_TU NUMERIC DEFAULT 0 NOT NULL
;
-- 24.03.2016 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,554289,542506,0,29,540746,'N','QtyOrdered_TU',TO_TIMESTAMP('2016-03-24 15:21:09','YYYY-MM-DD HH24:MI:SS'),100,'N','0','Bestellte Menge (TU)','de.metas.procurement',10,'Die "Bestellte Menge" bezeichnet die Menge einer Ware, die bestellt wurde.','Y','N','Y','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','Y','N','Bestellte Menge (TU)',0,TO_TIMESTAMP('2016-03-24 15:21:09','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 24.03.2016 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=554289 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 24.03.2016 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE PMM_PurchaseCandidate_OrderLine ADD QtyOrdered_TU NUMERIC DEFAULT 0 NOT NULL
; | the_stack |
DROP TABLE IF EXISTS `am_addon_component_rel`;
DROP TABLE IF EXISTS `am_addon_instance`;
DROP TABLE IF EXISTS `am_addon_meta`;
DROP TABLE IF EXISTS `am_app_meta`;
DROP TABLE IF EXISTS `am_app_package`;
DROP TABLE IF EXISTS `am_app_package_component_rel`;
DROP TABLE IF EXISTS `am_app_package_tag`;
DROP TABLE IF EXISTS `am_component_package_task`;
DROP TABLE IF EXISTS `am_component_package`;
DROP TABLE IF EXISTS `am_deploy_app`;
DROP TABLE IF EXISTS `am_deploy_component`;
DROP TABLE IF EXISTS `am_env`;
DROP TABLE IF EXISTS `am_micro_service_host`;
DROP TABLE IF EXISTS `am_ms_port_resource`;
DROP TABLE IF EXISTS `am_namespace`;
DROP TABLE IF EXISTS `am_template`;
DROP TABLE IF EXISTS `channel_task`;
DROP TABLE IF EXISTS `channel_task_host`;
DROP TABLE IF EXISTS `tc_dag`;
DROP TABLE IF EXISTS `tc_dag_config`;
DROP TABLE IF EXISTS `tc_dag_inst`;
DROP TABLE IF EXISTS `tc_dag_inst_edge`;
DROP TABLE IF EXISTS `tc_dag_inst_node`;
DROP TABLE IF EXISTS `tc_dag_inst_node_std`;
DROP TABLE IF EXISTS `tc_dag_node`;
DROP TABLE IF EXISTS `tc_dag_options`;
DROP TABLE IF EXISTS `tc_dag_service_node`;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_addon_component_rel */
/******************************************/
CREATE TABLE `am_addon_component_rel`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` datetime NOT NULL COMMENT '创建时间',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`namespace_id` varchar(64) NOT NULL DEFAULT '' COMMENT 'namespace',
`env_id` varchar(64) NOT NULL DEFAULT '' COMMENT '环境ID',
`app_id` varchar(64) NOT NULL DEFAULT '' COMMENT '应用ID',
`component_type` varchar(64) NOT NULL DEFAULT '' COMMENT '组件类型',
`component_name` varchar(64) NOT NULL DEFAULT '' COMMENT '组件名称',
`addon_instance_id` varchar(64) DEFAULT '' COMMENT 'addon实例ID',
`var_mapping` varchar(2048) DEFAULT NULL COMMENT '环境光变量映射',
`addon_name` varchar(64) DEFAULT '' COMMENT 'addon资源名称',
PRIMARY KEY (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 80
DEFAULT CHARSET = utf8mb4 COMMENT ='addon和组件关联关系'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_addon_instance */
/******************************************/
CREATE TABLE `am_addon_instance`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`addon_id` varchar(32) DEFAULT NULL COMMENT '附加组件唯一标识',
`namespace_id` varchar(32) DEFAULT NULL COMMENT '该附加组件部署到的 Namespace 标识',
`resource_ext` longtext COMMENT '资源扩展信息',
`addon_instance_id` varchar(64) DEFAULT '' COMMENT '资源实例ID',
`addon_version` varchar(64) DEFAULT '' COMMENT '附加组件唯一标识',
PRIMARY KEY (`id`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
AUTO_INCREMENT = 73
DEFAULT CHARSET = utf8mb4 COMMENT ='附加组件实例'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_addon_meta */
/******************************************/
CREATE TABLE `am_addon_meta`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`addon_id` varchar(32) DEFAULT NULL COMMENT '附加组件唯一标识',
`addon_version` varchar(32) DEFAULT NULL COMMENT '版本号',
`addon_type` varchar(16) DEFAULT NULL COMMENT '类型(可选 CORE-SERVICE / THIRDPARTY)',
`addon_name` varchar(64) DEFAULT NULL COMMENT '名称',
`addon_path` varchar(255) DEFAULT NULL COMMENT '存储相对路径',
`addon_ext` longtext COMMENT '扩展信息 JSON',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_addon_id_version` (`addon_id`, `addon_version`),
KEY `idx_addon_type` (`addon_type`),
KEY `idx_addon_name` (`addon_name`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
AUTO_INCREMENT = 20
DEFAULT CHARSET = utf8mb4 COMMENT ='附加组件元信息'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_app_meta */
/******************************************/
CREATE TABLE `am_app_meta`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`app_id` varchar(32) DEFAULT NULL COMMENT '应用唯一标识',
`app_type` varchar(16) DEFAULT NULL COMMENT '应用类型',
`app_name` varchar(64) DEFAULT NULL COMMENT '应用名称',
`app_ext` longtext COMMENT '扩展信息 JSON',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_app_id` (`app_id`),
KEY `idx_app_type` (`app_type`),
KEY `idx_app_name` (`app_name`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='应用元信息'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_app_package */
/******************************************/
CREATE TABLE `am_app_package`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`app_id` varchar(32) DEFAULT NULL COMMENT '应用唯一标识',
`package_version` varchar(32) DEFAULT NULL COMMENT '版本号',
`package_path` varchar(255) DEFAULT NULL COMMENT '存储位置相对路径',
`package_creator` varchar(64) DEFAULT NULL COMMENT '创建者',
`package_ext` longtext COMMENT '扩展信息 JSON',
`package_md5` varchar(32) DEFAULT NULL COMMENT '包 MD5',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_package_id` (`app_id`, `package_version`),
KEY `idx_package_creator` (`package_creator`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
AUTO_INCREMENT = 10
DEFAULT CHARSET = utf8mb4 COMMENT ='应用包详情表'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_app_package_component_rel */
/******************************************/
CREATE TABLE `am_app_package_component_rel`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`app_package_id` bigint(20) NOT NULL COMMENT '所属应用包 ID',
`component_package_id` bigint(20) NOT NULL COMMENT '所属组件包 ID',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_relation` (`app_package_id`, `component_package_id`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
AUTO_INCREMENT = 8
DEFAULT CHARSET = utf8mb4 COMMENT ='应用包中组件引用关系表'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_app_package_tag */
/******************************************/
CREATE TABLE `am_app_package_tag`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`app_package_id` bigint(20) NOT NULL COMMENT '所属应用包 ID',
`tag` varchar(64) DEFAULT NULL COMMENT '标签',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_package_tag` (`app_package_id`, `tag`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='应用包标签表'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_component_package */
/******************************************/
CREATE TABLE `am_component_package`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`app_id` varchar(32) DEFAULT NULL COMMENT '应用唯一标识',
`component_type` varchar(32) DEFAULT NULL COMMENT '组件类型',
`package_version` varchar(32) DEFAULT NULL COMMENT '版本号',
`package_path` varchar(255) DEFAULT NULL COMMENT '存储位置相对路径',
`package_creator` varchar(64) DEFAULT NULL COMMENT '创建者',
`package_ext` longtext COMMENT '扩展信息 JSON',
`component_name` varchar(32) DEFAULT NULL COMMENT '组件类型下的唯一组件标识',
`package_md5` varchar(32) DEFAULT NULL COMMENT '包 MD5',
`package_addon` text COMMENT '包 Addon 描述信息',
`package_options` text COMMENT '包配置选项信息',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_package_id` (`app_id`, `component_type`, `component_name`, `package_version`),
KEY `idx_package_creator` (`package_creator`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
AUTO_INCREMENT = 12
DEFAULT CHARSET = utf8mb4 COMMENT ='组件包详情表'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_component_package_task */
/******************************************/
CREATE TABLE `am_component_package_task`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`app_id` varchar(32) DEFAULT NULL COMMENT '应用唯一标识',
`component_type` varchar(32) DEFAULT NULL COMMENT '组件类型',
`component_name` varchar(32) DEFAULT NULL COMMENT '组件类型下的唯一组件标识',
`package_version` varchar(32) DEFAULT NULL COMMENT '版本号',
`package_path` varchar(255) DEFAULT NULL COMMENT '存储位置相对路径',
`package_creator` varchar(64) DEFAULT NULL COMMENT '创建者',
`package_md5` varchar(32) DEFAULT NULL COMMENT '包 MD5',
`package_addon` text COMMENT '包 Addon 描述信息',
`package_options` text COMMENT '包配置选项信息',
`package_ext` longtext COMMENT '扩展信息 JSON',
`task_status` varchar(16) DEFAULT NULL COMMENT '任务状态',
`task_log` longtext COMMENT '任务日志',
`component_package_id` bigint(20) DEFAULT NULL COMMENT '映射 component package 表主键 ID',
PRIMARY KEY (`id`),
KEY `idx_package_task_id` (`app_id`, `component_type`, `component_name`, `package_version`),
KEY `idx_package_task_status` (`task_status`),
KEY `idx_package_creator` (`package_creator`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
AUTO_INCREMENT = 17
DEFAULT CHARSET = utf8mb4 COMMENT ='组件包创建任务详情表'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_deploy_app */
/******************************************/
CREATE TABLE `am_deploy_app`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`app_package_id` bigint(20) NOT NULL COMMENT '当前部署单使用的应用包 ID',
`app_id` varchar(32) DEFAULT NULL COMMENT '应用唯一标识',
`namespace_id` varchar(32) DEFAULT NULL COMMENT '部署目标 Namespace ID',
`env_id` varchar(32) DEFAULT NULL COMMENT '部署目标环境 ID',
`gmt_start` datetime DEFAULT NULL COMMENT '部署开始时间',
`gmt_end` datetime DEFAULT NULL COMMENT '部署结束时间',
`deploy_status` varchar(16) DEFAULT NULL COMMENT '状态',
`deploy_error_message` text COMMENT '错误信息',
`deploy_creator` varchar(64) DEFAULT NULL COMMENT '部署工单发起人',
`deploy_ext` longtext COMMENT '扩展信息 JSON',
`deploy_component_count` bigint(20) DEFAULT NULL COMMENT '子 Component 计数',
PRIMARY KEY (`id`),
KEY `idx_app_package_id` (`app_package_id`),
KEY `idx_app_id` (`app_id`),
KEY `idx_namespace_id` (`namespace_id`),
KEY `idx_env_id` (`env_id`),
KEY `idx_deploy_status` (`deploy_status`),
KEY `idx_deploy_creator` (`deploy_creator`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
AUTO_INCREMENT = 77
DEFAULT CHARSET = utf8mb4 COMMENT ='部署工单 - AppPackage 表'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_deploy_component */
/******************************************/
CREATE TABLE `am_deploy_component`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`deploy_id` bigint(20) NOT NULL COMMENT '所属部署单 ID',
`component_package_id` bigint(20) NOT NULL COMMENT '当前部署项对应的组件包 ID',
`app_id` varchar(32) DEFAULT NULL COMMENT '应用唯一标识',
`namespace_id` varchar(32) DEFAULT NULL COMMENT '部署目标 Namespace ID',
`env_id` varchar(32) DEFAULT NULL COMMENT '部署目标环境 ID',
`gmt_start` datetime DEFAULT NULL COMMENT '部署开始时间',
`gmt_end` datetime DEFAULT NULL COMMENT '部署结束时间',
`deploy_status` varchar(16) DEFAULT NULL COMMENT '状态',
`deploy_error_message` longtext COMMENT '错误信息',
`deploy_creator` varchar(64) DEFAULT NULL COMMENT '部署工单发起人',
`deploy_process_id` varchar(64) DEFAULT NULL COMMENT '部署流程 ID',
`deploy_ext` longtext COMMENT '扩展信息 JSON',
PRIMARY KEY (`id`),
KEY `idx_deploy_id` (`deploy_id`),
KEY `idx_component_package_id` (`component_package_id`),
KEY `idx_app_id` (`app_id`),
KEY `idx_namespace_id` (`namespace_id`),
KEY `idx_env_id` (`env_id`),
KEY `idx_deploy_process_id` (`deploy_process_id`),
KEY `idx_deploy_status` (`deploy_status`),
KEY `idx_deploy_creator` (`deploy_creator`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
AUTO_INCREMENT = 45
DEFAULT CHARSET = utf8mb4 COMMENT ='部署工单 - ComponentPackage 表'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_env */
/******************************************/
CREATE TABLE `am_env`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`namespace_id` varchar(32) DEFAULT NULL COMMENT '所属 Namespace ID',
`env_id` varchar(32) DEFAULT NULL COMMENT '环境 ID',
`env_name` varchar(64) DEFAULT NULL COMMENT '环境名称',
`env_creator` varchar(64) DEFAULT NULL COMMENT '环境创建者',
`env_modifier` varchar(64) DEFAULT NULL COMMENT '环境最后修改者',
`env_ext` longtext COMMENT '环境扩展信息',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_namespace_id_env_id` (`namespace_id`, `env_id`),
KEY `idx_env_name` (`env_name`),
KEY `idx_env_creator` (`env_creator`),
KEY `idx_env_modifier` (`env_modifier`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
AUTO_INCREMENT = 2
DEFAULT CHARSET = utf8mb4 COMMENT ='环境表'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_micro_service_host */
/******************************************/
CREATE TABLE `am_micro_service_host`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` datetime NOT NULL COMMENT '创建时间',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`namespace_id` varchar(64) NOT NULL DEFAULT '' COMMENT 'namespace',
`env_id` varchar(64) NOT NULL DEFAULT '' COMMENT '环境id',
`app_id` varchar(32) NOT NULL DEFAULT '' COMMENT '应用ID',
`ip` varchar(32) NOT NULL DEFAULT '' COMMENT 'ip',
`deploy_type` varchar(32) NOT NULL DEFAULT '' COMMENT '部署方式,独占,共享',
`service_id` varchar(64) NOT NULL DEFAULT '' COMMENT '微服务id',
PRIMARY KEY (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 49
DEFAULT CHARSET = utf8mb4 COMMENT ='微服务关联机器信息'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_ms_port_resource */
/******************************************/
CREATE TABLE `am_ms_port_resource`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` datetime NOT NULL COMMENT '创建时间',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`port` int(10) unsigned DEFAULT NULL COMMENT '端口',
`namespace_id` varchar(64) DEFAULT '' COMMENT '环境隔离空间',
PRIMARY KEY (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 3
DEFAULT CHARSET = utf8mb4 COMMENT ='已使用port资源'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_namespace */
/******************************************/
CREATE TABLE `am_namespace`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`namespace_id` varchar(32) DEFAULT NULL COMMENT 'Namespace ID',
`namespace_name` varchar(64) DEFAULT NULL COMMENT 'Namespace Name',
`namespace_creator` varchar(64) DEFAULT NULL COMMENT 'Namespace 创建者',
`namespace_modifier` varchar(64) DEFAULT NULL COMMENT 'Namespace 最后修改者',
`namespace_ext` longtext COMMENT 'Namespace 扩展信息',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_namespace_id` (`namespace_id`),
KEY `idx_namespace_name` (`namespace_name`),
KEY `idx_namespace_creator` (`namespace_creator`),
KEY `idx_namespace_modifier` (`namespace_modifier`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
AUTO_INCREMENT = 13
DEFAULT CHARSET = utf8mb4 COMMENT ='命名空间'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = am_template */
/******************************************/
CREATE TABLE `am_template`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`gmt_modified` datetime DEFAULT NULL COMMENT '最后修改时间',
`template_id` varchar(32) DEFAULT NULL COMMENT '模板全局唯一 ID',
`template_version` varchar(32) DEFAULT NULL COMMENT '模板版本',
`template_type` varchar(16) DEFAULT NULL COMMENT '模板类型',
`template_name` varchar(64) DEFAULT NULL COMMENT '模板名称',
`template_path` varchar(255) DEFAULT NULL COMMENT '存储位置相对路径',
`template_ext` longtext COMMENT '模板扩展信息',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_template_id_version` (`template_id`, `template_version`),
KEY `idx_template_type` (`template_type`),
KEY `idx_template_name` (`template_name`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='应用模板'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = channel_task */
/******************************************/
CREATE TABLE `channel_task`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` bigint(20) DEFAULT NULL COMMENT '任务创建时间',
`gmt_modified` bigint(20) DEFAULT NULL COMMENT '任务更新时间',
`task_uuid` varchar(45) NOT NULL COMMENT '任务标识',
`command` text COMMENT '执行命令',
`working_dir` varchar(128) DEFAULT NULL COMMENT '工作目录',
`timeout` bigint(20) DEFAULT NULL COMMENT '超时时间',
`exec_user` varchar(128) DEFAULT NULL COMMENT '执行用户',
`task_status` int(11) DEFAULT NULL COMMENT '任务状态',
`task_name` varchar(128) DEFAULT NULL COMMENT '任务名',
`user_name` varchar(128) DEFAULT NULL COMMENT '任务发起者',
`host_count` int(11) DEFAULT NULL COMMENT '机器总数',
`task_remarks` longtext COMMENT '任务备注',
`end_time` bigint(20) DEFAULT NULL COMMENT '任务结束时间',
`command_type` int(11) DEFAULT NULL COMMENT '命令类型',
`start_time` bigint(20) DEFAULT NULL COMMENT '任务开始时间',
`script_path` varchar(128) DEFAULT NULL COMMENT '上传文件存储路径',
`script_content` longtext COMMENT '上传文件内容',
`end_point` varchar(128) DEFAULT NULL COMMENT '任务回调地址',
`file_name` varchar(128) DEFAULT NULL COMMENT '脚本名',
`file_mode` int(11) DEFAULT NULL COMMENT '文件权限',
`exist_write` tinyint(4) DEFAULT NULL COMMENT '文件存在是否写入',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_task_uuid` (`task_uuid`),
KEY `idx_user_status` (`user_name`, `task_status`)
) ENGINE = InnoDB
AUTO_INCREMENT = 281
DEFAULT CHARSET = utf8mb4 COMMENT ='通道任务表'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = channel_task_host */
/******************************************/
CREATE TABLE `channel_task_host`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` bigint(20) DEFAULT NULL COMMENT 'host任务创建时间',
`gmt_modified` bigint(20) DEFAULT NULL COMMENT 'host任务更新时间',
`task_uuid` varchar(128) NOT NULL COMMENT '任务唯一标识',
`host_uuid` varchar(128) NOT NULL COMMENT 'host唯一标识',
`host_status` int(11) DEFAULT NULL COMMENT 'host状态',
`host_address` varchar(128) DEFAULT NULL COMMENT 'host地址',
`host_type` int(11) DEFAULT NULL COMMENT 'host地址类型',
`error_code` varchar(128) DEFAULT NULL COMMENT '错误码',
`error_message` longtext COMMENT '错误信息',
`exit_code` bigint(20) DEFAULT NULL COMMENT '退出码',
`end_time` bigint(20) DEFAULT NULL COMMENT 'host完成时间',
`host_output` longtext COMMENT '命令输出内容',
`start_time` bigint(20) DEFAULT NULL COMMENT '任务开始时间',
`agent_uuid` varchar(128) DEFAULT NULL COMMENT 'agent执行uuid',
`stderr` longtext COMMENT '错误输出',
PRIMARY KEY (`id`),
KEY `idx_task_status` (`task_uuid`, `host_status`),
KEY `idx_host_uuid` (`host_uuid`),
KEY `idx_agent_uuid` (`agent_uuid`),
KEY `idx_task_host_status` (`task_uuid`, `host_uuid`, `host_status`) COMMENT 'task&host&status联合索引'
) ENGINE = InnoDB
AUTO_INCREMENT = 422
DEFAULT CHARSET = utf8mb4 COMMENT ='通道任务host表'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = tc_dag */
/******************************************/
CREATE TABLE `tc_dag`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
`gmt_modified` bigint(20) NOT NULL COMMENT '更新时间',
`app_id` varchar(128) NOT NULL DEFAULT 'tesla' COMMENT '应用',
`name` varchar(128) NOT NULL COMMENT '名称',
`alias` varchar(128) DEFAULT NULL COMMENT '别名',
`content` longtext NOT NULL COMMENT '图',
`input_params` longtext COMMENT '输入参数',
`has_feedback` tinyint(4) DEFAULT '0' COMMENT '是否打开反馈',
`has_history` tinyint(4) DEFAULT '1' COMMENT '是否保存历史',
`description` longtext COMMENT '描述',
`entity` longtext COMMENT '实体信息',
`notice` varchar(128) DEFAULT NULL COMMENT '通知',
`creator` varchar(128) DEFAULT NULL COMMENT '创建人',
`modifier` varchar(128) DEFAULT NULL COMMENT '最后修改人',
`last_update_by` varchar(128) NOT NULL DEFAULT 'WEB' COMMENT '最后更新方',
`ex_schedule_task_id` varchar(128) DEFAULT NULL COMMENT '外部执行的taskid, 如果为空,则不执行',
`default_show_history` tinyint(4) DEFAULT '0' COMMENT '默认展示历史',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_has_history` (`app_id`, `name`),
KEY `idx_app_id` (`app_id`),
KEY `idx_name` (`name`),
KEY `idx_creator` (`creator`),
KEY `idx_modifier` (`modifier`),
KEY `idx_feedback` (`has_feedback`),
KEY `idx_is_history` (`has_history`)
) ENGINE = InnoDB
AUTO_INCREMENT = 2042
DEFAULT CHARSET = utf8mb4 COMMENT ='场景定义'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = tc_dag_config */
/******************************************/
CREATE TABLE `tc_dag_config`
(
`id` bigint(20) NOT NULL COMMENT '主键',
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
`gmt_modified` bigint(20) NOT NULL COMMENT '最后修改时间',
`name` varchar(128) NOT NULL COMMENT '名称',
`content` longtext COMMENT '内容',
`comment` longtext COMMENT '备注',
PRIMARY KEY (`id`),
KEY `idx_name` (`name`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='配置'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = tc_dag_inst */
/******************************************/
CREATE TABLE `tc_dag_inst`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
`gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
`gmt_access` bigint(20) NOT NULL COMMENT '上次调度的时间',
`app_id` varchar(128) NOT NULL DEFAULT 'tesla' COMMENT '启动的产品方',
`dag_id` bigint(20) NOT NULL COMMENT 'dag的id,用于关联',
`tc_dag_detail` longtext NOT NULL COMMENT '启动时,将dag的全部信息拷贝过来',
`status` varchar(128) NOT NULL COMMENT '执行过程中的状态',
`status_detail` longtext COMMENT '状态对应的详细说明,一般是错误信息',
`global_params` longtext COMMENT '全局参数,提供给faas使用,允许用户修改',
`global_object` longtext COMMENT '全局对象,提供给faas使用,允许用户修改',
`global_variable` longtext COMMENT '全局变量,启动时提供的,不允许用户修改',
`global_result` longtext COMMENT '全局结果,key是node_id,value只有result和output,没有data,因为data太大了,使用data需要实时从执行侧获取',
`lock_id` varchar(128) DEFAULT NULL COMMENT '锁,分布式调度使用',
`creator` varchar(128) NOT NULL COMMENT '启动人,工号',
`is_sub` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否归属于另外一个dag',
`tag` varchar(128) DEFAULT NULL COMMENT '标签,目前使用于entityValue',
`ex_schedule_task_instance_id` varchar(128) DEFAULT NULL COMMENT '外部调度的作业id',
`standalone_ip` varchar(128) DEFAULT NULL COMMENT '单独调度指定的机器ip',
`evaluation_create_ret` longtext COMMENT '评价服务创建后的反馈',
`channel` varchar(128) DEFAULT NULL COMMENT '调用渠道',
`env` varchar(128) DEFAULT NULL COMMENT '调用环境',
PRIMARY KEY (`id`),
KEY `idx_status` (`status`),
KEY `idx_lock_id` (`lock_id`),
KEY `idx_app_id` (`app_id`),
KEY `idx_is_sub` (`is_sub`),
KEY `idx_tag` (`tag`),
KEY `idx_standalone_ip` (`standalone_ip`)
) ENGINE = InnoDB
AUTO_INCREMENT = 10096
DEFAULT CHARSET = utf8mb4 COMMENT ='xxxx'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = tc_dag_inst_edge */
/******************************************/
CREATE TABLE `tc_dag_inst_edge`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
`gmt_modified` bigint(20) NOT NULL COMMENT '最后修改时间',
`dag_inst_id` bigint(20) NOT NULL COMMENT '场景实例',
`source` varchar(128) NOT NULL COMMENT '源节点',
`target` varchar(128) NOT NULL COMMENT '目前节点',
`label` varchar(128) DEFAULT NULL COMMENT '前端标识',
`shape` varchar(128) NOT NULL COMMENT '前端标识',
`style` longtext NOT NULL COMMENT '前端标识',
`data` longtext NOT NULL COMMENT '内容,包含判断条件',
`is_pass` int(11) DEFAULT NULL COMMENT '是否通过',
`exception` longtext COMMENT '错误信息',
`status` varchar(128) NOT NULL DEFAULT 'INIT' COMMENT '判断状态',
PRIMARY KEY (`id`),
KEY `idx_dag_inst_id` (`dag_inst_id`),
KEY `idx_is_pass` (`is_pass`),
KEY `idx_source` (`source`),
KEY `idx_target` (`target`),
KEY `idx_status` (`status`)
) ENGINE = InnoDB
AUTO_INCREMENT = 540
DEFAULT CHARSET = utf8mb4 COMMENT ='边实例'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = tc_dag_inst_node */
/******************************************/
CREATE TABLE `tc_dag_inst_node`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
`gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
`gmt_start` bigint(20) NOT NULL DEFAULT '999999999999999' COMMENT '开始执行时间',
`dag_inst_id` bigint(20) NOT NULL COMMENT '场景实例id',
`node_id` varchar(128) NOT NULL COMMENT '节点id',
`status` varchar(32) NOT NULL COMMENT '状态',
`status_detail` longtext COMMENT '状态详情,一般为错误详情',
`task_id` varchar(128) DEFAULT NULL COMMENT '执行id,本地的id或者作业的id',
`stop_task_id` varchar(128) DEFAULT NULL COMMENT '停止的执行id,只有本地的才有',
`lock_id` varchar(128) DEFAULT NULL COMMENT '锁',
`sub_dag_inst_id` bigint(20) DEFAULT NULL COMMENT '如果node是场景的映射,该场景的实例id',
`tc_dag_or_node_detail` longtext NOT NULL COMMENT '映射场景或者node的详情',
`tc_dag_content_node_spec` longtext NOT NULL COMMENT '映射的是node,node在场景的content定义中的信息',
`retry_times` bigint(20) DEFAULT '0' COMMENT '重试次数,只执行了一次,重试的次数是0',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_lock_id` (`dag_inst_id`, `node_id`),
KEY `idx_dag_inst_id` (`dag_inst_id`),
KEY `idx_node_id` (`node_id`),
KEY `idx_status` (`status`),
KEY `idx_lock_id` (`lock_id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 658
DEFAULT CHARSET = utf8mb4 COMMENT ='节点实例'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = tc_dag_inst_node_std */
/******************************************/
CREATE TABLE `tc_dag_inst_node_std`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
`gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
`status` varchar(32) NOT NULL COMMENT '状态 RUNNING/SUCCESS/EXCEPTION',
`stdout` longtext COMMENT '标准输出',
`stderr` longtext COMMENT '错误输出',
`global_params` longtext COMMENT '全局参数',
`ip` varchar(128) DEFAULT NULL COMMENT '执行机器的ip',
`comment` longtext COMMENT '执行备注',
`is_stop` tinyint(4) DEFAULT NULL COMMENT '是否为停止操作',
`stop_id` bigint(20) DEFAULT NULL COMMENT '执行停止的目标id',
PRIMARY KEY (`id`),
KEY `idx_ip` (`ip`),
KEY `idx_is_stop` (`is_stop`),
KEY `idx_status` (`status`),
KEY `idx_stop_id` (`stop_id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 348
DEFAULT CHARSET = utf8mb4 COMMENT ='执行输出'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = tc_dag_node */
/******************************************/
CREATE TABLE `tc_dag_node`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
`gmt_modified` bigint(20) NOT NULL COMMENT '最后修改时间',
`app_id` varchar(128) NOT NULL COMMENT '产品',
`name` varchar(128) NOT NULL COMMENT '名称,产品下唯一',
`alias` varchar(128) DEFAULT NULL COMMENT '别名',
`description` longtext COMMENT '说明',
`is_share` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否共享',
`input_params` longtext COMMENT '输入参数',
`output_params` longtext COMMENT '输出参数',
`type` varchar(128) NOT NULL COMMENT '执行类型 API FAAS TASK',
`detail` longtext COMMENT '根据不同的执行类型,有不同的内容',
`is_show` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否展示',
`format_type` varchar(128) DEFAULT NULL COMMENT '展示类型',
`format_detail` longtext COMMENT '展示详情',
`creator` varchar(128) DEFAULT NULL COMMENT '创建人',
`modifier` varchar(128) DEFAULT NULL COMMENT '修改人',
`is_support_chatops` tinyint(4) DEFAULT '0' COMMENT '是否支持机器人',
`chatops_detail` longtext COMMENT '机器人展示详情',
`last_update_by` varchar(128) NOT NULL DEFAULT 'WEB' COMMENT '最后由谁修改',
`run_timeout` bigint(20) DEFAULT '0' COMMENT '执行超时时间',
`max_retry_times` bigint(20) DEFAULT '0' COMMENT '重试次数上限,如果是-1则没有上限,0就是不重试',
`retry_expression` longtext COMMENT '重试判断,如果为空,则重试判断不通过',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_app_id_name` (`app_id`, `name`),
KEY `idx_app_id` (`app_id`),
KEY `idx_name` (`name`),
KEY `idx_is_share` (`is_share`),
KEY `idx_last_update_by` (`last_update_by`),
KEY `idx_creator` (`creator`),
KEY `idx_modifier` (`modifier`)
) ENGINE = InnoDB
AUTO_INCREMENT = 14744
DEFAULT CHARSET = utf8mb4 COMMENT ='节点'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = tc_dag_options */
/******************************************/
CREATE TABLE `tc_dag_options`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`locale` varchar(32) NOT NULL COMMENT '地区标识',
`name` varchar(128) NOT NULL COMMENT '名称',
`value` longtext COMMENT '内容',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_locale_name` (`locale`, `name`),
KEY `idx_locale` (`locale`),
KEY `idx_name` (`name`)
) ENGINE = InnoDB
AUTO_INCREMENT = 33408
DEFAULT CHARSET = utf8mb4 COMMENT ='国产化'
;
/******************************************/
/* DatabaseName = teslafaas */
/* TableName = tc_dag_service_node */
/******************************************/
CREATE TABLE `tc_dag_service_node`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
`gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
`ip` varchar(128) NOT NULL COMMENT '机器ip',
`enable` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是够允许',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_ip` (`ip`),
KEY `idx_enable` (`enable`)
) ENGINE = InnoDB
AUTO_INCREMENT = 24
DEFAULT CHARSET = utf8mb4 COMMENT ='节点状态'
; | the_stack |
-- NOTE: DUMMY is replaced by the name of the site
IF (OBJECT_ID('DUMMY.FK_Posts_PostTypeId__PostTypes_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.Posts DROP CONSTRAINT FK_Posts_PostTypeId__PostTypes_Id;
IF (OBJECT_ID('DUMMY.FK_Posts_ParentId__Posts_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.Posts DROP CONSTRAINT FK_Posts_ParentId__Posts_Id;
IF (OBJECT_ID('DUMMY.FK_Posts_OwnerUserId__Users_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.Posts DROP CONSTRAINT FK_Posts_OwnerUserId__Users_Id;
IF (OBJECT_ID('DUMMY.FK_Posts_AcceptedAnswerId__Posts_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.Posts DROP CONSTRAINT FK_Posts_AcceptedAnswerId__Posts_Id;
IF (OBJECT_ID('DUMMY.FK_Comments_PostId__Posts_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.Comments DROP CONSTRAINT FK_Comments_PostId__Posts_Id;
IF (OBJECT_ID('DUMMY.FK_Comments_UserId__Users_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.Comments DROP CONSTRAINT FK_Comments_UserId__Users_Id;
IF (OBJECT_ID('DUMMY.FK_PostLinks_PostId__Posts_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.PostLinks DROP CONSTRAINT FK_PostLinks_PostId__Posts_Id;
IF (OBJECT_ID('DUMMY.FK_PostLinks_RelatedPostId__Posts_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.PostLinks DROP CONSTRAINT FK_PostLinks_RelatedPostId__Posts_Id;
IF (OBJECT_ID('DUMMY.FK_PostLinks_LinkTypeId__LinkTypes_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.PostLinks DROP CONSTRAINT FK_PostLinks_LinkTypeId__LinkTypes_Id;
IF (OBJECT_ID('DUMMY.FK_PostTags_PostId__Posts_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.PostTags DROP CONSTRAINT FK_PostTags_PostId__Posts_Id;
IF (OBJECT_ID('DUMMY.FK_Votes_PostId__Posts_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.Votes DROP CONSTRAINT FK_Votes_PostId__Posts_Id;
IF (OBJECT_ID('DUMMY.FK_Votes_UserId__Users_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.Votes DROP CONSTRAINT FK_Votes_UserId__Users_Id;
IF (OBJECT_ID('DUMMY.FK_Votes_UserId__VoteTypes_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.Votes DROP CONSTRAINT FK_Votes_UserId__VoteTypes_Id;
IF (OBJECT_ID('DUMMY.FK_PostHistory_PostId__Posts_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.PostHistory DROP CONSTRAINT FK_PostHistory_PostId__Posts_Id;
IF (OBJECT_ID('DUMMY.FK_PostHistory_UserId__Users_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.PostHistory DROP CONSTRAINT FK_PostHistory_UserId__Users_Id;
IF (OBJECT_ID('DUMMY.FK_PostHistory_PostHistoryTypeId__PostHistoryTypes_Id', 'F') IS NOT NULL)
ALTER TABLE DUMMY.PostHistory DROP CONSTRAINT FK_PostHistory_PostHistoryTypeId__PostHistoryTypes_Id;
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[Badges]') AND type in (N'U'))
DROP TABLE DUMMY.[Badges];
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[Comments]') AND type in (N'U'))
DROP TABLE DUMMY.[Comments];
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[Posts]') AND type in (N'U'))
DROP TABLE DUMMY.[Posts];
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[PostTags]') AND type in (N'U'))
DROP TABLE DUMMY.[PostTags];
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[PostTypes]') AND type in (N'U'))
DROP TABLE DUMMY.[PostTypes];
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[Users]') AND type in (N'U'))
DROP TABLE DUMMY.[Users];
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[Votes]') AND type in (N'U'))
DROP TABLE DUMMY.[Votes];
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[VoteTypes]') AND type in (N'U'))
DROP TABLE DUMMY.[VoteTypes];
IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'DUMMY.[PostLinks]') AND type IN (N'U'))
DROP TABLE DUMMY.[PostLinks];
IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'DUMMY.[LinkTypes]') AND type IN (N'U'))
DROP TABLE DUMMY.[LinkTypes];
IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'DUMMY.[Tags]') AND type IN (N'U'))
DROP TABLE DUMMY.[Tags];
IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'DUMMY.[PostHistory]') AND type in (N'U'))
DROP TABLE DUMMY.[PostHistory];
IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'DUMMY.[PostHistoryTypes]') AND type IN (N'U'))
DROP TABLE DUMMY.[PostHistoryTypes];
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[Badges]') AND type in (N'U'))
DROP TABLE DUMMY.[Badges]
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[Comments]') AND type in (N'U'))
DROP TABLE DUMMY.[Comments]
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[Posts]') AND type in (N'U'))
DROP TABLE DUMMY.[Posts]
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[PostTags]') AND type in (N'U'))
DROP TABLE DUMMY.[PostTags]
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[PostTypes]') AND type in (N'U'))
DROP TABLE DUMMY.[PostTypes]
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[Users]') AND type in (N'U'))
DROP TABLE DUMMY.[Users]
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[Votes]') AND type in (N'U'))
DROP TABLE DUMMY.[Votes]
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DUMMY.[VoteTypes]') AND type in (N'U'))
DROP TABLE DUMMY.[VoteTypes]
IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'DUMMY.[PostLinks]') AND type IN (N'U'))
DROP TABLE DUMMY.[PostLinks]
IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'DUMMY.[LinkTypes]') AND type IN (N'U'))
DROP TABLE DUMMY.[LinkTypes]
IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'DUMMY.[Tags]') AND type IN (N'U'))
DROP TABLE DUMMY.[Tags];
IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'DUMMY.[PostHistory]') AND type in (N'U'))
DROP TABLE DUMMY.[PostHistory];
IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'DUMMY.[PostHistoryTypes]') AND type IN (N'U'))
DROP TABLE DUMMY.[PostHistoryTypes];
SET ansi_nulls ON
SET quoted_identifier ON
SET ansi_padding ON
CREATE TABLE DUMMY.[LinkTypes] (
Id INT /* IDENTITY */ NOT NULL,
[Type] VARCHAR(50) NOT NULL,
CONSTRAINT PK_LinkTypes__Id PRIMARY KEY CLUSTERED (Id ASC)
);
CREATE TABLE DUMMY.[VoteTypes] (
[Id] [INT] /* IDENTITY */ NOT NULL,
[Name] [VARCHAR](50) NOT NULL ,
CONSTRAINT [PK_VoteType__Id] PRIMARY KEY CLUSTERED ( [Id] ASC ) ON [PRIMARY]
)ON [PRIMARY]
SET ansi_nulls ON
SET quoted_identifier ON
CREATE TABLE DUMMY.[PostTypes] (
[Id] [INT] /* IDENTITY */ NOT NULL,
[Type] [NVARCHAR](50) NOT NULL
, CONSTRAINT [PK_PostTypes__Id] PRIMARY KEY CLUSTERED ( [Id] ASC ) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE DUMMY.[PostHistoryTypes] (
[Id] INT /* IDENTITY */ NOT NULL,
[Type] NVARCHAR(50) NOT NULL,
CONSTRAINT [PK_PostHistoryTypes__Id] PRIMARY KEY CLUSTERED ( [Id] ASC ) ON [PRIMARY]
) ON [PRIMARY]
IF 0 = 1--SPLIT
BEGIN
SET ansi_nulls ON
SET quoted_identifier ON
CREATE TABLE DUMMY.[PostTags] (
[PostId] [INT] /* IDENTITY */ NOT NULL,
[Tag] [NVARCHAR](50) NOT NULL
, CONSTRAINT [PK_PostTags__PostId_Tag] PRIMARY KEY CLUSTERED ( [PostId] ASC,[Tag] ASC ) ON [PRIMARY]
) ON [PRIMARY]
END
--IDENTITY SET IDENTITY_INSERT [DUMMY].[VoteTypes] ON
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(1, N'AcceptedByOriginator')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(2, N'UpMod')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(3, N'DownMod')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(4, N'Offensive')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(5, N'Favorite')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(6, N'Close')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(7, N'Reopen')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(8, N'BountyStart')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(9, N'BountyClose')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(10,N'Deletion')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(11,N'Undeletion')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(12,N'Spam')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(13,N'InformModerator')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(15,N'ModeratorReview')
INSERT DUMMY.[VoteTypes] ([Id], [Name]) VALUES(16,N'ApproveEditSuggestion')
--IDENTITY SET IDENTITY_INSERT [DUMMY].[VoteTypes] OFF
--IDENTITY DBCC CHECKIDENT('DUMMY.VoteTypes', RESEED)
--IDENTITY SET IDENTITY_INSERT [DUMMY].[PostTypes] ON
INSERT DUMMY.[PostTypes] ([Id], [Type]) VALUES(1, N'Question')
INSERT DUMMY.[PostTypes] ([Id], [Type]) VALUES(2, N'Answer')
INSERT DUMMY.[PostTypes] ([Id], [Type]) VALUES(3, N'Wiki')
INSERT DUMMY.[PostTypes] ([Id], [Type]) VALUES(4, N'TagWikiExerpt')
INSERT DUMMY.[PostTypes] ([Id], [Type]) VALUES(5, N'TagWiki')
INSERT DUMMY.[PostTypes] ([Id], [Type]) VALUES(6, N'ModeratorNomination')
INSERT DUMMY.[PostTypes] ([Id], [Type]) VALUES(7, N'WikiPlaceholder')
INSERT DUMMY.[PostTypes] ([Id], [Type]) VALUES(8, N'PrivilegeWiki')
--IDENTITY SET IDENTITY_INSERT [DUMMY].[PostTypes] OFF
--IDENTITY DBCC CHECKIDENT('DUMMY.PostTypes', RESEED)
--IDENTITY SET IDENTITY_INSERT [DUMMY].[LinkTypes] ON
INSERT DUMMY.[LinkTypes] ([Id], [Type]) VALUES(1, N'Linked')
INSERT DUMMY.[LinkTypes] ([Id], [Type]) VALUES(3, N'Duplicate')
--IDENTITY SET IDENTITY_INSERT [DUMMY].[LinkTypes] OFF
--IDENTITY DBCC CHECKIDENT('DUMMY.LinkTypes', RESEED)
--IDENTITY SET IDENTITY_INSERT [DUMMY].[PostHistoryTypes] ON
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(1, N'InitialTitle')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(2, N'InitialBody')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(3, N'InitialTags')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(4, N'EditTitle')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(5, N'EditBody')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(6, N'EditTags')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(7, N'RollbackTitle')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(8, N'RollbackBody')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(9, N'RollbackTags')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(10, N'PostClosed')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(11, N'PostReopened')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(12, N'PostDeleted')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(13, N'PostUndeleted')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(14, N'PostLocked')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(15, N'PostUnlocked')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(16, N'CommunityOwned')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(17, N'PostMigrated')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(18, N'QuestionMerged')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(19, N'QuestionProtected')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(20, N'QuestionUnprotected')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(21, N'PostDisassociated')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(22, N'QuestionUnmerged')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(23, N'UnknownDevRelatedEvent')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(24, N'SuggestedEditApplied')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(25, N'PostTweeted')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(26, N'VoteNullificationByDev')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(27, N'PostUnmigrated')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(28, N'UnknownSuggestionEvent')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(29, N'UnknownModeratorEvent')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(30, N'UnknownEvent')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(31, N'CommentDiscussionMovedToChat')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(33, N'PostNoticeAdded')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(34, N'PostNoticeRemoved')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(35, N'PostMigratedAway')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(36, N'PostMigratedHere')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(37, N'PostMergeSource')
INSERT DUMMY.[PostHistoryTypes] ([Id], [Type]) VALUES(38, N'PostMergeDestination')
--IDENTITY SET IDENTITY_INSERT [DUMMY].[PostHistoryTypes] OFF
--IDENTITY DBCC CHECKIDENT('DUMMY.PostHistoryTypes', RESEED)
IF 0 = 1--FULLTEXT
BEGIN
IF EXISTS (SELECT * FROM sys.fulltext_indexes fti WHERE fti.object_id = OBJECT_ID(N'DUMMY.[Posts]'))
ALTER FULLTEXT INDEX ON DUMMY.[Posts] DISABLE
IF EXISTS (SELECT * FROM sys.fulltext_indexes fti WHERE fti.object_id = OBJECT_ID(N'DUMMY.[Posts]'))
DROP FULLTEXT INDEX ON DUMMY.[Posts]
IF EXISTS (SELECT * FROM sysfulltextcatalogs ftc WHERE ftc.name = N'PostFullText')
DROP FULLTEXT CATALOG [PostFullText]
CREATE FULLTEXT CATALOG [PostFullText]WITH ACCENT_SENSITIVITY = ON
AUTHORIZATION dbo
END
SET ansi_padding OFF
SET ansi_nulls ON
SET quoted_identifier ON
CREATE TABLE DUMMY.[Votes] (
[Id] [INT] /* IDENTITY */ NOT NULL,
[PostId] [INT] NOT NULL,
[UserId] [INT] NULL,
[BountyAmount] [INT] NULL,
[VoteTypeId] [INT] NOT NULL,
[CreationDate] [DATETIME] NOT NULL
, CONSTRAINT [PK_Votes__Id] PRIMARY KEY CLUSTERED ( [Id] ASC ) ON [PRIMARY]
) ON [PRIMARY]
IF 0 = 1-- INDICES
BEGIN
CREATE NONCLUSTERED INDEX [IX_Votes__Id_PostId] ON DUMMY.[Votes] (
[Id] ASC,
[PostId] ASC)
ON [PRIMARY];
CREATE NONCLUSTERED INDEX [IX_Votes__VoteTypeId] ON DUMMY.[Votes] (
[VoteTypeId] ASC)
ON [PRIMARY];
END
SET ansi_nulls ON
SET quoted_identifier ON
CREATE TABLE DUMMY.[Users] (
[Id] [INT] /* IDENTITY */ NOT NULL,
[AboutMe] [NVARCHAR](MAX) NULL,
[Age] [INT] NULL,
[CreationDate] [DATETIME] NOT NULL,
[DisplayName] [NVARCHAR](40) NOT NULL,
[DownVotes] [INT] NOT NULL,
[EmailHash] [NVARCHAR](40) NULL,
[LastAccessDate] [DATETIME] NOT NULL,
[Location] [NVARCHAR](100) NULL,
[Reputation] [INT] NOT NULL,
[UpVotes] [INT] NOT NULL,
[Views] [INT] NOT NULL,
[WebsiteUrl] [NVARCHAR](200) NULL,
[AccountId] [INT] NULL
, CONSTRAINT [PK_Users_Id] PRIMARY KEY CLUSTERED ( [Id] ASC ) ON [PRIMARY]
) ON [PRIMARY]
IF 0 = 1-- INDICES
BEGIN
CREATE NONCLUSTERED INDEX [IX_Users__DisplayName] ON DUMMY.[Users] (
[DisplayName] ASC)
ON [PRIMARY]
END
SET ansi_nulls ON
SET quoted_identifier ON
CREATE TABLE DUMMY.[Posts] (
[Id] [INT] /* IDENTITY */ NOT NULL,
[AcceptedAnswerId] [INT] NULL,
[AnswerCount] [INT] NULL,
[Body] [NVARCHAR](MAX) NOT NULL,
[ClosedDate] [DATETIME] NULL,
[CommentCount] [INT] NULL,
[CommunityOwnedDate] [DATETIME] NULL,
[CreationDate] [DATETIME] NOT NULL,
[FavoriteCount] [INT] NULL,
[LastActivityDate] [DATETIME] NOT NULL,
[LastEditDate] [DATETIME] NULL,
[LastEditorDisplayName] [NVARCHAR](40) NULL,
[LastEditorUserId] [INT] NULL,
[OwnerUserId] [INT] NULL,
[ParentId] [INT] NULL,
[PostTypeId] [INT] NOT NULL,
[Score] [INT] NOT NULL,
[Tags] [NVARCHAR](150) NULL,
[Title] [NVARCHAR](250) NULL,
[ViewCount] [INT] NOT NULL
, CONSTRAINT [PK_Posts__Id] PRIMARY KEY CLUSTERED ( [Id] ASC ) ON [PRIMARY]
-- INDICES ,CONSTRAINT [IX_Posts_Id_AcceptedAnswerId] UNIQUE NONCLUSTERED ([Id] ASC,[AcceptedAnswerId] ASC ) ON [PRIMARY],
-- INDICES CONSTRAINT [IX_Posts_Id_OwnerUserId] UNIQUE NONCLUSTERED ([Id] ASC,[OwnerUserId] ASC ) ON [PRIMARY],
-- INDICES CONSTRAINT [IX_Posts_Id_ParentId] UNIQUE NONCLUSTERED ([Id] ASC,[ParentId] ASC ) ON [PRIMARY]
)ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
IF 0 = 1-- INDICES
BEGIN
CREATE NONCLUSTERED INDEX [IX_Posts__Id_PostTypeId] ON DUMMY.[Posts] (
[Id] ASC,
[PostTypeId] ASC)
ON [PRIMARY];
CREATE NONCLUSTERED INDEX [IX_Posts__PostType] ON DUMMY.[Posts] (
[PostTypeId] ASC)
ON [PRIMARY];
END
IF 0 = 1--FULLTEXT
BEGIN
EXEC dbo.Sp_fulltext_table
@tabname = N'DUMMY.[Posts]' ,
@action = N'create' ,
@keyname = N'PK_Posts__Id' ,
@ftcat = N'PostFullText'
DECLARE @lcid INT
SELECT @lcid = lcid
FROM MASTER.dbo.syslanguages
WHERE alias = N'English'
EXEC dbo.Sp_fulltext_column
@tabname = N'DUMMY.[Posts]' ,
@colname = N'Body' ,
@action = N'add' ,
@language = @lcid
SELECT @lcid = lcid
FROM MASTER.dbo.syslanguages
WHERE alias = N'English'
EXEC dbo.Sp_fulltext_column
@tabname = N'DUMMY.[Posts]' ,
@colname = N'Title' ,
@action = N'add' ,
@language = @lcid
EXEC dbo.Sp_fulltext_table
@tabname = N'DUMMY.[Posts]' ,
@action = N'start_change_tracking'
EXEC dbo.Sp_fulltext_table
@tabname = N'DUMMY.[Posts]' ,
@action = N'start_background_updateindex'
END
SET ansi_nulls ON
SET quoted_identifier ON
CREATE TABLE DUMMY.[Comments] (
[Id] [INT] /* IDENTITY */ NOT NULL,
[CreationDate] [DATETIME] NOT NULL,
[PostId] [INT] NOT NULL,
[Score] [INT] NULL,
[Text] [NVARCHAR](700) NOT NULL,
[UserId] [INT] NULL
, CONSTRAINT [PK_Comments__Id] PRIMARY KEY CLUSTERED ( [Id] ASC ) ON [PRIMARY]
) ON [PRIMARY]
IF 0 = 1-- INDICES
BEGIN
CREATE NONCLUSTERED INDEX [IX_Comments__Id_PostId] ON DUMMY.[Comments] (
[Id] ASC,
[PostId] ASC)
ON [PRIMARY];
CREATE NONCLUSTERED INDEX [IX_Comments__Id_UserId] ON DUMMY.[Comments] (
[Id] ASC,
[UserId] ASC)
ON [PRIMARY];
END
SET ansi_nulls ON
SET quoted_identifier ON
CREATE TABLE DUMMY.[Badges] (
[Id] [INT] /* IDENTITY */ NOT NULL,
[Name] [NVARCHAR](40) NOT NULL,
[UserId] [INT] NOT NULL,
[Date] [DATETIME] NOT NULL
, CONSTRAINT [PK_Badges__Id] PRIMARY KEY CLUSTERED ( [Id] ASC ) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE DUMMY.[PostLinks] (
Id INT /* IDENTITY */ NOT NULL,
CreationDate DATETIME NOT NULL,
PostId INT NOT NULL,
RelatedPostId INT NOT NULL,
LinkTypeId INT NOT NULL,
CONSTRAINT [PK_PostLinks__Id] PRIMARY KEY CLUSTERED ([Id] ASC)
)
CREATE TABLE DUMMY.[Tags] (
[Id] INT /* IDENTITY */ NOT NULL,
[TagName] NVARCHAR(150) NOT NULL,
[Count] INT NOT NULL,
[ExcerptPostId] INT NOT NULL,
[WikiPostId] INT NOT NULL,
CONSTRAINT [PK_Tags__Id] PRIMARY KEY CLUSTERED ([Id] ASC) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE DUMMY.[PostHistory] (
[Id] INT /* IDENTITY */ NOT NULL,
[PostHistoryTypeId] INT NOT NULL,
[PostId] INT NOT NULL,
[RevisionGUID] UNIQUEIDENTIFIER NOT NULL,
[CreationDate] DATETIME NOT NULL,
[UserId] INT NULL,
[UserDisplayName] NVARCHAR(40) NULL,
[Comment] NVARCHAR(MAX) NULL,
[Text] NVARCHAR(MAX) NULL,
CONSTRAINT [PK_PostHistory__Id] PRIMARY KEY CLUSTERED ([Id] ASC) ON [PRIMARY]
) ON [PRIMARY]
IF 0 = 1-- INDICES
BEGIN
CREATE NONCLUSTERED INDEX [IX_Badges__Id_UserId] ON DUMMY.[Badges] (
[Id] ASC,
[UserId] ASC)
ON [PRIMARY];
END
IF 0 = 1--FK
BEGIN
ALTER TABLE Posts
ADD CONSTRAINT FK_Posts_PostTypeId__PostTypes_Id FOREIGN KEY (PostTypeId) REFERENCES PostTypes(Id)
ALTER TABLE Posts
ADD CONSTRAINT FK_Posts_ParentId__Posts_Id FOREIGN KEY (ParentId) REFERENCES Posts(Id)
ALTER TABLE Posts
ADD CONSTRAINT FK_Posts_OwnerUserId__Users_Id FOREIGN KEY (OwnerUserId) REFERENCES Users(Id)
ALTER TABLE Posts
ADD CONSTRAINT FK_Posts_AcceptedAnswerId__Posts_Id FOREIGN KEY (AcceptedAnswerId) REFERENCES Posts(Id)
ALTER TABLE Comments
ADD CONSTRAINT FK_Comments_PostId__Posts_Id FOREIGN KEY (PostId) REFERENCES Posts(Id)
ALTER TABLE Comments
ADD CONSTRAINT FK_Comments_UserId__Users_Id FOREIGN KEY (UserId) REFERENCES Users(Id)
ALTER TABLE PostHistory
ADD CONSTRAINT FK_PostHistory_PostId__Posts_Id FOREIGN KEY (PostId) REFERENCES Posts(Id)
ALTER TABLE PostHistory
ADD CONSTRAINT FK_PostHistory_UserId__Users_Id FOREIGN KEY (UserId) REFERENCES Users(Id)
ALTER TABLE PostHistory
ADD CONSTRAINT FK_PostHistory_PostHistoryTypeId__PostHistoryTypes_Id FOREIGN KEY (PostHistoryTypeId) REFERENCES PostHistoryTypes(Id)
ALTER TABLE PostLinks
ADD CONSTRAINT FK_PostLinks_PostId__Posts_Id FOREIGN KEY (PostId) REFERENCES Posts(Id)
ALTER TABLE PostLinks
ADD CONSTRAINT FK_PostLinks_RelatedPostId__Posts_Id FOREIGN KEY (RelatedPostId) REFERENCES Posts(Id)
ALTER TABLE PostLinks
ADD CONSTRAINT FK_PostLinks_LinkTypeId__LinkTypes_Id FOREIGN KEY (LinkTypeId) REFERENCES LinkTypes(Id)
IF 0 = 1--SPLIT
BEGIN
ALTER TABLE PostTags
ADD CONSTRAINT FK_PostTags_PostId__Posts_Id FOREIGN KEY (PostId) REFERENCES Posts(Id)
END
ALTER TABLE Votes
ADD CONSTRAINT FK_Votes_PostId__Posts_Id FOREIGN KEY (PostId) REFERENCES Posts(Id)
ALTER TABLE Votes
ADD CONSTRAINT FK_Votes_UserId__Users_Id FOREIGN KEY (UserId) REFERENCES Users(Id)
ALTER TABLE Votes
ADD CONSTRAINT FK_Votes_UserId__VoteTypes_Id FOREIGN KEY (VoteTypeId) REFERENCES VoteTypes(Id)
END | the_stack |
-- 2019-09-18T11:57:59.411Z
-- URL zum Konzept
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy,Value) VALUES (0,0,662,541496,TO_TIMESTAMP('2019-09-18 14:57:59','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2019-09-18 14:57:59','YYYY-MM-DD HH24:MI:SS'),100,'main')
;
-- 2019-09-18T11:57:59.427Z
-- URL zum Konzept
INSERT INTO AD_UI_Section_Trl (AD_Language,AD_UI_Section_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_UI_Section_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_UI_Section t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_UI_Section_ID=541496 AND NOT EXISTS (SELECT 1 FROM AD_UI_Section_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_UI_Section_ID=t.AD_UI_Section_ID)
;
-- 2019-09-18T11:58:39.724Z
-- URL zum Konzept
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,541911,541496,TO_TIMESTAMP('2019-09-18 14:58:39','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2019-09-18 14:58:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T11:59:06.939Z
-- URL zum Konzept
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,541911,542891,TO_TIMESTAMP('2019-09-18 14:59:06','YYYY-MM-DD HH24:MI:SS'),100,'Y','Greeting & Name',10,'primary',TO_TIMESTAMP('2019-09-18 14:59:06','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:00:39.533Z
-- URL zum Konzept
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,541911,542892,TO_TIMESTAMP('2019-09-18 15:00:39','YYYY-MM-DD HH24:MI:SS'),100,'Y','Sprache & Mitarbeiter',20,TO_TIMESTAMP('2019-09-18 15:00:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:04:43.136Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,56370,0,662,561826,542891,'F',TO_TIMESTAMP('2019-09-18 15:04:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Verbucht',10,0,0,TO_TIMESTAMP('2019-09-18 15:04:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:07:18.688Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,10447,0,662,561827,542891,'F',TO_TIMESTAMP('2019-09-18 15:07:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Nr.',20,0,0,TO_TIMESTAMP('2019-09-18 15:07:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:08:05.345Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,10446,0,662,561828,542891,'F',TO_TIMESTAMP('2019-09-18 15:08:05','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Verkaufs-Transaktion',30,0,0,TO_TIMESTAMP('2019-09-18 15:08:05','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:08:26.432Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,10450,0,662,561829,542891,'F',TO_TIMESTAMP('2019-09-18 15:08:26','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Belegdatum',40,0,0,TO_TIMESTAMP('2019-09-18 15:08:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:09:17.914Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,10452,0,662,561830,542891,'F',TO_TIMESTAMP('2019-09-18 15:09:17','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Buchungsdatum',50,0,0,TO_TIMESTAMP('2019-09-18 15:09:17','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:09:50.584Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,56369,0,662,561831,542891,'F',TO_TIMESTAMP('2019-09-18 15:09:50','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Belegstatus',60,0,0,TO_TIMESTAMP('2019-09-18 15:09:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:10:14.774Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,56371,0,662,561832,542891,'F',TO_TIMESTAMP('2019-09-18 15:10:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Verarbeitet',70,0,0,TO_TIMESTAMP('2019-09-18 15:10:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:10:40.625Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,56372,0,662,561833,542891,'F',TO_TIMESTAMP('2019-09-18 15:10:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Verarbeiten',80,0,0,TO_TIMESTAMP('2019-09-18 15:10:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:10:56.371Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,10445,0,662,561834,542891,'F',TO_TIMESTAMP('2019-09-18 15:10:56','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Aktiv',90,0,0,TO_TIMESTAMP('2019-09-18 15:10:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:11:36.504Z
-- URL zum Konzept
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=542892
;
-- 2019-09-18T12:12:09.420Z
-- URL zum Konzept
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,541912,541496,TO_TIMESTAMP('2019-09-18 15:12:09','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2019-09-18 15:12:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:13:40.589Z
-- URL zum Konzept
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,541912,542893,TO_TIMESTAMP('2019-09-18 15:13:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','flags',10,TO_TIMESTAMP('2019-09-18 15:13:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:14:16.309Z
-- URL zum Konzept
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542893, SeqNo=10,Updated=TO_TIMESTAMP('2019-09-18 15:14:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561827
;
-- 2019-09-18T12:14:27.393Z
-- URL zum Konzept
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542893, SeqNo=20,Updated=TO_TIMESTAMP('2019-09-18 15:14:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561834
;
-- 2019-09-18T12:15:53.224Z
-- URL zum Konzept
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542893, SeqNo=30,Updated=TO_TIMESTAMP('2019-09-18 15:15:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561828
;
-- 2019-09-18T12:16:06.772Z
-- URL zum Konzept
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542893, SeqNo=40,Updated=TO_TIMESTAMP('2019-09-18 15:16:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561832
;
-- 2019-09-18T12:16:13.760Z
-- URL zum Konzept
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542893, SeqNo=50,Updated=TO_TIMESTAMP('2019-09-18 15:16:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561833
;
-- 2019-09-18T12:28:03.054Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2019-09-18 15:28:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561834
;
-- 2019-09-18T12:28:03.055Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2019-09-18 15:28:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561829
;
-- 2019-09-18T12:28:03.057Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2019-09-18 15:28:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561831
;
-- 2019-09-18T12:28:03.058Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2019-09-18 15:28:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561830
;
-- 2019-09-18T12:28:03.059Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2019-09-18 15:28:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561827
;
-- 2019-09-18T12:28:03.061Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2019-09-18 15:28:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561833
;
-- 2019-09-18T12:28:03.062Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2019-09-18 15:28:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561832
;
-- 2019-09-18T12:28:03.064Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2019-09-18 15:28:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561826
;
-- 2019-09-18T12:28:03.065Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2019-09-18 15:28:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561828
;
-- 2019-09-18T12:39:14.190Z
-- URL zum Konzept
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Element_ID,AD_Menu_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,Description,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES ('W',0,574146,541368,0,294,TO_TIMESTAMP('2019-09-18 15:39:14','YYYY-MM-DD HH24:MI:SS'),100,'Nicht verbuchte Belege','D','UnPosted Documents','Y','N','N','N','N','Ungebuchte Belege',TO_TIMESTAMP('2019-09-18 15:39:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T12:39:14.191Z
-- URL zum Konzept
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Menu_ID, t.Description,t.Name,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Menu_ID=541368 AND NOT EXISTS (SELECT 1 FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 2019-09-18T12:39:14.200Z
-- URL zum Konzept
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 541368, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=541368)
;
-- 2019-09-18T12:39:14.249Z
-- URL zum Konzept
/* DDL */ select update_menu_translation_from_ad_element(574146)
;
-- 2019-09-18T12:39:22.380Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=53324 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.383Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=241 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.383Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=288 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.384Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=432 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.384Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=243 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.385Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=413 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.385Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=538 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.385Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=462 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.386Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=505 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.386Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=235 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.387Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=511 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.387Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=245 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.388Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=251 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.388Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=246 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.389Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=509 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.389Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=510 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.389Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=496 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.390Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=304 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.390Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=255 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.391Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=19, Updated=now(), UpdatedBy=100 WHERE Node_ID=286 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.391Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=20, Updated=now(), UpdatedBy=100 WHERE Node_ID=287 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.392Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=21, Updated=now(), UpdatedBy=100 WHERE Node_ID=438 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.392Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=22, Updated=now(), UpdatedBy=100 WHERE Node_ID=234 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.392Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=23, Updated=now(), UpdatedBy=100 WHERE Node_ID=244 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.393Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=24, Updated=now(), UpdatedBy=100 WHERE Node_ID=53190 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.393Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=25, Updated=now(), UpdatedBy=100 WHERE Node_ID=53187 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.394Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=26, Updated=now(), UpdatedBy=100 WHERE Node_ID=540642 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.394Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=27, Updated=now(), UpdatedBy=100 WHERE Node_ID=540651 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.394Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=28, Updated=now(), UpdatedBy=100 WHERE Node_ID=540666 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.395Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=29, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000103 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:22.395Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=30, Updated=now(), UpdatedBy=100 WHERE Node_ID=541368 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.164Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000008 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.164Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=541091 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.165Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000009 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.165Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000010 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.166Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000011 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.166Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=540752 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.167Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000012 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.167Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000013 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.168Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000014 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.169Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000017 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.169Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000018 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.170Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000015 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.171Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000016 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.171Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000019 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.172Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=541012 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.173Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=541368 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.173Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=541329 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.173Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=541229 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.174Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=540833 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.174Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=19, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000098 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.175Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=20, Updated=now(), UpdatedBy=100 WHERE Node_ID=541085 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:36.175Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=21, Updated=now(), UpdatedBy=100 WHERE Node_ID=540861 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.720Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000087 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.721Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540970 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.721Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540728 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.722Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540783 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.722Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=541251 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.723Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=541250 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.723Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540841 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.724Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540868 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.724Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=541138 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.725Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=541368 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.725Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540971 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.726Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540949 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.726Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=540950 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.727Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=540976 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.727Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000060 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.728Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000068 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:40.729Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000079 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.393Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540905 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.394Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540814 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.395Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=541297 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.395Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540803 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.396Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=540904 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.396Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=540749 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.397Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540779 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.398Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540910 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.398Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=541308 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.399Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=541313 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.399Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540758 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.400Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540759 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.400Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=540806 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.401Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=540891 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.401Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=540896 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.402Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=540903 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.402Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=540906 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.403Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=540907 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.404Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=540908 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.404Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=19, Updated=now(), UpdatedBy=100 WHERE Node_ID=541015 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.405Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=20, Updated=now(), UpdatedBy=100 WHERE Node_ID=541016 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.405Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=21, Updated=now(), UpdatedBy=100 WHERE Node_ID=541042 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.406Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=22, Updated=now(), UpdatedBy=100 WHERE Node_ID=541368 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.407Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=23, Updated=now(), UpdatedBy=100 WHERE Node_ID=541120 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.407Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=24, Updated=now(), UpdatedBy=100 WHERE Node_ID=541125 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.408Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=25, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000056 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.409Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=26, Updated=now(), UpdatedBy=100 WHERE Node_ID=541304 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.409Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=27, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000064 AND AD_Tree_ID=10
;
-- 2019-09-18T12:39:46.410Z
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=28, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000072 AND AD_Tree_ID=10
;
-- 2019-09-18T12:44:18.015Z
-- URL zum Konzept
UPDATE AD_Column SET DefaultValue='N', IsMandatory='Y',Updated=TO_TIMESTAMP('2019-09-18 15:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56349
;
-- 2019-09-18T12:45:45.991Z
-- URL zum Konzept
UPDATE AD_Column SET AD_Reference_ID=20, DefaultValue='N', IsMandatory='Y',Updated=TO_TIMESTAMP('2019-09-18 15:45:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56347
;
-- 2019-09-18T13:01:00.314Z
-- URL zum Konzept
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542891, SeqNo=70,Updated=TO_TIMESTAMP('2019-09-18 16:01:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561827
;
-- 2019-09-18T13:02:40.192Z
-- URL zum Konzept
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542893, SeqNo=60,Updated=TO_TIMESTAMP('2019-09-18 16:02:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561826
;
-- 2019-09-18T13:03:12.914Z
-- URL zum Konzept
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2019-09-18 16:03:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561831
;
-- 2019-09-18T13:03:20.897Z
-- URL zum Konzept
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2019-09-18 16:03:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561827
;
-- 2019-09-18T13:03:30.977Z
-- URL zum Konzept
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2019-09-18 16:03:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561830
;
-- 2019-09-18T13:04:03.160Z
-- URL zum Konzept
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2019-09-18 16:04:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561834
;
-- 2019-09-18T13:04:26.395Z
-- URL zum Konzept
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2019-09-18 16:04:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561828
;
-- 2019-09-18T13:04:33.001Z
-- URL zum Konzept
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2019-09-18 16:04:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561832
;
-- 2019-09-18T13:04:39.868Z
-- URL zum Konzept
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2019-09-18 16:04:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561833
;
-- 2019-09-18T13:04:54.094Z
-- URL zum Konzept
UPDATE AD_UI_Element SET SeqNo=90,Updated=TO_TIMESTAMP('2019-09-18 16:04:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561826
;
-- 2019-09-18T13:05:20.726Z
-- URL zum Konzept
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,541912,542894,TO_TIMESTAMP('2019-09-18 16:05:20','YYYY-MM-DD HH24:MI:SS'),100,'Y','Org',20,TO_TIMESTAMP('2019-09-18 16:05:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T13:06:18.827Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,10449,0,662,561835,542891,'F',TO_TIMESTAMP('2019-09-18 16:06:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Record',100,0,0,TO_TIMESTAMP('2019-09-18 16:06:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T13:08:20.794Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,10451,0,662,561836,542891,'F',TO_TIMESTAMP('2019-09-18 16:08:20','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Table',110,0,0,TO_TIMESTAMP('2019-09-18 16:08:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T13:09:06.997Z
-- URL zum Konzept
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542894, SeqNo=10,Updated=TO_TIMESTAMP('2019-09-18 16:09:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561836
;
-- 2019-09-18T13:09:15.095Z
-- URL zum Konzept
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542894, SeqNo=20,Updated=TO_TIMESTAMP('2019-09-18 16:09:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561835
;
-- 2019-09-18T13:22:02.217Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2019-09-18 16:22:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10448
;
-- 2019-09-18T13:25:48.587Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,10448,0,662,561838,542894,'F',TO_TIMESTAMP('2019-09-18 16:25:48','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Mandant',120,0,0,TO_TIMESTAMP('2019-09-18 16:25:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T13:26:14.900Z
-- URL zum Konzept
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,10453,0,662,561839,542894,'F',TO_TIMESTAMP('2019-09-18 16:26:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Sektion',130,0,0,TO_TIMESTAMP('2019-09-18 16:26:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T13:29:39.999Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=10,Updated=TO_TIMESTAMP('2019-09-18 16:29:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10447
;
-- 2019-09-18T13:29:56.665Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=20,Updated=TO_TIMESTAMP('2019-09-18 16:29:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56369
;
-- 2019-09-18T13:30:00.337Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=30,Updated=TO_TIMESTAMP('2019-09-18 16:30:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10450
;
-- 2019-09-18T13:30:10.883Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=40,Updated=TO_TIMESTAMP('2019-09-18 16:30:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10452
;
-- 2019-09-18T13:30:24.034Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=50,Updated=TO_TIMESTAMP('2019-09-18 16:30:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10445
;
-- 2019-09-18T13:30:30.314Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=60,Updated=TO_TIMESTAMP('2019-09-18 16:30:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56372
;
-- 2019-09-18T13:30:34.156Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=70,Updated=TO_TIMESTAMP('2019-09-18 16:30:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56370
;
-- 2019-09-18T13:30:46.087Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=80,Updated=TO_TIMESTAMP('2019-09-18 16:30:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56371
;
-- 2019-09-18T13:30:49.067Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=90,Updated=TO_TIMESTAMP('2019-09-18 16:30:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10449
;
-- 2019-09-18T13:31:05.584Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=100,Updated=TO_TIMESTAMP('2019-09-18 16:31:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10451
;
-- 2019-09-18T13:31:17.683Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=110,Updated=TO_TIMESTAMP('2019-09-18 16:31:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10446
;
-- 2019-09-18T13:31:25.578Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2019-09-18 16:31:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10453
;
-- 2019-09-18T13:31:59.867Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=110,Updated=TO_TIMESTAMP('2019-09-18 16:31:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10449
;
-- 2019-09-18T13:32:08.907Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=90,Updated=TO_TIMESTAMP('2019-09-18 16:32:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10446
;
-- 2019-09-18T13:32:43.634Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=NULL,Updated=TO_TIMESTAMP('2019-09-18 16:32:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56369
;
-- 2019-09-18T13:32:53.114Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=NULL,Updated=TO_TIMESTAMP('2019-09-18 16:32:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10447
;
-- 2019-09-18T13:33:03.441Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=20,Updated=TO_TIMESTAMP('2019-09-18 16:33:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10447
;
-- 2019-09-18T13:33:29.017Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=10,Updated=TO_TIMESTAMP('2019-09-18 16:33:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56369
;
-- 2019-09-18T13:34:04.264Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=NULL,Updated=TO_TIMESTAMP('2019-09-18 16:34:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10448
;
-- 2019-09-18T13:34:15.932Z
-- URL zum Konzept
UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2019-09-18 16:34:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10448
;
-- 2019-09-18T13:38:48.268Z
-- URL zum Konzept
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,541912,542895,TO_TIMESTAMP('2019-09-18 16:38:48','YYYY-MM-DD HH24:MI:SS'),100,'Y','table',20,TO_TIMESTAMP('2019-09-18 16:38:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-18T13:38:58.131Z
-- URL zum Konzept
UPDATE AD_UI_ElementGroup SET Name='org', SeqNo=30,Updated=TO_TIMESTAMP('2019-09-18 16:38:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=542894
;
-- 2019-09-18T13:41:52.830Z
-- URL zum Konzept
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542895, SeqNo=10,Updated=TO_TIMESTAMP('2019-09-18 16:41:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561836
;
-- 2019-09-18T13:41:58.023Z
-- URL zum Konzept
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542895, SeqNo=20,Updated=TO_TIMESTAMP('2019-09-18 16:41:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561835
;
-- 2019-09-18T13:47:09.258Z
-- URL zum Konzept
UPDATE AD_UI_Element SET SeqNo=130,Updated=TO_TIMESTAMP('2019-09-18 16:47:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561838
;
-- 2019-09-18T13:47:17.689Z
-- URL zum Konzept
UPDATE AD_UI_Element SET SeqNo=120,Updated=TO_TIMESTAMP('2019-09-18 16:47:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561839
;
-- 2019-09-18T13:58:30.113Z
-- URL zum Konzept
UPDATE AD_UI_ElementGroup SET AD_UI_Column_ID=541911, SeqNo=20,Updated=TO_TIMESTAMP('2019-09-18 16:58:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=542895
; | the_stack |
-- 28.06.2016 16:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543100,0,'RfQ_Invitation_MailText_ID',TO_TIMESTAMP('2016-06-28 16:50:37','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.rfq','Y','RfQ Invitation mail text','RfQ Invitation mail text',TO_TIMESTAMP('2016-06-28 16:50:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.06.2016 16:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543100 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 28.06.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543101,0,'RfQ_Win_MailText_ID',TO_TIMESTAMP('2016-06-28 16:53:26','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.rfq','Y','RfQ win mail text','RfQ win mail text',TO_TIMESTAMP('2016-06-28 16:53:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.06.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543101 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 28.06.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543102,0,'RfQ_Lost_MailText_ID',TO_TIMESTAMP('2016-06-28 16:53:45','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.rfq','Y','RfQ lost mail text','RfQ lost mail text',TO_TIMESTAMP('2016-06-28 16:53:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.06.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543102 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 28.06.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,554467,543100,0,18,274,671,'N','RfQ_Invitation_MailText_ID',TO_TIMESTAMP('2016-06-28 16:54:12','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.rfq',10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','RfQ Invitation mail text',0,TO_TIMESTAMP('2016-06-28 16:54:12','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 28.06.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=554467 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 28.06.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE C_RfQ_Topic ADD RfQ_Invitation_MailText_ID NUMERIC(10) DEFAULT NULL
;
-- 28.06.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,554468,543101,0,18,274,671,'N','RfQ_Win_MailText_ID',TO_TIMESTAMP('2016-06-28 16:54:36','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.rfq',10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','RfQ win mail text',0,TO_TIMESTAMP('2016-06-28 16:54:36','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 28.06.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=554468 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 28.06.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE C_RfQ_Topic ADD RfQ_Win_MailText_ID NUMERIC(10) DEFAULT NULL
;
-- 28.06.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,554469,543102,0,18,274,671,'N','RfQ_Lost_MailText_ID',TO_TIMESTAMP('2016-06-28 16:54:53','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.rfq',10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','RfQ lost mail text',0,TO_TIMESTAMP('2016-06-28 16:54:53','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 28.06.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=554469 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 28.06.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE C_RfQ_Topic ADD RfQ_Lost_MailText_ID NUMERIC(10) DEFAULT NULL
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,554467,557002,0,619,TO_TIMESTAMP('2016-06-28 16:55:10','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.rfq','Y','Y','Y','N','N','N','N','N','RfQ Invitation mail text',TO_TIMESTAMP('2016-06-28 16:55:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=557002 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,554468,557003,0,619,TO_TIMESTAMP('2016-06-28 16:55:10','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.rfq','Y','Y','Y','N','N','N','N','N','RfQ win mail text',TO_TIMESTAMP('2016-06-28 16:55:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=557003 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,554469,557004,0,619,TO_TIMESTAMP('2016-06-28 16:55:10','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.rfq','Y','Y','Y','N','N','N','N','N','RfQ lost mail text',TO_TIMESTAMP('2016-06-28 16:55:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=557004 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='N', SeqNo=0,Updated=TO_TIMESTAMP('2016-06-28 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9413
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=10,Updated=TO_TIMESTAMP('2016-06-28 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9416
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=20,Updated=TO_TIMESTAMP('2016-06-28 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9414
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=30,Updated=TO_TIMESTAMP('2016-06-28 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9415
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=40,Updated=TO_TIMESTAMP('2016-06-28 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9411
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=50,Updated=TO_TIMESTAMP('2016-06-28 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9412
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=60,Updated=TO_TIMESTAMP('2016-06-28 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9410
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=70,Updated=TO_TIMESTAMP('2016-06-28 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10311
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=80,Updated=TO_TIMESTAMP('2016-06-28 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557002
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90,Updated=TO_TIMESTAMP('2016-06-28 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557004
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=100,Updated=TO_TIMESTAMP('2016-06-28 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557003
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2016-06-28 16:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9413
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2016-06-28 16:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9416
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2016-06-28 16:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9414
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2016-06-28 16:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9415
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2016-06-28 16:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9411
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2016-06-28 16:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9412
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2016-06-28 16:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9410
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2016-06-28 16:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10311
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2016-06-28 16:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557002
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2016-06-28 16:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557004
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2016-06-28 16:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557003
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2016-06-28 16:55:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10311
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2016-06-28 16:55:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557002
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2016-06-28 16:55:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557004
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2016-06-28 16:55:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557003
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='N', SeqNo=0,Updated=TO_TIMESTAMP('2016-06-28 16:55:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10311
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=70,Updated=TO_TIMESTAMP('2016-06-28 16:55:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557002
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=80,Updated=TO_TIMESTAMP('2016-06-28 16:55:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557004
;
-- 28.06.2016 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90,Updated=TO_TIMESTAMP('2016-06-28 16:55:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557003
;
-- 28.06.2016 16:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_FieldGroup (AD_Client_ID,AD_FieldGroup_ID,AD_Org_ID,Created,CreatedBy,EntityType,FieldGroupType,IsActive,IsCollapsedByDefault,Name,Updated,UpdatedBy) VALUES (0,540085,0,TO_TIMESTAMP('2016-06-28 16:58:09','YYYY-MM-DD HH24:MI:SS'),100,'D','C','Y','N','EMail',TO_TIMESTAMP('2016-06-28 16:58:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.06.2016 16:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_FieldGroup_Trl (AD_Language,AD_FieldGroup_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_FieldGroup_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_FieldGroup t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_FieldGroup_ID=540085 AND NOT EXISTS (SELECT * FROM AD_FieldGroup_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_FieldGroup_ID=t.AD_FieldGroup_ID)
;
-- 28.06.2016 16:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_FieldGroup_ID=540085,Updated=TO_TIMESTAMP('2016-06-28 16:58:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557002
;
-- 28.06.2016 16:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_FieldGroup_ID=540085,Updated=TO_TIMESTAMP('2016-06-28 16:58:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557004
;
-- 28.06.2016 16:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_FieldGroup_ID=540085,Updated=TO_TIMESTAMP('2016-06-28 16:58:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557003
;
-- 28.06.2016 16:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=80,Updated=TO_TIMESTAMP('2016-06-28 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557003
;
-- 28.06.2016 16:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90,Updated=TO_TIMESTAMP('2016-06-28 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557004
;
-- 28.06.2016 16:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2016-06-28 16:58:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557003
;
-- 28.06.2016 16:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2016-06-28 16:58:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557004
; | the_stack |
-- 2019-04-07T06:29:02.692
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Max. Wartezeit auf asynchrone Antwort (ms).',Updated=TO_TIMESTAMP('2019-04-07 06:29:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576559 AND AD_Language='de_CH'
;
-- 2019-04-07T06:29:02.767
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576559,'de_CH')
;
-- 2019-04-07T06:29:05.945
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Max. Wartezeit auf asynchrone Antwort (ms)',Updated=TO_TIMESTAMP('2019-04-07 06:29:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576559 AND AD_Language='de_CH'
;
-- 2019-04-07T06:29:06.006
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576559,'de_CH')
;
-- 2019-04-07T06:29:55.207
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Async timeout (ms) ',Updated=TO_TIMESTAMP('2019-04-07 06:29:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576559 AND AD_Language='en_US'
;
-- 2019-04-07T06:29:55.253
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576559,'en_US')
;
-- 2019-04-07T06:29:58.376
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Async timeout (ms)',Updated=TO_TIMESTAMP('2019-04-07 06:29:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576559 AND AD_Language='en_US'
;
-- 2019-04-07T06:29:58.422
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576559,'en_US')
;
-- 2019-04-07T06:30:48.348
-- URL zum Konzept
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=275 AND AD_Language='fr_CH'
;
-- 2019-04-07T06:30:48.430
-- URL zum Konzept
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=275 AND AD_Language='it_CH'
;
-- 2019-04-07T06:30:48.509
-- URL zum Konzept
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=275 AND AD_Language='en_GB'
;
-- 2019-04-07T06:30:53.975
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-04-07 06:30:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=275 AND AD_Language='de_CH'
;
-- 2019-04-07T06:30:54.050
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(275,'de_CH')
;
-- 2019-04-07T06:31:01.761
-- URL zum Konzept
UPDATE AD_Element_Trl SET Description='', Help='',Updated=TO_TIMESTAMP('2019-04-07 06:31:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=275 AND AD_Language='en_US'
;
-- 2019-04-07T06:31:01.844
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(275,'en_US')
;
-- 2019-04-07T06:31:08.624
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Beschreibung ',Updated=TO_TIMESTAMP('2019-04-07 06:31:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=275 AND AD_Language='de_DE'
;
-- 2019-04-07T06:31:08.695
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(275,'de_DE')
;
-- 2019-04-07T06:31:08.755
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(275,'de_DE')
;
-- 2019-04-07T06:31:08.757
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='Description', Name='Beschreibung ', Description=NULL, Help=NULL WHERE AD_Element_ID=275
;
-- 2019-04-07T06:31:08.794
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='Description', Name='Beschreibung ', Description=NULL, Help=NULL, AD_Element_ID=275 WHERE UPPER(ColumnName)='DESCRIPTION' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-04-07T06:31:08.797
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='Description', Name='Beschreibung ', Description=NULL, Help=NULL WHERE AD_Element_ID=275 AND IsCentrallyMaintained='Y'
;
-- 2019-04-07T06:31:08.798
-- URL zum Konzept
UPDATE AD_Field SET Name='Beschreibung ', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=275) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 275)
;
-- 2019-04-07T06:31:08.845
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Beschreibung', Name='Beschreibung ' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=275)
;
-- 2019-04-07T06:31:08.854
-- URL zum Konzept
UPDATE AD_Tab SET Name='Beschreibung ', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 275
;
-- 2019-04-07T06:31:08.856
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Beschreibung ', Description=NULL, Help=NULL WHERE AD_Element_ID = 275
;
-- 2019-04-07T06:31:08.858
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Beschreibung ', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 275
;
-- 2019-04-07T06:31:10.874
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Beschreibung',Updated=TO_TIMESTAMP('2019-04-07 06:31:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=275 AND AD_Language='de_DE'
;
-- 2019-04-07T06:31:10.925
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(275,'de_DE')
;
-- 2019-04-07T06:31:10.991
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(275,'de_DE')
;
-- 2019-04-07T06:31:10.993
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='Description', Name='Beschreibung', Description=NULL, Help=NULL WHERE AD_Element_ID=275
;
-- 2019-04-07T06:31:11.011
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='Description', Name='Beschreibung', Description=NULL, Help=NULL, AD_Element_ID=275 WHERE UPPER(ColumnName)='DESCRIPTION' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-04-07T06:31:11.014
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='Description', Name='Beschreibung', Description=NULL, Help=NULL WHERE AD_Element_ID=275 AND IsCentrallyMaintained='Y'
;
-- 2019-04-07T06:31:11.015
-- URL zum Konzept
UPDATE AD_Field SET Name='Beschreibung', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=275) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 275)
;
-- 2019-04-07T06:31:11.041
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Beschreibung', Name='Beschreibung' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=275)
;
-- 2019-04-07T06:31:11.051
-- URL zum Konzept
UPDATE AD_Tab SET Name='Beschreibung', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 275
;
-- 2019-04-07T06:31:11.053
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Beschreibung', Description=NULL, Help=NULL WHERE AD_Element_ID = 275
;
-- 2019-04-07T06:31:11.055
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Beschreibung', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 275
;
-- 2019-04-07T06:34:01.040
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Vorausschauinterval zu gepl. Lieferungen (Std) ',Updated=TO_TIMESTAMP('2019-04-07 06:34:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576545 AND AD_Language='de_CH'
;
-- 2019-04-07T06:34:01.098
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576545,'de_CH')
;
-- 2019-04-07T06:34:05.809
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Vorausschauinterval zu gepl. Lieferungen (Std) ',Updated=TO_TIMESTAMP('2019-04-07 06:34:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576545 AND AD_Language='de_DE'
;
-- 2019-04-07T06:34:05.862
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576545,'de_DE')
;
-- 2019-04-07T06:34:05.869
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(576545,'de_DE')
;
-- 2019-04-07T06:34:05.872
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='ShipmentDateLookAheadHours', Name='Vorausschauinterval zu gepl. Lieferungen (Std) ', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.' WHERE AD_Element_ID=576545
;
-- 2019-04-07T06:34:05.874
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='ShipmentDateLookAheadHours', Name='Vorausschauinterval zu gepl. Lieferungen (Std) ', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.', AD_Element_ID=576545 WHERE UPPER(ColumnName)='SHIPMENTDATELOOKAHEADHOURS' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-04-07T06:34:05.876
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='ShipmentDateLookAheadHours', Name='Vorausschauinterval zu gepl. Lieferungen (Std) ', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.' WHERE AD_Element_ID=576545 AND IsCentrallyMaintained='Y'
;
-- 2019-04-07T06:34:05.877
-- URL zum Konzept
UPDATE AD_Field SET Name='Vorausschauinterval zu gepl. Lieferungen (Std) ', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=576545) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 576545)
;
-- 2019-04-07T06:34:05.888
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Vorausschauinterval zu gepl. Lieferungen (Std)', Name='Vorausschauinterval zu gepl. Lieferungen (Std) ' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=576545)
;
-- 2019-04-07T06:34:05.890
-- URL zum Konzept
UPDATE AD_Tab SET Name='Vorausschauinterval zu gepl. Lieferungen (Std) ', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.', CommitWarning = NULL WHERE AD_Element_ID = 576545
;
-- 2019-04-07T06:34:05.892
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Vorausschauinterval zu gepl. Lieferungen (Std) ', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.' WHERE AD_Element_ID = 576545
;
-- 2019-04-07T06:34:05.897
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Vorausschauinterval zu gepl. Lieferungen (Std) ', Description = 'Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 576545
;
-- 2019-04-07T06:34:08.505
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Vorausschauinterval zu gepl. Lieferungen (Std)',Updated=TO_TIMESTAMP('2019-04-07 06:34:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576545 AND AD_Language='de_DE'
;
-- 2019-04-07T06:34:08.563
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576545,'de_DE')
;
-- 2019-04-07T06:34:08.574
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(576545,'de_DE')
;
-- 2019-04-07T06:34:08.576
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='ShipmentDateLookAheadHours', Name='Vorausschauinterval zu gepl. Lieferungen (Std)', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.' WHERE AD_Element_ID=576545
;
-- 2019-04-07T06:34:08.577
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='ShipmentDateLookAheadHours', Name='Vorausschauinterval zu gepl. Lieferungen (Std)', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.', AD_Element_ID=576545 WHERE UPPER(ColumnName)='SHIPMENTDATELOOKAHEADHOURS' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-04-07T06:34:08.579
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='ShipmentDateLookAheadHours', Name='Vorausschauinterval zu gepl. Lieferungen (Std)', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.' WHERE AD_Element_ID=576545 AND IsCentrallyMaintained='Y'
;
-- 2019-04-07T06:34:08.580
-- URL zum Konzept
UPDATE AD_Field SET Name='Vorausschauinterval zu gepl. Lieferungen (Std)', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=576545) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 576545)
;
-- 2019-04-07T06:34:08.591
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Vorausschauinterval zu gepl. Lieferungen (Std)', Name='Vorausschauinterval zu gepl. Lieferungen (Std)' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=576545)
;
-- 2019-04-07T06:34:08.593
-- URL zum Konzept
UPDATE AD_Tab SET Name='Vorausschauinterval zu gepl. Lieferungen (Std)', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.', CommitWarning = NULL WHERE AD_Element_ID = 576545
;
-- 2019-04-07T06:34:08.595
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Vorausschauinterval zu gepl. Lieferungen (Std)', Description='Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', Help='Geplante Lieferungen sind offene Lieferdispo-Positionen mit einem Bereitstellungsdatum das nicht zu weit in der Zukunft liegt und daher noch relevant ist.
Beispiel: wenn es üblicherweise drei Tage dauert, bis fehlende Lagerbestände ausgeglichen sind, sollte der Wert auf 72 gesetzt werden.' WHERE AD_Element_ID = 576545
;
-- 2019-04-07T06:34:08.596
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Vorausschauinterval zu gepl. Lieferungen (Std)', Description = 'Interval in Stunden ab Bereitstellungsdatum des aktuellen Auftrags, innerhalb dessen geplante Lieferungen berücktsichtigt werden sollen. Sollte abhängig vom üblichen Zulaufinterval gesetzt werden.', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 576545
;
-- 2019-04-07T06:34:11.478
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Lookahead interval for planned shipments (hr) ',Updated=TO_TIMESTAMP('2019-04-07 06:34:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576545 AND AD_Language='en_US'
;
-- 2019-04-07T06:34:11.535
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576545,'en_US')
;
-- 2019-04-07T06:34:14.542
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Lookahead interval for planned shipments (hr)',Updated=TO_TIMESTAMP('2019-04-07 06:34:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576545 AND AD_Language='en_US'
;
-- 2019-04-07T06:34:14.596
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576545,'en_US')
;
-- 2019-04-07T06:36:03.154
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Feature aktivtiert ',Updated=TO_TIMESTAMP('2019-04-07 06:36:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576552 AND AD_Language='de_CH'
;
-- 2019-04-07T06:36:03.243
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576552,'de_CH')
;
-- 2019-04-07T06:36:31.890
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Feature aktivtiert',Updated=TO_TIMESTAMP('2019-04-07 06:36:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576552 AND AD_Language='de_CH'
;
-- 2019-04-07T06:36:31.978
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576552,'de_CH')
;
-- 2019-04-07T06:36:34.057
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Feature aktivtiert ',Updated=TO_TIMESTAMP('2019-04-07 06:36:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576552 AND AD_Language='de_DE'
;
-- 2019-04-07T06:36:34.116
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576552,'de_DE')
;
-- 2019-04-07T06:36:34.125
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(576552,'de_DE')
;
-- 2019-04-07T06:36:34.127
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='IsFeatureActivated', Name='Feature aktivtiert ', Description=NULL, Help=NULL WHERE AD_Element_ID=576552
;
-- 2019-04-07T06:36:34.128
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='IsFeatureActivated', Name='Feature aktivtiert ', Description=NULL, Help=NULL, AD_Element_ID=576552 WHERE UPPER(ColumnName)='ISFEATUREACTIVATED' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-04-07T06:36:34.130
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='IsFeatureActivated', Name='Feature aktivtiert ', Description=NULL, Help=NULL WHERE AD_Element_ID=576552 AND IsCentrallyMaintained='Y'
;
-- 2019-04-07T06:36:34.131
-- URL zum Konzept
UPDATE AD_Field SET Name='Feature aktivtiert ', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=576552) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 576552)
;
-- 2019-04-07T06:36:34.142
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Feature aktivtiert', Name='Feature aktivtiert ' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=576552)
;
-- 2019-04-07T06:36:34.144
-- URL zum Konzept
UPDATE AD_Tab SET Name='Feature aktivtiert ', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 576552
;
-- 2019-04-07T06:36:34.146
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Feature aktivtiert ', Description=NULL, Help=NULL WHERE AD_Element_ID = 576552
;
-- 2019-04-07T06:36:34.147
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Feature aktivtiert ', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 576552
;
-- 2019-04-07T06:36:36.407
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Feature aktivtiert',Updated=TO_TIMESTAMP('2019-04-07 06:36:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576552 AND AD_Language='de_DE'
;
-- 2019-04-07T06:36:36.489
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576552,'de_DE')
;
-- 2019-04-07T06:36:36.503
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(576552,'de_DE')
;
-- 2019-04-07T06:36:36.505
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='IsFeatureActivated', Name='Feature aktivtiert', Description=NULL, Help=NULL WHERE AD_Element_ID=576552
;
-- 2019-04-07T06:36:36.506
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='IsFeatureActivated', Name='Feature aktivtiert', Description=NULL, Help=NULL, AD_Element_ID=576552 WHERE UPPER(ColumnName)='ISFEATUREACTIVATED' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-04-07T06:36:36.507
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='IsFeatureActivated', Name='Feature aktivtiert', Description=NULL, Help=NULL WHERE AD_Element_ID=576552 AND IsCentrallyMaintained='Y'
;
-- 2019-04-07T06:36:36.508
-- URL zum Konzept
UPDATE AD_Field SET Name='Feature aktivtiert', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=576552) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 576552)
;
-- 2019-04-07T06:36:36.519
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Feature aktivtiert', Name='Feature aktivtiert' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=576552)
;
-- 2019-04-07T06:36:36.521
-- URL zum Konzept
UPDATE AD_Tab SET Name='Feature aktivtiert', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 576552
;
-- 2019-04-07T06:36:36.523
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Feature aktivtiert', Description=NULL, Help=NULL WHERE AD_Element_ID = 576552
;
-- 2019-04-07T06:36:36.524
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Feature aktivtiert', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 576552
;
-- 2019-04-07T06:36:38.760
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Feature activated ',Updated=TO_TIMESTAMP('2019-04-07 06:36:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576552 AND AD_Language='en_US'
;
-- 2019-04-07T06:36:38.819
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576552,'en_US')
;
-- 2019-04-07T06:36:42.157
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Feature activated',Updated=TO_TIMESTAMP('2019-04-07 06:36:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576552 AND AD_Language='en_US'
;
-- 2019-04-07T06:36:42.204
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576552,'en_US')
;
--
-- delete date result columns;
-- they prevent matching oder lines from being aggregated and therefore cause the onStock-qty to be multiplied in the end result.
--
-- 2019-04-07T07:17:59.751
-- URL zum Konzept
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=567364
;
-- 2019-04-07T07:17:59.759
-- URL zum Konzept
DELETE FROM AD_Column WHERE AD_Column_ID=567364
;
-- 2019-04-07T07:18:10.540
-- URL zum Konzept
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=567363
;
-- 2019-04-07T07:18:10.547
-- URL zum Konzept
DELETE FROM AD_Column WHERE AD_Column_ID=567363
;
DROP FUNCTION IF EXISTS de_metas_material.retrieve_available_for_sales(integer, numeric, character varying, timestamptz, integer, integer);
CREATE FUNCTION de_metas_material.retrieve_available_for_sales(
IN p_QueryNo integer,
IN p_M_Product_ID numeric,
IN p_StorageAttributesKey character varying,
IN p_PreparationDate timestamptz,
IN p_shipmentDateLookAheadHours integer,
IN p_salesOrderLookBehindHours integer)
RETURNS TABLE
( QueryNo integer,
M_Product_ID numeric,
StorageAttributesKey character varying,
QtyToBeShipped numeric,
QtyOnHandStock numeric,
C_UOM_ID numeric
)
AS
$BODY$
SELECT
p_QueryNo,
p_M_Product_ID,
p_StorageAttributesKey,
QtyToBeShipped,
QtyOnHandStock,
stock.C_UOM_ID
FROM
(
SELECT
SUM(QtyToBeShipped) AS QtyToBeShipped,
C_UOM_ID
FROM de_metas_material.MD_ShipmentQty_V sq
WHERE sq.M_Product_ID = p_M_Product_ID
AND sq.AttributesKey ILIKE '%' || p_StorageAttributesKey || '%'
AND ( /*max. future PreparationDates we still care about; avoiding coalesce in an attempt to make it easier for the planner */
sq.s_PreparationDate_Override <= (p_PreparationDate + (p_shipmentDateLookAheadHours || ' hours')::INTERVAL)
OR sq.s_PreparationDate_Override IS NULL AND sq.s_PreparationDate <= (p_PreparationDate + (p_shipmentDateLookAheadHours || ' hours')::INTERVAL)
OR sq.s_PreparationDate_Override IS NULL AND sq.s_PreparationDate IS NULL AND sq.o_PreparationDate <= (p_PreparationDate + (p_shipmentDateLookAheadHours || ' hours')::INTERVAL)
)
AND (sq.SalesOrderLastUpdated IS NULL /*could have used COALESCE(sq.SalesOrderLastUpdated, now()), but i hope this makes it easier for the planner*/
OR sq.SalesOrderLastUpdated >= (now() - (p_salesOrderLookBehindHours || ' hours')::INTERVAL) /*min updated value that is not yet too old for us to care */
)
GROUP BY C_UOM_ID
) sales
FULL OUTER JOIN (
SELECT SUM(QtyOnHand) AS QtyOnHandStock, p.C_UOM_ID
FROM MD_Stock s
JOIN M_Product p ON p.M_Product_ID=s.M_Product_ID
WHERE s.M_Product_ID = p_M_Product_ID
AND s.AttributesKey ILIKE '%' || p_StorageAttributesKey || '%'
AND s.IsActive='Y'
GROUP BY C_UOM_ID
) stock ON TRUE
$BODY$
LANGUAGE sql STABLE;
COMMENT ON FUNCTION de_metas_material.retrieve_available_for_sales(integer, numeric, character varying, timestamptz, integer, integer) IS
'Returns the current stock and the shipments to be expected in the nearest future.
Parameters:
* p_QueryNo: the given value is returend in the QueryNo result column; used by the function invoker in the context of select .. union.
* p_M_Product_ID
* p_StorageAttributesKey: the function will return rows whose attributesKey is a substring of this parameter. -1002 means "no storage attributes".
* p_PreparationDate: the date in question, where the respective quantity would have to be available. Returned rows have a ShipmentPreparationDate and SalesOrderLastUpdated within a certain range around this parameter''s value.
* p_shipmentDateLookAheadHours: returned rows have a ShipmentPreparationDate not after p_PreparationDate plus the given number of hours.
* p_salesOrderLookBehindHours: Used to ignore old/stale sales order lines. Returned rows have a SalesOrderLastUpdated date not before now() minus the given number of hours.
Also see https://github.com/metasfresh/metasfresh/issues/5108'
; | the_stack |
GRANT USAGE ON SCHEMA periods TO PUBLIC;
REVOKE ALL
ON TABLE periods.periods, periods.system_time_periods,
periods.for_portion_views, periods.unique_keys,
periods.foreign_keys, periods.system_versioning
FROM PUBLIC;
GRANT SELECT
ON TABLE periods.periods, periods.system_time_periods,
periods.for_portion_views, periods.unique_keys,
periods.foreign_keys, periods.system_versioning
TO PUBLIC;
ALTER TABLE periods.system_versioning
ALTER COLUMN func_as_of SET DATA TYPE text,
ALTER COLUMN func_between SET DATA TYPE text,
ALTER COLUMN func_between_symmetric SET DATA TYPE text,
ALTER COLUMN func_from_to SET DATA TYPE text
;
ALTER FUNCTION periods.add_for_portion_view(regclass,name) SECURITY DEFINER;
ALTER FUNCTION periods.add_foreign_key(regclass,name[],name,name,periods.fk_match_types,periods.fk_actions,periods.fk_actions,name,name,name,name,name) SECURITY DEFINER;
ALTER FUNCTION periods.add_period(regclass,name,name,name,regtype,name) SECURITY DEFINER;
ALTER FUNCTION periods.add_system_time_period(regclass,name,name,name,name,name,name,name,name[]) SECURITY DEFINER;
ALTER FUNCTION periods.add_system_versioning(regclass,name,name,name,name,name,name) SECURITY DEFINER;
ALTER FUNCTION periods.add_unique_key(regclass,name[],name,name,name,name) SECURITY DEFINER;
ALTER FUNCTION periods.drop_for_portion_view(regclass,name,periods.drop_behavior,boolean) SECURITY DEFINER;
ALTER FUNCTION periods.drop_foreign_key(regclass,name) SECURITY DEFINER;
ALTER FUNCTION periods.drop_period(regclass,name,periods.drop_behavior,boolean) SECURITY DEFINER;
ALTER FUNCTION periods.drop_protection() SECURITY DEFINER;
ALTER FUNCTION periods.drop_system_versioning(regclass,periods.drop_behavior,boolean) SECURITY DEFINER;
ALTER FUNCTION periods.drop_system_time_period(table_name regclass,drop_behavior periods.drop_behavior,purge boolean) SECURITY DEFINER;
ALTER FUNCTION periods.drop_unique_key(regclass,name,periods.drop_behavior,boolean) SECURITY DEFINER;
ALTER FUNCTION periods.generated_always_as_row_start_end() SECURITY DEFINER;
ALTER FUNCTION periods.health_checks() SECURITY DEFINER;
ALTER FUNCTION periods.rename_following() SECURITY DEFINER;
ALTER FUNCTION periods.set_system_time_period_excluded_columns(regclass,name[]) SECURITY DEFINER;
ALTER FUNCTION periods.truncate_system_versioning() SECURITY DEFINER;
ALTER FUNCTION periods.write_history() SECURITY DEFINER;
CREATE OR REPLACE FUNCTION periods.add_for_portion_view(table_name regclass DEFAULT NULL, period_name name DEFAULT NULL)
RETURNS boolean
LANGUAGE plpgsql
SECURITY DEFINER
AS
$function$
#variable_conflict use_variable
DECLARE
r record;
view_name name;
trigger_name name;
BEGIN
/*
* If table_name and period_name are specified, then just add the views for that.
*
* If no period is specified, add the views for all periods of the table.
*
* If no table is specified, add the views everywhere.
*
* If no table is specified but a period is, that doesn't make any sense.
*/
IF table_name IS NULL AND period_name IS NOT NULL THEN
RAISE EXCEPTION 'cannot specify period name without table name';
END IF;
/* Can't use FOR PORTION OF on SYSTEM_TIME columns */
IF period_name = 'system_time' THEN
RAISE EXCEPTION 'cannot use FOR PORTION OF on SYSTEM_TIME periods';
END IF;
/* Always serialize operations on our catalogs */
PERFORM periods._serialize(table_name);
/*
* We require the table to have a primary key, so check to see if there is
* one. This requires a lock on the table so no one removes it after we
* check and before we commit.
*/
EXECUTE format('LOCK TABLE %s IN ACCESS SHARE MODE', table_name);
/* Now check for the primary key */
IF NOT EXISTS (
SELECT FROM pg_catalog.pg_constraint AS c
WHERE (c.conrelid, c.contype) = (table_name, 'p'))
THEN
RAISE EXCEPTION 'table "%" must have a primary key', table_name;
END IF;
FOR r IN
SELECT n.nspname AS schema_name, c.relname AS table_name, c.relowner AS table_owner, p.period_name
FROM periods.periods AS p
JOIN pg_catalog.pg_class AS c ON c.oid = p.table_name
JOIN pg_catalog.pg_namespace AS n ON n.oid = c.relnamespace
WHERE (table_name IS NULL OR p.table_name = table_name)
AND (period_name IS NULL OR p.period_name = period_name)
AND p.period_name <> 'system_time'
AND NOT EXISTS (
SELECT FROM periods.for_portion_views AS _fpv
WHERE (_fpv.table_name, _fpv.period_name) = (p.table_name, p.period_name))
LOOP
view_name := periods._choose_portion_view_name(r.table_name, r.period_name);
trigger_name := 'for_portion_of_' || r.period_name;
EXECUTE format('CREATE VIEW %1$I.%2$I AS TABLE %1$I.%3$I', r.schema_name, view_name, r.table_name);
EXECUTE format('ALTER VIEW %1$I.%2$I OWNER TO %s', r.schema_name, view_name, r.table_owner::regrole);
EXECUTE format('CREATE TRIGGER %I INSTEAD OF UPDATE ON %I.%I FOR EACH ROW EXECUTE PROCEDURE periods.update_portion_of()',
trigger_name, r.schema_name, view_name);
INSERT INTO periods.for_portion_views (table_name, period_name, view_name, trigger_name)
VALUES (format('%I.%I', r.schema_name, r.table_name), r.period_name, format('%I.%I', r.schema_name, view_name), trigger_name);
END LOOP;
RETURN true;
END;
$function$;
CREATE OR REPLACE FUNCTION periods.add_system_versioning(
table_class regclass,
history_table_name name DEFAULT NULL,
view_name name DEFAULT NULL,
function_as_of_name name DEFAULT NULL,
function_between_name name DEFAULT NULL,
function_between_symmetric_name name DEFAULT NULL,
function_from_to_name name DEFAULT NULL)
RETURNS void
LANGUAGE plpgsql
SECURITY DEFINER
AS
$function$
#variable_conflict use_variable
DECLARE
schema_name name;
table_name name;
table_owner regrole;
persistence "char";
kind "char";
period_row periods.periods;
history_table_id oid;
sql text;
grantees text;
BEGIN
IF table_class IS NULL THEN
RAISE EXCEPTION 'no table name specified';
END IF;
/* Always serialize operations on our catalogs */
PERFORM periods._serialize(table_class);
/*
* REFERENCES:
* SQL:2016 4.15.2.2
* SQL:2016 11.3 SR 2.3
* SQL:2016 11.3 GR 1.c
* SQL:2016 11.29
*/
/* Already registered? SQL:2016 11.29 SR 5 */
IF EXISTS (SELECT FROM periods.system_versioning AS r WHERE r.table_name = table_class) THEN
RAISE EXCEPTION 'table already has SYSTEM VERSIONING';
END IF;
/* Must be a regular persistent base table. SQL:2016 11.29 SR 2 */
SELECT n.nspname, c.relname, c.relowner, c.relpersistence, c.relkind
INTO schema_name, table_name, table_owner, persistence, kind
FROM pg_catalog.pg_class AS c
JOIN pg_catalog.pg_namespace AS n ON n.oid = c.relnamespace
WHERE c.oid = table_class;
IF kind <> 'r' THEN
/*
* The main reason partitioned tables aren't supported yet is simply
* because I haven't put any thought into it.
* Maybe it's trivial, maybe not.
*/
IF kind = 'p' THEN
RAISE EXCEPTION 'partitioned tables are not supported yet';
END IF;
RAISE EXCEPTION 'relation % is not a table', $1;
END IF;
IF persistence <> 'p' THEN
/*
* We could probably accept unlogged tables if the history table is
* also unlogged, but what's the point?
*/
RAISE EXCEPTION 'table "%" must be persistent', table_class;
END IF;
/* We need a SYSTEM_TIME period. SQL:2016 11.29 SR 4 */
SELECT p.*
INTO period_row
FROM periods.periods AS p
WHERE (p.table_name, p.period_name) = (table_class, 'system_time');
IF NOT FOUND THEN
RAISE EXCEPTION 'no period for SYSTEM_TIME found for table %', table_class;
END IF;
/* Get all of our "fake" infrastructure ready */
history_table_name := coalesce(history_table_name, periods._choose_name(ARRAY[table_name], 'history'));
view_name := coalesce(view_name, periods._choose_name(ARRAY[table_name], 'with_history'));
function_as_of_name := coalesce(function_as_of_name, periods._choose_name(ARRAY[table_name], '_as_of'));
function_between_name := coalesce(function_between_name, periods._choose_name(ARRAY[table_name], '_between'));
function_between_symmetric_name := coalesce(function_between_symmetric_name, periods._choose_name(ARRAY[table_name], '_between_symmetric'));
function_from_to_name := coalesce(function_from_to_name, periods._choose_name(ARRAY[table_name], '_from_to'));
/*
* Create the history table. If it already exists we check that all the
* columns match but otherwise we trust the user. Perhaps the history
* table was disconnected in order to change the schema (a case which is
* not defined by the SQL standard). Or perhaps the user wanted to
* partition the history table.
*
* There shouldn't be any concurrency issues here because our main catalog
* is locked.
*/
SELECT c.oid
INTO history_table_id
FROM pg_catalog.pg_class AS c
JOIN pg_catalog.pg_namespace AS n ON n.oid = c.relnamespace
WHERE (n.nspname, c.relname) = (schema_name, history_table_name);
IF FOUND THEN
/* Don't allow any periods on the history table (this might be relaxed later) */
IF EXISTS (SELECT FROM periods.periods AS p WHERE p.table_name = history_table_id) THEN
RAISE EXCEPTION 'history tables for SYSTEM VERSIONING cannot have periods';
END IF;
/*
* The query to the attributes is harder than one would think because
* we need to account for dropped columns. Basically what we're
* looking for is that all columns have the same name, type, and
* collation.
*/
IF EXISTS (
WITH
L (attname, atttypid, atttypmod, attcollation) AS (
SELECT a.attname, a.atttypid, a.atttypmod, a.attcollation
FROM pg_catalog.pg_attribute AS a
WHERE a.attrelid = table_class
AND NOT a.attisdropped
),
R (attname, atttypid, atttypmod, attcollation) AS (
SELECT a.attname, a.atttypid, a.atttypmod, a.attcollation
FROM pg_catalog.pg_attribute AS a
WHERE a.attrelid = history_table_id
AND NOT a.attisdropped
)
SELECT FROM L NATURAL FULL JOIN R
WHERE L.attname IS NULL OR R.attname IS NULL)
THEN
RAISE EXCEPTION 'base table "%" and history table "%" are not compatible',
table_class, history_table_id::regclass;
END IF;
/* Make sure the owner is correct */
EXECUTE format('ALTER TABLE %s OWNER TO %I', history_table_id::regclass, table_owner);
/*
* Remove all privileges other than SELECT from everyone on the history
* table. We do this without error because some privileges may have
* been added in order to do maintenance while we were disconnected.
*
* We start by doing the table owner because that will make sure we
* don't have NULL in pg_class.relacl.
*/
--EXECUTE format('REVOKE INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON TABLE %s FROM %I',
--history_table_id::regclass, table_owner);
ELSE
EXECUTE format('CREATE TABLE %1$I.%2$I (LIKE %1$I.%3$I)', schema_name, history_table_name, table_name);
history_table_id := format('%I.%I', schema_name, history_table_name)::regclass;
EXECUTE format('ALTER TABLE %1$I.%2$I OWNER TO %3$I', schema_name, history_table_name, table_owner);
RAISE NOTICE 'history table "%" created for "%", be sure to index it properly',
history_table_id::regclass, table_class;
END IF;
/* Create the "with history" view. This one we do want to error out on if it exists. */
EXECUTE format(
/*
* The query we really want here is
*
* CREATE VIEW view_name AS
* TABLE table_name
* UNION ALL CORRESPONDING
* TABLE history_table_name
*
* but PostgreSQL doesn't support that syntax (yet), so we have to do
* it manually.
*/
'CREATE VIEW %1$I.%2$I AS SELECT %5$s FROM %1$I.%3$I UNION ALL SELECT %5$s FROM %1$I.%4$I',
schema_name, view_name, table_name, history_table_name,
(SELECT string_agg(quote_ident(a.attname), ', ' ORDER BY a.attnum)
FROM pg_attribute AS a
WHERE a.attrelid = table_class
AND a.attnum > 0
AND NOT a.attisdropped
));
EXECUTE format('ALTER VIEW %1$I.%2$I OWNER TO %3$I', schema_name, view_name, table_owner);
/*
* Create functions to simulate the system versioned grammar. These must
* be inlinable for any kind of performance.
*/
EXECUTE format(
$$
CREATE FUNCTION %1$I.%2$I(timestamp with time zone)
RETURNS SETOF %1$I.%3$I
LANGUAGE sql
STABLE
AS 'SELECT * FROM %1$I.%3$I WHERE %4$I <= $1 AND %5$I > $1'
$$, schema_name, function_as_of_name, view_name, period_row.start_column_name, period_row.end_column_name);
EXECUTE format('ALTER FUNCTION %1$I.%2$I(timestamp with time zone) OWNER TO %3$I',
schema_name, function_as_of_name, table_owner);
EXECUTE format(
$$
CREATE FUNCTION %1$I.%2$I(timestamp with time zone, timestamp with time zone)
RETURNS SETOF %1$I.%3$I
LANGUAGE sql
STABLE
AS 'SELECT * FROM %1$I.%3$I WHERE $1 <= $2 AND %5$I > $1 AND %4$I <= $2'
$$, schema_name, function_between_name, view_name, period_row.start_column_name, period_row.end_column_name);
EXECUTE format('ALTER FUNCTION %1$I.%2$I(timestamp with time zone, timestamp with time zone) OWNER TO %3$I',
schema_name, function_between_name, table_owner);
EXECUTE format(
$$
CREATE FUNCTION %1$I.%2$I(timestamp with time zone, timestamp with time zone)
RETURNS SETOF %1$I.%3$I
LANGUAGE sql
STABLE
AS 'SELECT * FROM %1$I.%3$I WHERE %5$I > least($1, $2) AND %4$I <= greatest($1, $2)'
$$, schema_name, function_between_symmetric_name, view_name, period_row.start_column_name, period_row.end_column_name);
EXECUTE format('ALTER FUNCTION %1$I.%2$I(timestamp with time zone, timestamp with time zone) OWNER TO %3$I',
schema_name, function_between_symmetric_name, table_owner);
EXECUTE format(
$$
CREATE FUNCTION %1$I.%2$I(timestamp with time zone, timestamp with time zone)
RETURNS SETOF %1$I.%3$I
LANGUAGE sql
STABLE
AS 'SELECT * FROM %1$I.%3$I WHERE $1 < $2 AND %5$I > $1 AND %4$I < $2'
$$, schema_name, function_from_to_name, view_name, period_row.start_column_name, period_row.end_column_name);
EXECUTE format('ALTER FUNCTION %1$I.%2$I(timestamp with time zone, timestamp with time zone) OWNER TO %3$I',
schema_name, function_from_to_name, table_owner);
/* Set privileges on history objects */
FOR sql IN
SELECT format('REVOKE ALL ON %s %s FROM %s',
CASE object_type
WHEN 'r' THEN 'TABLE'
WHEN 'v' THEN 'TABLE'
WHEN 'f' THEN 'FUNCTION'
ELSE 'ERROR'
END,
string_agg(DISTINCT object_name, ', '),
string_agg(DISTINCT quote_ident(COALESCE(a.rolname, 'public')), ', '))
FROM (
SELECT c.relkind AS object_type,
c.oid::regclass::text AS object_name,
acl.grantee AS grantee
FROM pg_class AS c
JOIN pg_namespace AS n ON n.oid = c.relnamespace
CROSS JOIN LATERAL aclexplode(COALESCE(c.relacl, acldefault('r', c.relowner))) AS acl
WHERE n.nspname = schema_name
AND c.relname IN (history_table_name, view_name)
UNION ALL
SELECT 'f',
p.oid::regprocedure::text,
acl.grantee
FROM pg_proc AS p
CROSS JOIN LATERAL aclexplode(COALESCE(p.proacl, acldefault('f', p.proowner))) AS acl
WHERE p.oid = ANY (ARRAY[
format('%I.%I(timestamp with time zone)', schema_name, function_as_of_name)::regprocedure,
format('%I.%I(timestamp with time zone,timestamp with time zone)', schema_name, function_between_name)::regprocedure,
format('%I.%I(timestamp with time zone,timestamp with time zone)', schema_name, function_between_symmetric_name)::regprocedure,
format('%I.%I(timestamp with time zone,timestamp with time zone)', schema_name, function_from_to_name)::regprocedure
])
) AS objects
LEFT JOIN pg_authid AS a ON a.oid = objects.grantee
GROUP BY objects.object_type
LOOP
EXECUTE sql;
END LOOP;
FOR grantees IN
SELECT string_agg(acl.grantee::regrole::text, ', ')
FROM pg_class AS c
CROSS JOIN LATERAL aclexplode(COALESCE(c.relacl, acldefault('r', c.relowner))) AS acl
WHERE c.oid = table_class
AND acl.privilege_type = 'SELECT'
LOOP
EXECUTE format('GRANT SELECT ON TABLE %1$I.%2$I, %1$I.%3$I TO %4$s',
schema_name, history_table_name, view_name, grantees);
EXECUTE format('GRANT EXECUTE ON FUNCTION %s, %s, %s, %s TO %s',
format('%I.%I(timestamp with time zone)', schema_name, function_as_of_name)::regprocedure,
format('%I.%I(timestamp with time zone,timestamp with time zone)', schema_name, function_between_name)::regprocedure,
format('%I.%I(timestamp with time zone,timestamp with time zone)', schema_name, function_between_symmetric_name)::regprocedure,
format('%I.%I(timestamp with time zone,timestamp with time zone)', schema_name, function_from_to_name)::regprocedure,
grantees);
END LOOP;
/* Register it */
INSERT INTO periods.system_versioning (table_name, period_name, history_table_name, view_name,
func_as_of, func_between, func_between_symmetric, func_from_to)
VALUES (
table_class,
'system_time',
format('%I.%I', schema_name, history_table_name),
format('%I.%I', schema_name, view_name),
format('%I.%I(timestamp with time zone)', schema_name, function_as_of_name),
format('%I.%I(timestamp with time zone,timestamp with time zone)', schema_name, function_between_name),
format('%I.%I(timestamp with time zone,timestamp with time zone)', schema_name, function_between_symmetric_name),
format('%I.%I(timestamp with time zone,timestamp with time zone)', schema_name, function_from_to_name)
);
END;
$function$;
CREATE OR REPLACE FUNCTION periods.drop_protection()
RETURNS event_trigger
LANGUAGE plpgsql
SECURITY DEFINER
AS
$function$
#variable_conflict use_variable
DECLARE
r record;
table_name regclass;
period_name name;
BEGIN
/*
* This function is called after the fact, so we have to just look to see
* if anything is missing in the catalogs if we just store the name and not
* a reg* type.
*/
---
--- periods
---
/* If one of our tables is being dropped, remove references to it */
FOR table_name, period_name IN
SELECT p.table_name, p.period_name
FROM periods.periods AS p
JOIN pg_catalog.pg_event_trigger_dropped_objects() WITH ORDINALITY AS dobj
ON dobj.objid = p.table_name
WHERE dobj.object_type = 'table'
ORDER BY dobj.ordinality
LOOP
PERFORM periods.drop_period(table_name, period_name, 'CASCADE', true);
END LOOP;
/*
* If a column belonging to one of our periods is dropped, we need to reject that.
* SQL:2016 11.23 SR 6
*/
FOR r IN
SELECT dobj.object_identity, p.period_name
FROM periods.periods AS p
JOIN pg_catalog.pg_attribute AS sa ON (sa.attrelid, sa.attname) = (p.table_name, p.start_column_name)
JOIN pg_catalog.pg_attribute AS ea ON (ea.attrelid, ea.attname) = (p.table_name, p.end_column_name)
JOIN pg_catalog.pg_event_trigger_dropped_objects() WITH ORDINALITY AS dobj
ON dobj.objid = p.table_name AND dobj.objsubid IN (sa.attnum, ea.attnum)
WHERE dobj.object_type = 'table column'
ORDER BY dobj.ordinality
LOOP
RAISE EXCEPTION 'cannot drop column "%" because it is part of the period "%"',
r.object_identity, r.period_name;
END LOOP;
/* Also reject dropping the rangetype */
FOR r IN
SELECT dobj.object_identity, p.table_name, p.period_name
FROM periods.periods AS p
JOIN pg_catalog.pg_event_trigger_dropped_objects() WITH ORDINALITY AS dobj
ON dobj.objid = p.range_type
ORDER BY dobj.ordinality
LOOP
RAISE EXCEPTION 'cannot drop rangetype "%" because it is used in period "%" on table "%"',
r.object_identity, r.period_name, r.table_name;
END LOOP;
---
--- system_time_periods
---
/* Complain if the infinity CHECK constraint is missing. */
FOR r IN
SELECT p.table_name, p.infinity_check_constraint
FROM periods.system_time_periods AS p
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_constraint AS c
WHERE (c.conrelid, c.conname) = (p.table_name, p.infinity_check_constraint))
LOOP
RAISE EXCEPTION 'cannot drop constraint "%" on table "%" because it is used in SYSTEM_TIME period',
r.infinity_check_constraint, r.table_name;
END LOOP;
/* Complain if the GENERATED ALWAYS AS ROW START/END trigger is missing. */
FOR r IN
SELECT p.table_name, p.generated_always_trigger
FROM periods.system_time_periods AS p
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_trigger AS t
WHERE (t.tgrelid, t.tgname) = (p.table_name, p.generated_always_trigger))
LOOP
RAISE EXCEPTION 'cannot drop trigger "%" on table "%" because it is used in SYSTEM_TIME period',
r.generated_always_trigger, r.table_name;
END LOOP;
/* Complain if the write_history trigger is missing. */
FOR r IN
SELECT p.table_name, p.write_history_trigger
FROM periods.system_time_periods AS p
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_trigger AS t
WHERE (t.tgrelid, t.tgname) = (p.table_name, p.write_history_trigger))
LOOP
RAISE EXCEPTION 'cannot drop trigger "%" on table "%" because it is used in SYSTEM_TIME period',
r.write_history_trigger, r.table_name;
END LOOP;
/* Complain if the TRUNCATE trigger is missing. */
FOR r IN
SELECT p.table_name, p.truncate_trigger
FROM periods.system_time_periods AS p
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_trigger AS t
WHERE (t.tgrelid, t.tgname) = (p.table_name, p.truncate_trigger))
LOOP
RAISE EXCEPTION 'cannot drop trigger "%" on table "%" because it is used in SYSTEM_TIME period',
r.truncate_trigger, r.table_name;
END LOOP;
/*
* We can't reliably find out what a column was renamed to, so just error
* out in this case.
*/
FOR r IN
SELECT stp.table_name, u.column_name
FROM periods.system_time_periods AS stp
CROSS JOIN LATERAL unnest(stp.excluded_column_names) AS u (column_name)
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_attribute AS a
WHERE (a.attrelid, a.attname) = (stp.table_name, u.column_name))
LOOP
RAISE EXCEPTION 'cannot drop or rename column "%" on table "%" because it is excluded from SYSTEM VERSIONING',
r.column_name, r.table_name;
END LOOP;
---
--- for_portion_views
---
/* Reject dropping the FOR PORTION OF view. */
FOR r IN
SELECT dobj.object_identity
FROM periods.for_portion_views AS fpv
JOIN pg_catalog.pg_event_trigger_dropped_objects() WITH ORDINALITY AS dobj
ON dobj.objid = fpv.view_name
WHERE dobj.object_type = 'view'
ORDER BY dobj.ordinality
LOOP
RAISE EXCEPTION 'cannot drop view "%", call "periods.drop_for_portion_view()" instead',
r.object_identity;
END LOOP;
/* Complain if the FOR PORTION OF trigger is missing. */
FOR r IN
SELECT fpv.table_name, fpv.period_name, fpv.view_name, fpv.trigger_name
FROM periods.for_portion_views AS fpv
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_trigger AS t
WHERE (t.tgrelid, t.tgname) = (fpv.view_name, fpv.trigger_name))
LOOP
RAISE EXCEPTION 'cannot drop trigger "%" on view "%" because it is used in FOR PORTION OF view for period "%" on table "%"',
r.trigger_name, r.view_name, r.period_name, r.table_name;
END LOOP;
/* Complain if the table's primary key has been dropped. */
FOR r IN
SELECT fpv.table_name, fpv.period_name
FROM periods.for_portion_views AS fpv
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_constraint AS c
WHERE (c.conrelid, c.contype) = (fpv.table_name, 'p'))
LOOP
RAISE EXCEPTION 'cannot drop primary key on table "%" because it has a FOR PORTION OF view for period "%"',
r.table_name, r.period_name;
END LOOP;
---
--- unique_keys
---
/*
* We don't need to protect the individual columns as long as we protect
* the indexes. PostgreSQL will make sure they stick around.
*/
/* Complain if the indexes implementing our unique indexes are missing. */
FOR r IN
SELECT uk.key_name, uk.table_name, uk.unique_constraint
FROM periods.unique_keys AS uk
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_constraint AS c
WHERE (c.conrelid, c.conname) = (uk.table_name, uk.unique_constraint))
LOOP
RAISE EXCEPTION 'cannot drop constraint "%" on table "%" because it is used in period unique key "%"',
r.unique_constraint, r.table_name, r.key_name;
END LOOP;
FOR r IN
SELECT uk.key_name, uk.table_name, uk.exclude_constraint
FROM periods.unique_keys AS uk
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_constraint AS c
WHERE (c.conrelid, c.conname) = (uk.table_name, uk.exclude_constraint))
LOOP
RAISE EXCEPTION 'cannot drop constraint "%" on table "%" because it is used in period unique key "%"',
r.exclude_constraint, r.table_name, r.key_name;
END LOOP;
---
--- foreign_keys
---
/* Complain if any of the triggers are missing */
FOR r IN
SELECT fk.key_name, fk.table_name, fk.fk_insert_trigger
FROM periods.foreign_keys AS fk
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_trigger AS t
WHERE (t.tgrelid, t.tgname) = (fk.table_name, fk.fk_insert_trigger))
LOOP
RAISE EXCEPTION 'cannot drop trigger "%" on table "%" because it is used in period foreign key "%"',
r.fk_insert_trigger, r.table_name, r.key_name;
END LOOP;
FOR r IN
SELECT fk.key_name, fk.table_name, fk.fk_update_trigger
FROM periods.foreign_keys AS fk
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_trigger AS t
WHERE (t.tgrelid, t.tgname) = (fk.table_name, fk.fk_update_trigger))
LOOP
RAISE EXCEPTION 'cannot drop trigger "%" on table "%" because it is used in period foreign key "%"',
r.fk_update_trigger, r.table_name, r.key_name;
END LOOP;
FOR r IN
SELECT fk.key_name, uk.table_name, fk.uk_update_trigger
FROM periods.foreign_keys AS fk
JOIN periods.unique_keys AS uk ON uk.key_name = fk.unique_key
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_trigger AS t
WHERE (t.tgrelid, t.tgname) = (uk.table_name, fk.uk_update_trigger))
LOOP
RAISE EXCEPTION 'cannot drop trigger "%" on table "%" because it is used in period foreign key "%"',
r.uk_update_trigger, r.table_name, r.key_name;
END LOOP;
FOR r IN
SELECT fk.key_name, uk.table_name, fk.uk_delete_trigger
FROM periods.foreign_keys AS fk
JOIN periods.unique_keys AS uk ON uk.key_name = fk.unique_key
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_trigger AS t
WHERE (t.tgrelid, t.tgname) = (uk.table_name, fk.uk_delete_trigger))
LOOP
RAISE EXCEPTION 'cannot drop trigger "%" on table "%" because it is used in period foreign key "%"',
r.uk_delete_trigger, r.table_name, r.key_name;
END LOOP;
---
--- system_versioning
---
FOR r IN
SELECT dobj.object_identity, sv.table_name
FROM periods.system_versioning AS sv
JOIN pg_catalog.pg_event_trigger_dropped_objects() WITH ORDINALITY AS dobj
ON dobj.objid = sv.history_table_name
WHERE dobj.object_type = 'table'
ORDER BY dobj.ordinality
LOOP
RAISE EXCEPTION 'cannot drop table "%" because it is used in SYSTEM VERSIONING for table "%"',
r.object_identity, r.table_name;
END LOOP;
FOR r IN
SELECT dobj.object_identity, sv.table_name
FROM periods.system_versioning AS sv
JOIN pg_catalog.pg_event_trigger_dropped_objects() WITH ORDINALITY AS dobj
ON dobj.objid = sv.view_name
WHERE dobj.object_type = 'view'
ORDER BY dobj.ordinality
LOOP
RAISE EXCEPTION 'cannot drop view "%" because it is used in SYSTEM VERSIONING for table "%"',
r.object_identity, r.table_name;
END LOOP;
FOR r IN
SELECT dobj.object_identity, sv.table_name
FROM periods.system_versioning AS sv
JOIN pg_catalog.pg_event_trigger_dropped_objects() WITH ORDINALITY AS dobj
ON dobj.object_identity = ANY (ARRAY[sv.func_as_of, sv.func_between, sv.func_between_symmetric, sv.func_from_to])
WHERE dobj.object_type = 'function'
ORDER BY dobj.ordinality
LOOP
RAISE EXCEPTION 'cannot drop function "%" because it is used in SYSTEM VERSIONING for table "%"',
r.object_identity, r.table_name;
END LOOP;
END;
$function$;
CREATE OR REPLACE FUNCTION periods.health_checks()
RETURNS event_trigger
LANGUAGE plpgsql
SECURITY DEFINER
AS
$function$
#variable_conflict use_variable
DECLARE
cmd text;
r record;
save_search_path text;
BEGIN
/* Make sure that all of our tables are still persistent */
FOR r IN
SELECT p.table_name
FROM periods.periods AS p
JOIN pg_catalog.pg_class AS c ON c.oid = p.table_name
WHERE c.relpersistence <> 'p'
LOOP
RAISE EXCEPTION 'table "%" must remain persistent because it has periods',
r.table_name;
END LOOP;
/* And the history tables, too */
FOR r IN
SELECT sv.table_name
FROM periods.system_versioning AS sv
JOIN pg_catalog.pg_class AS c ON c.oid = sv.history_table_name
WHERE c.relpersistence <> 'p'
LOOP
RAISE EXCEPTION 'history table "%" must remain persistent because it has periods',
r.table_name;
END LOOP;
/* Check that our system versioning functions are still here */
save_search_path := pg_catalog.current_setting('search_path');
PERFORM pg_catalog.set_config('search_path', 'pg_catalog, pg_temp', true);
FOR r IN
SELECT *
FROM periods.system_versioning AS sv
CROSS JOIN LATERAL UNNEST(ARRAY[sv.func_as_of, sv.func_between, sv.func_between_symmetric, sv.func_from_to]) AS u (fn)
WHERE NOT EXISTS (
SELECT FROM pg_catalog.pg_proc AS p
WHERE p.oid::regprocedure::text = u.fn
)
LOOP
RAISE EXCEPTION 'cannot drop or rename function "%" because it is used in SYSTEM VERSIONING for table "%"',
r.fn, r.table_name;
END LOOP;
PERFORM pg_catalog.set_config('search_path', save_search_path, true);
/* Fix up history and for-portion objects ownership */
FOR cmd IN
SELECT format('ALTER %s %s OWNER TO %I',
CASE ht.relkind
WHEN 'r' THEN 'TABLE'
WHEN 'v' THEN 'VIEW'
END,
ht.oid::regclass, t.relowner::regrole)
FROM periods.system_versioning AS sv
JOIN pg_class AS t ON t.oid = sv.table_name
JOIN pg_class AS ht ON ht.oid IN (sv.history_table_name, sv.view_name)
WHERE t.relowner <> ht.relowner
UNION ALL
SELECT format('ALTER VIEW %s OWNER TO %I', fpt.oid::regclass, t.relowner::regrole)
FROM periods.for_portion_views AS fpv
JOIN pg_class AS t ON t.oid = fpv.table_name
JOIN pg_class AS fpt ON fpt.oid = fpv.view_name
WHERE t.relowner <> fpt.relowner
UNION ALL
SELECT format('ALTER FUNCTION %s OWNER TO %I', p.oid::regprocedure, t.relowner::regrole)
FROM periods.system_versioning AS sv
JOIN pg_class AS t ON t.oid = sv.table_name
JOIN pg_proc AS p ON p.oid = ANY (ARRAY[sv.func_as_of, sv.func_between, sv.func_between_symmetric, sv.func_from_to]::regprocedure[])
WHERE t.relowner <> p.proowner
LOOP
EXECUTE cmd;
END LOOP;
/* Check GRANTs */
IF EXISTS (
SELECT FROM pg_event_trigger_ddl_commands() AS ev_ddl
WHERE ev_ddl.command_tag = 'GRANT')
THEN
FOR r IN
SELECT *,
EXISTS (
SELECT
FROM pg_class AS _c
CROSS JOIN LATERAL aclexplode(COALESCE(_c.relacl, acldefault('r', _c.relowner))) AS _acl
WHERE _c.oid = objects.table_name
AND _acl.grantee = objects.grantee
AND _acl.privilege_type = 'SELECT'
) AS on_base_table
FROM (
SELECT sv.table_name,
c.oid::regclass::text AS object_name,
c.relkind AS object_type,
acl.privilege_type,
acl.privilege_type AS base_privilege_type,
acl.grantee,
'h' AS history_or_portion
FROM periods.system_versioning AS sv
JOIN pg_class AS c ON c.oid IN (sv.history_table_name, sv.view_name)
CROSS JOIN LATERAL aclexplode(COALESCE(c.relacl, acldefault('r', c.relowner))) AS acl
UNION ALL
SELECT fpv.table_name,
c.oid::regclass::text,
c.relkind,
acl.privilege_type,
acl.privilege_type,
acl.grantee,
'p' AS history_or_portion
FROM periods.for_portion_views AS fpv
JOIN pg_class AS c ON c.oid = fpv.view_name
CROSS JOIN LATERAL aclexplode(COALESCE(c.relacl, acldefault('r', c.relowner))) AS acl
UNION ALL
SELECT sv.table_name,
p.oid::regprocedure::text,
'f',
acl.privilege_type,
'SELECT',
acl.grantee,
'h'
FROM periods.system_versioning AS sv
JOIN pg_proc AS p ON p.oid = ANY (ARRAY[sv.func_as_of, sv.func_between, sv.func_between_symmetric, sv.func_from_to]::regprocedure[])
CROSS JOIN LATERAL aclexplode(COALESCE(p.proacl, acldefault('f', p.proowner))) AS acl
) AS objects
ORDER BY object_name, object_type, privilege_type
LOOP
IF
r.history_or_portion = 'h' AND
(r.object_type, r.privilege_type) NOT IN (('r', 'SELECT'), ('v', 'SELECT'), ('f', 'EXECUTE'))
THEN
RAISE EXCEPTION 'cannot grant % to "%"; history objects are read-only',
r.privilege_type, r.object_name;
END IF;
IF NOT r.on_base_table THEN
RAISE EXCEPTION 'cannot grant % directly to "%"; grant % to "%" instead',
r.privilege_type, r.object_name, r.base_privilege_type, r.table_name;
END IF;
END LOOP;
/* Propagate GRANTs */
FOR cmd IN
SELECT format('GRANT %s ON %s %s TO %s',
string_agg(DISTINCT privilege_type, ', '),
object_type,
string_agg(DISTINCT object_name, ', '),
string_agg(DISTINCT COALESCE(a.rolname, 'public'), ', '))
FROM (
SELECT 'TABLE' AS object_type,
hc.oid::regclass::text AS object_name,
'SELECT' AS privilege_type,
acl.grantee
FROM periods.system_versioning AS sv
JOIN pg_class AS c ON c.oid = sv.table_name
CROSS JOIN LATERAL aclexplode(COALESCE(c.relacl, acldefault('r', c.relowner))) AS acl
JOIN pg_class AS hc ON hc.oid IN (sv.history_table_name, sv.view_name)
WHERE acl.privilege_type = 'SELECT'
AND NOT has_table_privilege(acl.grantee, hc.oid, 'SELECT')
UNION ALL
SELECT 'TABLE',
fpc.oid::regclass::text,
acl.privilege_type,
acl.grantee
FROM periods.for_portion_views AS fpv
JOIN pg_class AS c ON c.oid = fpv.table_name
CROSS JOIN LATERAL aclexplode(COALESCE(c.relacl, acldefault('r', c.relowner))) AS acl
JOIN pg_class AS fpc ON fpc.oid = fpv.view_name
WHERE NOT has_table_privilege(acl.grantee, fpc.oid, acl.privilege_type)
UNION ALL
SELECT 'FUNCTION',
hp.oid::regprocedure::text,
'EXECUTE',
acl.grantee
FROM periods.system_versioning AS sv
JOIN pg_class AS c ON c.oid = sv.table_name
CROSS JOIN LATERAL aclexplode(COALESCE(c.relacl, acldefault('r', c.relowner))) AS acl
JOIN pg_proc AS hp ON hp.oid = ANY (ARRAY[sv.func_as_of, sv.func_between, sv.func_between_symmetric, sv.func_from_to]::regprocedure[])
WHERE acl.privilege_type = 'SELECT'
AND NOT has_function_privilege(acl.grantee, hp.oid, 'EXECUTE')
) AS objects
LEFT JOIN pg_authid AS a ON a.oid = objects.grantee
GROUP BY object_type
LOOP
EXECUTE cmd;
END LOOP;
END IF;
/* Check REVOKEs */
IF EXISTS (
SELECT FROM pg_event_trigger_ddl_commands() AS ev_ddl
WHERE ev_ddl.command_tag = 'REVOKE')
THEN
FOR r IN
SELECT sv.table_name,
hc.oid::regclass::text AS object_name,
acl.privilege_type,
acl.privilege_type AS base_privilege_type
FROM periods.system_versioning AS sv
JOIN pg_class AS c ON c.oid = sv.table_name
CROSS JOIN LATERAL aclexplode(COALESCE(c.relacl, acldefault('r', c.relowner))) AS acl
JOIN pg_class AS hc ON hc.oid IN (sv.history_table_name, sv.view_name)
WHERE acl.privilege_type = 'SELECT'
AND NOT EXISTS (
SELECT
FROM aclexplode(COALESCE(hc.relacl, acldefault('r', hc.relowner))) AS _acl
WHERE _acl.privilege_type = 'SELECT'
AND _acl.grantee = acl.grantee)
UNION ALL
SELECT fpv.table_name,
hc.oid::regclass::text,
acl.privilege_type,
acl.privilege_type
FROM periods.for_portion_views AS fpv
JOIN pg_class AS c ON c.oid = fpv.table_name
CROSS JOIN LATERAL aclexplode(COALESCE(c.relacl, acldefault('r', c.relowner))) AS acl
JOIN pg_class AS hc ON hc.oid = fpv.view_name
WHERE NOT EXISTS (
SELECT
FROM aclexplode(COALESCE(hc.relacl, acldefault('r', hc.relowner))) AS _acl
WHERE _acl.privilege_type = acl.privilege_type
AND _acl.grantee = acl.grantee)
UNION ALL
SELECT sv.table_name,
hp.oid::regprocedure::text,
'EXECUTE',
'SELECT'
FROM periods.system_versioning AS sv
JOIN pg_class AS c ON c.oid = sv.table_name
CROSS JOIN LATERAL aclexplode(COALESCE(c.relacl, acldefault('r', c.relowner))) AS acl
JOIN pg_proc AS hp ON hp.oid = ANY (ARRAY[sv.func_as_of, sv.func_between, sv.func_between_symmetric, sv.func_from_to]::regprocedure[])
WHERE acl.privilege_type = 'SELECT'
AND NOT EXISTS (
SELECT
FROM aclexplode(COALESCE(hp.proacl, acldefault('f', hp.proowner))) AS _acl
WHERE _acl.privilege_type = 'EXECUTE'
AND _acl.grantee = acl.grantee)
ORDER BY table_name, object_name
LOOP
RAISE EXCEPTION 'cannot revoke % directly from "%", revoke % from "%" instead',
r.privilege_type, r.object_name, r.base_privilege_type, r.table_name;
END LOOP;
/* Propagate REVOKEs */
FOR cmd IN
SELECT format('REVOKE %s ON %s %s FROM %s',
string_agg(DISTINCT privilege_type, ', '),
object_type,
string_agg(DISTINCT object_name, ', '),
string_agg(DISTINCT COALESCE(a.rolname, 'public'), ', '))
FROM (
SELECT 'TABLE' AS object_type,
hc.oid::regclass::text AS object_name,
'SELECT' AS privilege_type,
hacl.grantee
FROM periods.system_versioning AS sv
JOIN pg_class AS hc ON hc.oid IN (sv.history_table_name, sv.view_name)
CROSS JOIN LATERAL aclexplode(COALESCE(hc.relacl, acldefault('r', hc.relowner))) AS hacl
WHERE hacl.privilege_type = 'SELECT'
AND NOT has_table_privilege(hacl.grantee, sv.table_name, 'SELECT')
UNION ALL
SELECT 'TABLE' AS object_type,
hc.oid::regclass::text AS object_name,
hacl.privilege_type,
hacl.grantee
FROM periods.for_portion_views AS fpv
JOIN pg_class AS hc ON hc.oid = fpv.view_name
CROSS JOIN LATERAL aclexplode(COALESCE(hc.relacl, acldefault('r', hc.relowner))) AS hacl
WHERE NOT has_table_privilege(hacl.grantee, fpv.table_name, hacl.privilege_type)
UNION ALL
SELECT 'FUNCTION' AS object_type,
hp.oid::regprocedure::text AS object_name,
'EXECUTE' AS privilege_type,
hacl.grantee
FROM periods.system_versioning AS sv
JOIN pg_proc AS hp ON hp.oid = ANY (ARRAY[sv.func_as_of, sv.func_between, sv.func_between_symmetric, sv.func_from_to]::regprocedure[])
CROSS JOIN LATERAL aclexplode(COALESCE(hp.proacl, acldefault('f', hp.proowner))) AS hacl
WHERE hacl.privilege_type = 'EXECUTE'
AND NOT has_table_privilege(hacl.grantee, sv.table_name, 'SELECT')
) AS objects
LEFT JOIN pg_authid AS a ON a.oid = objects.grantee
GROUP BY object_type
LOOP
EXECUTE cmd;
END LOOP;
END IF;
END;
$function$; | the_stack |
-- 2018-11-19T13:15:12.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 13:15:12','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Briefanrede' WHERE AD_Element_ID=542055 AND AD_Language='de_DE'
;
-- 2018-11-19T13:15:12.079
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(542055,'de_DE')
;
-- 2018-11-19T13:15:12.120
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(542055,'de_DE')
;
-- 2018-11-19T13:15:12.126
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='Letter_Salutation', Name='Briefanrede', Description=NULL, Help=NULL WHERE AD_Element_ID=542055
;
-- 2018-11-19T13:15:12.131
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Letter_Salutation', Name='Briefanrede', Description=NULL, Help=NULL, AD_Element_ID=542055 WHERE UPPER(ColumnName)='LETTER_SALUTATION' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-11-19T13:15:12.134
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Letter_Salutation', Name='Briefanrede', Description=NULL, Help=NULL WHERE AD_Element_ID=542055 AND IsCentrallyMaintained='Y'
;
-- 2018-11-19T13:15:12.411
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Briefanrede', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=542055) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 542055)
;
-- 2018-11-19T13:15:12.469
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Briefanrede', Name='Briefanrede' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=542055)
;
-- 2018-11-19T13:15:12.525
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Briefanrede', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 542055
;
-- 2018-11-19T13:15:12.533
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Briefanrede', Description=NULL, Help=NULL WHERE AD_Element_ID = 542055
;
-- 2018-11-19T13:15:12.543
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name='Briefanrede', Description=NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 542055
;
-- 2018-11-19T13:35:41.375
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 13:35:41','YYYY-MM-DD HH24:MI:SS'),Name='Greeting ',PrintName='Greeting ' WHERE AD_Element_ID=1159 AND AD_Language='en_US'
;
-- 2018-11-19T13:35:41.384
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1159,'en_US')
;
-- 2018-11-19T13:35:45.076
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 13:35:45','YYYY-MM-DD HH24:MI:SS'),Name='Greeting',PrintName='Greeting' WHERE AD_Element_ID=1159 AND AD_Language='en_US'
;
-- 2018-11-19T13:35:45.082
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1159,'en_US')
;
-- 2018-11-19T13:37:22.300
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 13:37:22','YYYY-MM-DD HH24:MI:SS'),Name='Language ',PrintName='Language ' WHERE AD_Element_ID=109 AND AD_Language='en_US'
;
-- 2018-11-19T13:37:22.312
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(109,'en_US')
;
-- 2018-11-19T13:37:25.053
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 13:37:25','YYYY-MM-DD HH24:MI:SS'),Name='Language',PrintName='Language' WHERE AD_Element_ID=109 AND AD_Language='en_US'
;
-- 2018-11-19T13:37:25.059
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(109,'en_US')
;
-- 2018-11-19T13:42:27.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 13:42:27','YYYY-MM-DD HH24:MI:SS') WHERE AD_Element_ID=1159 AND AD_Language='en_US'
;
-- 2018-11-19T13:42:27.657
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1159,'en_US')
;
-- 2018-11-19T14:10:07.472
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 14:10:07','YYYY-MM-DD HH24:MI:SS'),Name='Greeting ',PrintName='Greeting ' WHERE AD_Element_ID=1171 AND AD_Language='en_US'
;
-- 2018-11-19T14:10:07.490
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1171,'en_US')
;
-- 2018-11-19T14:10:10.444
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 14:10:10','YYYY-MM-DD HH24:MI:SS'),Name='Greeting',PrintName='Greeting' WHERE AD_Element_ID=1171 AND AD_Language='en_US'
;
-- 2018-11-19T14:10:10.451
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1171,'en_US')
;
-- 2018-11-19T14:10:56.724
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 14:10:56','YYYY-MM-DD HH24:MI:SS'),Name='Anrede (ID)',PrintName='Anrede (ID)' WHERE AD_Element_ID=1159 AND AD_Language='de_DE'
;
-- 2018-11-19T14:10:56.734
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1159,'de_DE')
;
-- 2018-11-19T14:10:56.776
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(1159,'de_DE')
;
-- 2018-11-19T14:10:56.785
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='C_Greeting_ID', Name='Anrede (ID)', Description='Anrede zum Druck auf Korrespondenz', Help='Anrede, die beim Druck auf Korrespondenz verwendet werden soll.' WHERE AD_Element_ID=1159
;
-- 2018-11-19T14:10:56.791
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_Greeting_ID', Name='Anrede (ID)', Description='Anrede zum Druck auf Korrespondenz', Help='Anrede, die beim Druck auf Korrespondenz verwendet werden soll.', AD_Element_ID=1159 WHERE UPPER(ColumnName)='C_GREETING_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-11-19T14:10:56.798
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_Greeting_ID', Name='Anrede (ID)', Description='Anrede zum Druck auf Korrespondenz', Help='Anrede, die beim Druck auf Korrespondenz verwendet werden soll.' WHERE AD_Element_ID=1159 AND IsCentrallyMaintained='Y'
;
-- 2018-11-19T14:10:56.800
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Anrede (ID)', Description='Anrede zum Druck auf Korrespondenz', Help='Anrede, die beim Druck auf Korrespondenz verwendet werden soll.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=1159) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 1159)
;
-- 2018-11-19T14:10:56.851
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Anrede (ID)', Name='Anrede (ID)' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=1159)
;
-- 2018-11-19T14:10:56.860
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Anrede (ID)', Description='Anrede zum Druck auf Korrespondenz', Help='Anrede, die beim Druck auf Korrespondenz verwendet werden soll.', CommitWarning = NULL WHERE AD_Element_ID = 1159
;
-- 2018-11-19T14:10:56.863
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Anrede (ID)', Description='Anrede zum Druck auf Korrespondenz', Help='Anrede, die beim Druck auf Korrespondenz verwendet werden soll.' WHERE AD_Element_ID = 1159
;
-- 2018-11-19T14:10:56.866
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name='Anrede (ID)', Description='Anrede zum Druck auf Korrespondenz', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 1159
;
-- 2018-11-19T14:11:12.997
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 14:11:12','YYYY-MM-DD HH24:MI:SS'),Name='Greeting (ID)',PrintName='Greeting (ID)' WHERE AD_Element_ID=1159 AND AD_Language='en_US'
;
-- 2018-11-19T14:11:13.004
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1159,'en_US')
;
-- 2018-11-19T14:12:24.743
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 14:12:24','YYYY-MM-DD HH24:MI:SS'),Name='Active ',PrintName='Active ' WHERE AD_Element_ID=348 AND AD_Language='en_US'
;
-- 2018-11-19T14:12:24.755
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(348,'en_US')
;
-- 2018-11-19T14:12:28.339
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 14:12:28','YYYY-MM-DD HH24:MI:SS'),Name='Active',PrintName='Active' WHERE AD_Element_ID=348 AND AD_Language='en_US'
;
-- 2018-11-19T14:12:28.343
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(348,'en_US')
;
-- 2018-11-19T14:13:13.811
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 14:13:13','YYYY-MM-DD HH24:MI:SS'),Name='Translated ',PrintName='Translated ' WHERE AD_Element_ID=420 AND AD_Language='en_US'
;
-- 2018-11-19T14:13:13.820
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(420,'en_US')
;
-- 2018-11-19T14:13:16.588
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 14:13:16','YYYY-MM-DD HH24:MI:SS'),Name='Translated',PrintName='Translated' WHERE AD_Element_ID=420 AND AD_Language='en_US'
;
-- 2018-11-19T14:13:16.592
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(420,'en_US')
;
-- 2018-11-19T14:13:55.347
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 14:13:55','YYYY-MM-DD HH24:MI:SS'),Name='Organisation ',PrintName='Organisation ' WHERE AD_Element_ID=113 AND AD_Language='en_US'
;
-- 2018-11-19T14:13:55.357
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(113,'en_US')
;
-- 2018-11-19T14:13:58.164
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-11-19 14:13:58','YYYY-MM-DD HH24:MI:SS'),Name='Organisation',PrintName='Organisation' WHERE AD_Element_ID=113 AND AD_Language='en_US'
;
-- 2018-11-19T14:13:58.171
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(113,'en_US')
;
-- 2018-11-19T14:15:04.169
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=30, AD_Reference_Value_ID=356, IsSelectionColumn='Y', IsUpdateable='N',Updated=TO_TIMESTAMP('2018-11-19 14:15:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4083
;
-- 2018-11-19T14:16:19.754
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Window_ID=178,Updated=TO_TIMESTAMP('2018-11-19 14:16:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=356
; | the_stack |
DROP FUNCTION IF EXISTS report.Current_Vs_Previous_Pricelist_Comparison_Report(p_C_BPartner_ID numeric, p_C_BP_Group_ID numeric, p_IsSoTrx text, p_AD_Language text, p_show_product_price_pi_flag text)
;
CREATE OR REPLACE FUNCTION report.Current_Vs_Previous_Pricelist_Comparison_Report(p_C_BPartner_ID numeric = NULL,
p_C_BP_Group_ID numeric = NULL,
p_IsSoTrx text = 'Y',
p_AD_Language TEXT = 'en_US',
p_show_product_price_pi_flag text = 'Y')
RETURNS TABLE
(
bp_value text,
bp_name text,
ProductCategory text,
M_Product_ID integer,
value text,
CustomerProductNumber text,
ProductName text,
IsSeasonFixedPrice text,
ItemProductName text,
qtycuspertu numeric,
packingmaterialname text,
pricestd numeric,
PricePattern1 text,
altpricestd numeric,
PricePattern2 text,
hasaltprice integer,
uomsymbol text,
uom_x12de355 text,
Attributes text,
m_productprice_id integer,
m_attributesetinstance_id integer,
m_hu_pi_item_product_id integer,
currency text,
currency2 text,
validFromPLV1 timestamp,
validFromPLV2 timestamp,
namePLV1 text,
namePLV2 text,
c_bpartner_location_id numeric,
AD_Org_ID numeric,
show_product_price_pi_flag text
)
AS
$$
WITH plvvr AS
(SELECT plv.* FROM Report.Fresh_PriceList_Version_Val_Rule plv),
bpg AS (SELECT DISTINCT b.c_bpartner_id FROM c_bpartner b WHERE b.c_bp_group_id = p_C_BP_Group_ID),
PriceListVersionsByValidFrom AS
(
SELECT t.*
FROM (SELECT --
plv.c_bpartner_id,
plv.m_pricelist_version_id,
plv.validfrom,
plv.name,
row_number() OVER (PARTITION BY plv.c_bpartner_id ORDER BY plv.validfrom DESC, plv.m_pricelist_version_id DESC) rank
FROM plvvr plv
WHERE TRUE
AND plv.validfrom <= now()
AND plv.issotrx = p_IsSoTrx
AND (p_C_BPartner_ID IS NULL OR plv.c_bpartner_id = p_C_BPartner_ID)
AND (p_C_BP_Group_ID IS NULL OR plv.c_bpartner_id IN (SELECT bpg.c_bpartner_id FROM bpg))
ORDER BY TRUE,
plv.validfrom DESC,
plv.m_pricelist_version_id DESC) t
WHERE t.rank <= 2
),
currentAndPreviousPLV AS
(
-- implementation detail: all these sub-selects would be better implemented with a pivot. Unfortunately i cant understand how pivots work.
SELECT DISTINCT --
plvv.c_bpartner_id,
(SELECT plvv2.m_pricelist_version_id FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) PLV1_ID,
(SELECT plvv2.m_pricelist_version_id FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 2 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) PLV2_ID,
(SELECT plvv2.validfrom FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) validFromPLV1,
(SELECT plvv2.validfrom FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 2 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) validFromPLV2,
(SELECT plvv2.name FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) namePLV1,
(SELECT plvv2.name FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 2 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) namePLV2
FROM PriceListVersionsByValidFrom plvv
ORDER BY plvv.c_bpartner_id
),
result AS
(
SELECT t.*,
plv.validFromPLV1,
plv.validFromPLV2,
plv.namePLV1,
plv.namePLV2,
(SELECT bpl.c_bpartner_location_id FROM c_bpartner_location bpl WHERE bpl.c_bpartner_id = plv.c_bpartner_id ORDER BY bpl.isbilltodefault DESC LIMIT 1) c_bpartner_location_id,
(SELECT plv2.ad_org_id FROM m_pricelist_version plv2 WHERE plv2.m_pricelist_version_id = plv.PLV1_ID) AD_Org_ID
FROM currentAndPreviousPLV plv
INNER JOIN LATERAL report.fresh_PriceList_Details_Report(
plv.c_bpartner_id,
plv.PLV1_ID,
plv.PLV2_ID,
p_AD_Language,
p_show_product_price_pi_flag
) AS t ON TRUE
)
SELECT --
r.bp_value,
r.bp_name,
r.productcategory,
r.m_product_id,
r.value,
r.customerproductnumber,
r.productname,
r.isseasonfixedprice::text,
r.itemproductname,
r.qtycuspertu,
r.packingmaterialname,
r.pricestd,
PricePattern1,
r.altpricestd,
PricePattern2,
r.hasaltprice,
r.uomsymbol,
r.uom_x12de355,
r.attributes,
r.m_productprice_id,
r.m_attributesetinstance_id,
r.m_hu_pi_item_product_id,
r.currency::text,
r.currency2::text,
r.validFromPLV1,
r.validFromPLV2,
r.namePLV1,
r.namePLV2,
r.c_bpartner_location_id,
r.AD_Org_ID,
p_show_product_price_pi_flag as show_product_price_pi_flag
FROM result r
ORDER BY TRUE,
r.bp_value,
r.productCategory,
r.value
$$
LANGUAGE sql STABLE
;
/*
* #%L
* de.metas.fresh.base
* %%
* Copyright (C) 2020 metas GmbH
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
/*
How to run
- All Bpartners
SELECT *
FROM report.Current_Vs_Previous_Pricelist_Comparison_Report()
;
- Specific Bpartner
SELECT *
FROM report.Current_Vs_Previous_Pricelist_Comparison_Report(2156515)
;
*/
DROP FUNCTION IF EXISTS report.Current_Vs_Previous_Pricelist_Comparison_Report_With_PP_PI(p_C_BPartner_ID numeric, p_C_BP_Group_ID numeric, p_IsSoTrx text, p_AD_Language text, p_show_product_price_pi_flag text)
;
CREATE OR REPLACE FUNCTION report.Current_Vs_Previous_Pricelist_Comparison_Report_With_PP_PI(p_C_BPartner_ID numeric = NULL,
p_C_BP_Group_ID numeric = NULL,
p_IsSoTrx text = 'Y',
p_AD_Language TEXT = 'en_US',
p_show_product_price_pi_flag text = 'Y')
RETURNS TABLE
(
bp_value text,
bp_name text,
ProductCategory text,
M_Product_ID integer,
value text,
CustomerProductNumber text,
ProductName text,
IsSeasonFixedPrice text,
ItemProductName text,
qtycuspertu numeric,
packingmaterialname text,
pricestd numeric,
PricePattern1 text,
altpricestd numeric,
PricePattern2 text,
hasaltprice integer,
uomsymbol text,
uom_x12de355 text,
Attributes text,
m_productprice_id integer,
m_attributesetinstance_id integer,
m_hu_pi_item_product_id integer,
currency text,
currency2 text,
validFromPLV1 timestamp,
validFromPLV2 timestamp,
namePLV1 text,
namePLV2 text,
c_bpartner_location_id numeric,
AD_Org_ID numeric,
show_product_price_pi_flag text
)
AS
$$
WITH plvvr AS
(SELECT plv.* FROM Report.Fresh_PriceList_Version_Val_Rule plv),
bpg AS (SELECT DISTINCT b.c_bpartner_id FROM c_bpartner b WHERE b.c_bp_group_id = p_C_BP_Group_ID),
PriceListVersionsByValidFrom AS
(
SELECT t.*
FROM (SELECT --
plv.c_bpartner_id,
plv.m_pricelist_version_id,
plv.validfrom,
plv.name,
row_number() OVER (PARTITION BY plv.c_bpartner_id ORDER BY plv.validfrom DESC, plv.m_pricelist_version_id DESC) rank
FROM plvvr plv
WHERE TRUE
AND plv.validfrom <= now()
AND plv.issotrx = p_IsSoTrx
AND (p_C_BPartner_ID IS NULL OR plv.c_bpartner_id = p_C_BPartner_ID)
AND (p_C_BP_Group_ID IS NULL OR plv.c_bpartner_id IN (SELECT bpg.c_bpartner_id FROM bpg))
ORDER BY TRUE,
plv.validfrom DESC,
plv.m_pricelist_version_id DESC) t
WHERE t.rank <= 2
),
currentAndPreviousPLV AS
(
-- implementation detail: all these sub-selects would be better implemented with a pivot. Unfortunately i cant understand how pivots work.
SELECT DISTINCT --
plvv.c_bpartner_id,
(SELECT plvv2.m_pricelist_version_id FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) PLV1_ID,
(SELECT plvv2.m_pricelist_version_id FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 2 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) PLV2_ID,
(SELECT plvv2.validfrom FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) validFromPLV1,
(SELECT plvv2.validfrom FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 2 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) validFromPLV2,
(SELECT plvv2.name FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) namePLV1,
(SELECT plvv2.name FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 2 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) namePLV2
FROM PriceListVersionsByValidFrom plvv
ORDER BY plvv.c_bpartner_id
),
result AS
(
SELECT t.*,
plv.validFromPLV1,
plv.validFromPLV2,
plv.namePLV1,
plv.namePLV2,
(SELECT bpl.c_bpartner_location_id FROM c_bpartner_location bpl WHERE bpl.c_bpartner_id = plv.c_bpartner_id ORDER BY bpl.isbilltodefault DESC LIMIT 1) c_bpartner_location_id,
(SELECT plv2.ad_org_id FROM m_pricelist_version plv2 WHERE plv2.m_pricelist_version_id = plv.PLV1_ID) AD_Org_ID
FROM currentAndPreviousPLV plv
INNER JOIN LATERAL report.fresh_PriceList_Details_Report_With_PP_PI(
plv.c_bpartner_id,
plv.PLV1_ID,
plv.PLV2_ID,
p_AD_Language,
p_show_product_price_pi_flag
) AS t ON TRUE
)
SELECT --
r.bp_value,
r.bp_name,
r.productcategory,
r.m_product_id,
r.value,
r.customerproductnumber,
r.productname,
r.isseasonfixedprice::text,
r.itemproductname,
r.qtycuspertu,
r.packingmaterialname,
r.pricestd,
PricePattern1,
r.altpricestd,
PricePattern2,
r.hasaltprice,
r.uomsymbol,
r.uom_x12de355,
r.attributes,
r.m_productprice_id,
r.m_attributesetinstance_id,
r.m_hu_pi_item_product_id,
r.currency::text,
r.currency2::text,
r.validFromPLV1,
r.validFromPLV2,
r.namePLV1,
r.namePLV2,
r.c_bpartner_location_id,
r.AD_Org_ID,
p_show_product_price_pi_flag as show_product_price_pi_flag
FROM result r
ORDER BY TRUE,
r.bp_value,
r.productCategory,
r.value
$$
LANGUAGE sql STABLE
;
/*
How to run
- All Bpartners
SELECT *
FROM report.Current_Vs_Previous_Pricelist_Comparison_Report_With_PP_PI()
;
- Specific Bpartner
SELECT *
FROM report.Current_Vs_Previous_Pricelist_Comparison_Report_With_PP_PI(2156515)
;
*/
DROP FUNCTION IF EXISTS report.Current_Vs_Next_Pricelist_Comparison_Report(p_C_BPartner_ID numeric, p_C_BP_Group_ID numeric, p_IsSoTrx text, p_AD_Language text, p_show_product_price_pi_flag text)
;
CREATE OR REPLACE FUNCTION report.Current_Vs_Next_Pricelist_Comparison_Report(p_C_BPartner_ID numeric = NULL,
p_C_BP_Group_ID numeric = NULL,
p_IsSoTrx text = 'Y',
p_AD_Language TEXT = 'en_US',
p_show_product_price_pi_flag text = 'Y')
RETURNS TABLE
(
bp_value text,
bp_name text,
ProductCategory text,
M_Product_ID integer,
value text,
CustomerProductNumber text,
ProductName text,
IsSeasonFixedPrice text,
ItemProductName text,
qtycuspertu numeric,
packingmaterialname text,
pricestd numeric,
PricePattern1 text,
altpricestd numeric,
PricePattern2 text,
hasaltprice integer,
uomsymbol text,
uom_x12de355 text,
Attributes text,
m_productprice_id integer,
m_attributesetinstance_id integer,
m_hu_pi_item_product_id integer,
currency text,
currency2 text,
validFromPLV1 timestamp,
validFromPLV2 timestamp,
namePLV1 text,
namePLV2 text,
c_bpartner_location_id numeric,
AD_Org_ID numeric,
show_product_price_pi_flag text
)
AS
$$
WITH plvvr AS
(SELECT plv.* FROM Report.Fresh_PriceList_Version_Val_Rule plv),
bpg AS (SELECT DISTINCT b.c_bpartner_id FROM c_bpartner b WHERE b.c_bp_group_id = p_C_BP_Group_ID),
PriceListVersionsByValidFrom AS
(
SELECT t.*
FROM ((SELECT --
plv.c_bpartner_id,
plv.m_pricelist_version_id,
plv.validfrom,
plv.name,
row_number() OVER (PARTITION BY plv.c_bpartner_id ORDER BY plv.validfrom DESC, plv.m_pricelist_version_id DESC) rank
FROM plvvr plv
WHERE TRUE
AND plv.validfrom <= now()
AND plv.issotrx = p_IsSoTrx
AND (p_C_BPartner_ID IS NULL OR plv.c_bpartner_id = p_C_BPartner_ID)
AND (p_C_BP_Group_ID IS NULL OR plv.c_bpartner_id IN (SELECT bpg.c_bpartner_id FROM bpg))
ORDER BY TRUE,
plv.validfrom DESC,
plv.m_pricelist_version_id DESC
)
UNION ALL
(SELECT --
plv.c_bpartner_id,
plv.m_pricelist_version_id,
plv.validfrom,
plv.name,
1001 - (row_number() OVER (PARTITION BY plv.c_bpartner_id ORDER BY plv.validfrom ASC, plv.m_pricelist_version_id ASC)) rank
FROM plvvr plv
WHERE TRUE
AND plv.validfrom > now()
AND plv.issotrx = p_IsSoTrx
AND (p_C_BPartner_ID IS NULL OR plv.c_bpartner_id = p_C_BPartner_ID)
AND (p_C_BP_Group_ID IS NULL OR plv.c_bpartner_id IN (SELECT bpg.c_bpartner_id FROM bpg))
ORDER BY TRUE,
plv.validfrom ASC,
plv.m_pricelist_version_id ASC
)
) t
WHERE t.rank = 1
OR t.rank = 1000
),
currentAndPreviousPLV AS
(
-- implementation detail: all these sub-selects would be better implemented with a pivot. Unfortunately i cant understand how pivots work.
SELECT DISTINCT --
plvv.c_bpartner_id,
(SELECT plvv2.m_pricelist_version_id FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) PLV1_ID,
(SELECT plvv2.m_pricelist_version_id FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1000 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) PLV2_ID,
(SELECT plvv2.validfrom FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) validFromPLV1,
(SELECT plvv2.validfrom FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1000 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) validFromPLV2,
(SELECT plvv2.name FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) namePLV1,
(SELECT plvv2.name FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1000 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) namePLV2
FROM PriceListVersionsByValidFrom plvv
ORDER BY plvv.c_bpartner_id
),
result AS
(
SELECT t.*,
plv.validFromPLV1,
plv.validFromPLV2,
plv.namePLV1,
plv.namePLV2,
(SELECT bpl.c_bpartner_location_id FROM c_bpartner_location bpl WHERE bpl.c_bpartner_id = plv.c_bpartner_id ORDER BY bpl.isbilltodefault DESC LIMIT 1) c_bpartner_location_id,
(SELECT plv2.ad_org_id FROM m_pricelist_version plv2 WHERE plv2.m_pricelist_version_id = plv.PLV1_ID) AD_Org_ID
FROM currentAndPreviousPLV plv
INNER JOIN LATERAL report.fresh_PriceList_Details_Report(
plv.c_bpartner_id,
plv.PLV1_ID,
plv.PLV2_ID,
p_AD_Language,
p_show_product_price_pi_flag
) AS t ON TRUE
)
SELECT --
r.bp_value,
r.bp_name,
r.productcategory,
r.m_product_id,
r.value,
r.customerproductnumber,
r.productname,
r.isseasonfixedprice::text,
r.itemproductname,
r.qtycuspertu,
r.packingmaterialname,
r.pricestd,
PricePattern1,
r.altpricestd,
PricePattern2,
r.hasaltprice,
r.uomsymbol,
r.uom_x12de355,
r.attributes,
r.m_productprice_id,
r.m_attributesetinstance_id,
r.m_hu_pi_item_product_id,
r.currency::text,
r.currency2::text,
r.validFromPLV1,
r.validFromPLV2,
r.namePLV1,
r.namePLV2,
r.c_bpartner_location_id,
r.AD_Org_ID,
p_show_product_price_pi_flag AS show_product_price_pi_flag
FROM result r
ORDER BY TRUE,
r.bp_value,
r.productCategory,
r.value
$$
LANGUAGE sql STABLE
;
/*
How to run
- All Bpartners
SELECT *
FROM report.Current_Vs_Next_Pricelist_Comparison_Report()
;
- Specific Bpartner
SELECT *
FROM report.Current_Vs_Next_Pricelist_Comparison_Report(2156515)
;
*/
DROP FUNCTION IF EXISTS report.Current_Vs_Next_Pricelist_Comparison_Report_With_PP_PI(p_C_BPartner_ID numeric, p_C_BP_Group_ID numeric, p_IsSoTrx text, p_AD_Language text, p_show_product_price_pi_flag text)
;
CREATE OR REPLACE FUNCTION report.Current_Vs_Next_Pricelist_Comparison_Report_With_PP_PI(p_C_BPartner_ID numeric = NULL,
p_C_BP_Group_ID numeric = NULL,
p_IsSoTrx text = 'Y',
p_AD_Language TEXT = 'en_US',
p_show_product_price_pi_flag text = 'Y')
RETURNS TABLE
(
bp_value text,
bp_name text,
ProductCategory text,
M_Product_ID integer,
value text,
CustomerProductNumber text,
ProductName text,
IsSeasonFixedPrice text,
ItemProductName text,
qtycuspertu numeric,
packingmaterialname text,
pricestd numeric,
PricePattern1 text,
altpricestd numeric,
PricePattern2 text,
hasaltprice integer,
uomsymbol text,
uom_x12de355 text,
Attributes text,
m_productprice_id integer,
m_attributesetinstance_id integer,
m_hu_pi_item_product_id integer,
currency text,
currency2 text,
validFromPLV1 timestamp,
validFromPLV2 timestamp,
namePLV1 text,
namePLV2 text,
c_bpartner_location_id numeric,
AD_Org_ID numeric,
show_product_price_pi_flag text
)
AS
$$
WITH plvvr AS
(select plv.* from Report.Fresh_PriceList_Version_Val_Rule plv ),
bpg AS (SELECT DISTINCT b.c_bpartner_id FROM c_bpartner b WHERE b.c_bp_group_id = p_C_BP_Group_ID),
PriceListVersionsByValidFrom AS
(
SELECT t.*
FROM ((SELECT --
plv.c_bpartner_id,
plv.m_pricelist_version_id,
plv.validfrom,
plv.name,
row_number() OVER (PARTITION BY plv.c_bpartner_id ORDER BY plv.validfrom DESC, plv.m_pricelist_version_id DESC) rank
FROM plvvr plv
WHERE TRUE
AND plv.validfrom <= now()
AND plv.issotrx = p_IsSoTrx
AND (p_C_BPartner_ID IS NULL OR plv.c_bpartner_id = p_C_BPartner_ID)
AND (p_C_BP_Group_ID IS NULL OR plv.c_bpartner_id IN (select bpg.c_bpartner_id from bpg))
ORDER BY TRUE,
plv.validfrom DESC,
plv.m_pricelist_version_id DESC
)
UNION ALL
(SELECT --
plv.c_bpartner_id,
plv.m_pricelist_version_id,
plv.validfrom,
plv.name,
1001 - (row_number() OVER (PARTITION BY plv.c_bpartner_id ORDER BY plv.validfrom ASC, plv.m_pricelist_version_id ASC)) rank
FROM plvvr plv
WHERE TRUE
AND plv.validfrom > now()
AND plv.issotrx = p_IsSoTrx
AND (p_C_BPartner_ID IS NULL OR plv.c_bpartner_id = p_C_BPartner_ID)
AND (p_C_BP_Group_ID IS NULL OR plv.c_bpartner_id IN (select bpg.c_bpartner_id from bpg))
ORDER BY TRUE,
plv.validfrom ASC,
plv.m_pricelist_version_id ASC
)
) t
WHERE t.rank = 1
OR t.rank = 1000
),
currentAndPreviousPLV AS
(
-- implementation detail: all these sub-selects would be better implemented with a pivot. Unfortunately i cant understand how pivots work.
SELECT DISTINCT --
plvv.c_bpartner_id,
(SELECT plvv2.m_pricelist_version_id FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) PLV1_ID,
(SELECT plvv2.m_pricelist_version_id FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1000 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) PLV2_ID,
(SELECT plvv2.validfrom FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) validFromPLV1,
(SELECT plvv2.validfrom FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1000 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) validFromPLV2,
(SELECT plvv2.name FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) namePLV1,
(SELECT plvv2.name FROM PriceListVersionsByValidFrom plvv2 WHERE plvv2.rank = 1000 AND plvv2.c_bpartner_id = plvv.c_bpartner_id) namePLV2
FROM PriceListVersionsByValidFrom plvv
ORDER BY plvv.c_bpartner_id
),
result AS
(
SELECT t.*,
plv.validFromPLV1,
plv.validFromPLV2,
plv.namePLV1,
plv.namePLV2,
(SELECT bpl.c_bpartner_location_id FROM c_bpartner_location bpl WHERE bpl.c_bpartner_id = plv.c_bpartner_id ORDER BY bpl.isbilltodefault DESC LIMIT 1) c_bpartner_location_id,
(SELECT plv2.ad_org_id FROM m_pricelist_version plv2 WHERE plv2.m_pricelist_version_id = plv.PLV1_ID) AD_Org_ID
FROM currentAndPreviousPLV plv
INNER JOIN LATERAL report.fresh_PriceList_Details_Report_With_PP_PI(
plv.c_bpartner_id,
plv.PLV1_ID,
plv.PLV2_ID,
p_AD_Language,
p_show_product_price_pi_flag
) AS t ON TRUE
)
SELECT --
r.bp_value,
r.bp_name,
r.productcategory,
r.m_product_id,
r.value,
r.customerproductnumber,
r.productname,
r.isseasonfixedprice::text,
r.itemproductname,
r.qtycuspertu,
r.packingmaterialname,
r.pricestd,
PricePattern1,
r.altpricestd,
PricePattern2,
r.hasaltprice,
r.uomsymbol,
r.uom_x12de355,
r.attributes,
r.m_productprice_id,
r.m_attributesetinstance_id,
r.m_hu_pi_item_product_id,
r.currency::text,
r.currency2::text,
r.validFromPLV1,
r.validFromPLV2,
r.namePLV1,
r.namePLV2,
r.c_bpartner_location_id,
r.AD_Org_ID,
p_show_product_price_pi_flag AS show_product_price_pi_flag
FROM result r
ORDER BY TRUE,
r.bp_value,
r.productCategory,
r.value
$$
LANGUAGE sql STABLE
;
/*
How to run
- All Bpartners
SELECT *
FROM report.Current_Vs_Next_Pricelist_Comparison_Report_With_PP_PI()
;
- Specific Bpartner
SELECT *
FROM report.Current_Vs_Next_Pricelist_Comparison_Report_With_PP_PI(2156515)
;
*/
update ad_sysconfig
set value = 3600000, description = 'Connection timeout in milliseconds when invoking the reports servlet from another metasfresh component, raised to 1h, see #gh10238'
where name ilike '%reports.remoteServletInvoker.connectTimeout%';
update ad_sysconfig
set value = 3600000, description = 'Read timeout in milliseconds when the reports servlet retrieving data from database, raised to 1h, see #gh10238'
where name ilike '%reports.remoteServletInvoker.readTimeout%'; | the_stack |
BEGIN;
-- insert seed data for basic user/platform/project/reward
\i /specs/sql-support/insert_platform_user_project.sql
\i /specs/sql-support/payment_json_build_helpers.sql
-- \i /specs/sql-support/insert_global_notifications.sql
select plan(15);
SELECT function_returns('payment_service', 'transition_to', ARRAY['payment_service.catalog_payments', 'payment_service.payment_status', 'json'], 'boolean');
SELECT function_returns('payment_service', 'transition_to', ARRAY['payment_service.subscriptions', 'payment_service.subscription_status', 'json'], 'boolean');
create or replace function test_payment_transition_to_refused()
returns setof text language plpgsql
as $$
declare
_subscription payment_service.subscriptions;
_payment payment_service.catalog_payments;
begin
-- generate subscription
insert into payment_service.subscriptions
(status, created_at, platform_id, user_id, project_id, reward_id, checkout_data)
values ('started', now(), __seed_platform_id(), __seed_first_user_id(), __seed_project_id(), __seed_reward_id(), '{}'::jsonb)
returning * into _subscription;
-- create payment for subscription into _payment
insert into payment_service.catalog_payments
(status, created_at, gateway, platform_id, user_id, project_id, data, subscription_id)
values ('pending', now(), 'pagarme', __seed_platform_id(), __seed_first_user_id(), __seed_project_id(), json_build_object('payment_method', 'credit_card'), _subscription.id)
returning * into _payment;
-- transit payment to refused and reload
perform payment_service.transition_to(_payment, 'refused', row_to_json(_payment));
select * from payment_service.catalog_payments
where id = _payment.id
into _payment;
return next is(_payment.status, 'refused', 'should turn payment to refused');
return next is(exists(
select true from notification_service.user_catalog_notifications
where user_id = _payment.user_id
and label = 'refused_subscription_card_payment'
and (data->'relations'->>'catalog_payment_id')::uuid = _payment.id
), true, 'should create notification refused_subscription_card_payment when payment is a subscription payment');
-- insert boleto payment to subscription
insert into payment_service.catalog_payments
(status, created_at, gateway, platform_id, user_id, project_id, data, subscription_id)
values ('pending', now(), 'pagarme', __seed_platform_id(), __seed_first_user_id(), __seed_project_id(), json_build_object('payment_method', 'boleto'), _subscription.id)
returning * into _payment;
-- transit payment to refused and reload
perform payment_service.transition_to(_payment, 'refused', row_to_json(_payment));
select * from payment_service.catalog_payments
where id = _payment.id
into _payment;
return next is(_payment.status, 'refused', 'should turn payment to refused');
return next is(exists(
select true from notification_service.user_catalog_notifications
where user_id = _payment.user_id
and label = 'refused_subscription_card_payment'
and (data->'relations'->>'catalog_payment_id')::uuid = _payment.id
), false, 'should not notify with refused_subscription_card_payment when payment method is boleto');
-- insert new payment without subscription
insert into payment_service.catalog_payments
(status, created_at, gateway, platform_id, user_id, project_id, data, subscription_id)
values ('pending', now(), 'pagarme', __seed_platform_id(), __seed_first_user_id(), __seed_project_id(), json_build_object('payment_method', 'credit_card'), null)
returning * into _payment;
-- transit payment to refused and reload
perform payment_service.transition_to(_payment, 'refused', row_to_json(_payment));
select * from payment_service.catalog_payments
where id = _payment.id
into _payment;
return next is(_payment.status, 'refused', 'should turn payment to refused');
return next is(exists(
select true from notification_service.user_catalog_notifications
where user_id = _payment.user_id
and label = 'refused_subscription_card_payment'
and (data->'relations'->>'catalog_payment_id')::uuid = _payment.id
), false, 'should not create refused_subscription_card_payment notification when payment is not belong to a subscription');
end;
$$;
select test_payment_transition_to_refused();
CREATE OR REPLACE FUNCTION test_subscription_transition_when_active()
returns setof text language plpgsql
as $$
declare
_subscription payment_service.subscriptions;
_reward_notification notification_service.notifications;
begin
-- generate subscription
insert into payment_service.subscriptions
(status, created_at, platform_id, user_id, project_id, reward_id, checkout_data)
values ('started', now(), __seed_platform_id(), __seed_first_user_id(), __seed_project_id(), __seed_reward_id(), '{}'::jsonb)
returning * into _subscription;
return next is(payment_service.transition_to(_subscription, 'active', '{}'), true, 'should change subscription status');
select n.* from notification_service.notifications n
join notification_service.notification_global_templates ngt
on ngt.id = n.notification_global_template_id
where n.user_id = _subscription.user_id
and ngt.label = 'reward_welcome_message'
and (n.data -> 'relations' ->> 'subscription_id')::uuid = _subscription.id
into _reward_notification;
return next ok(_reward_notification.id is not null, 'should have a reward_welcome notification');
end;
$$;
select * from test_subscription_transition_when_active();
CREATE OR REPLACE FUNCTION test_subscription_transition_when_deleted()
returns setof text language plpgsql
as $$
declare
_subscription payment_service.subscriptions;
_canceled_notification notification_service.notifications;
begin
-- generate subscription
insert into payment_service.subscriptions
(status, created_at, platform_id, user_id, project_id, checkout_data)
values ('deleted', (now() - '1 month'::interval), __seed_platform_id(), __seed_first_user_id(), __seed_project_id(), '{}'::jsonb)
returning * into _subscription;
-- should not transit subscription to any status
return next is(payment_service.transition_to(_subscription, 'active', '{}'), false, 'should not change subscription status');
end;
$$;
select * from test_subscription_transition_when_deleted();
CREATE OR REPLACE FUNCTION test_subscription_transition_canceling_to_canceled()
returns setof text language plpgsql
as $$
declare
_subscription payment_service.subscriptions;
_canceled_notification notification_service.notifications;
begin
-- generate subscription
insert into payment_service.subscriptions
(status, created_at, platform_id, user_id, project_id, checkout_data)
values ('canceling', (now() - '1 month'::interval), __seed_platform_id(), __seed_first_user_id(), __seed_project_id(), '{}'::jsonb)
returning * into _subscription;
-- transition subscription to canceled
perform payment_service.transition_to(_subscription, 'canceled', '{}');
-- reload subscription
select * from payment_service.subscriptions
where id = _subscription.id
into _subscription;
return next ok(_subscription.status = 'canceled', 'should turn status to canceled');
-- get canceled notification
select n.* from notification_service.notifications n
join notification_service.notification_global_templates ngt
on ngt.id = n.notification_global_template_id
where n.user_id = _subscription.user_id
and ngt.label = 'canceled_subscription'
and (n.data -> 'relations' ->> 'subscription_id')::uuid = _subscription.id
into _canceled_notification;
return next ok(_canceled_notification.id is not null, 'should have a canceled_subscription notification');
end;
$$;
select test_subscription_transition_canceling_to_canceled();
create or replace function test_susbcription_transition_from_canceled_to_inactive()
returns setof text language plpgsql as $$
declare
_canceled_subscription payment_service.subscriptions;
_inactive_subscription_notification notification_service.notifications;
begin
-- generate subscription
insert into payment_service.subscriptions
(status, created_at, platform_id, user_id, project_id, checkout_data)
values ('canceled', (now() - '1 month'::interval), __seed_platform_id(), __seed_first_user_id(), __seed_project_id(), '{}'::jsonb)
returning * into _canceled_subscription;
perform payment_service.transition_to(_canceled_subscription, 'inactive', row_to_json(_canceled_subscription));
-- check for inactive subscription notifications
select n.* from notification_service.notifications n
join notification_service.notification_global_templates ngt
on ngt.id = n.notification_global_template_id
where n.user_id = _canceled_subscription.user_id
and ngt.label = 'inactive_subscription'
and (n.data -> 'relations' ->> 'subscription_id')::uuid = _canceled_subscription.id
into _inactive_subscription_notification;
return next ok(_inactive_subscription_notification.id is null, 'should not sent inactive_subscription');
select * from payment_service.subscriptions where id = _canceled_subscription.id
into _canceled_subscription;
return next is(_canceled_subscription.status, 'inactive', 'subscription should be inactived');
end;
$$;
select * from test_susbcription_transition_from_canceled_to_inactive();
SELECT * FROM finish();
ROLLBACK; | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `ssrs_menu`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_menu`;
CREATE TABLE `ssrs_menu` (
`id` int(5) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`sequence` int(4) NOT NULL COMMENT '排序序号',
`icon` varchar(50) NOT NULL COMMENT '菜单图标',
`title` varchar(50) NOT NULL COMMENT '路径地址',
`url` varchar(100) NOT NULL,
`parent_id` int(5) DEFAULT NULL COMMENT '上级id',
`permission_id` bigint(20) NOT NULL COMMENT '权限id',
`system_menu` int(2) NOT NULL COMMENT '是否允许编辑 | 1:允许,2:不允许',
PRIMARY KEY (`id`),
KEY `parent_id` (`parent_id`),
KEY `permission_id` (`permission_id`),
CONSTRAINT `ssrs_menu_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `ssrs_menu` (`id`),
CONSTRAINT `ssrs_menu_ibfk_2` FOREIGN KEY (`permission_id`) REFERENCES `ssrs_permission` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of ssrs_menu
-- ----------------------------
INSERT INTO `ssrs_menu` VALUES ('2', '1', '', '系统设置', '/', null, '1', '1');
INSERT INTO `ssrs_menu` VALUES ('3', '1', '', '网站设置', '/webSet/index', '2', '2', '2');
INSERT INTO `ssrs_menu` VALUES ('4', '2', '', '菜单设置', '/menu/index', '2', '3', '1');
INSERT INTO `ssrs_menu` VALUES ('7', '3', '', '角色设置', '/role/index', '2', '11', '1');
INSERT INTO `ssrs_menu` VALUES ('9', '4', '', '权限设置', '/permission/index', '2', '17', '1');
INSERT INTO `ssrs_menu` VALUES ('12', '2', '', '测试顶级菜单', '/', null, '20', '1');
INSERT INTO `ssrs_menu` VALUES ('13', '1', '', '测试子菜单', '/test/test1', '12', '21', '1');
INSERT INTO `ssrs_menu` VALUES ('14', '5', '', '管理员设置', '/user/list', '2', '26', '1');
INSERT INTO `ssrs_menu` VALUES ('15', '6', '', '在线用户', '/member/index', '2', '30', '1');
INSERT INTO `ssrs_menu` VALUES ('16', '7', '', '系统日志', '/systemLog/index', '2', '32', '1');
-- ----------------------------
-- Table structure for `ssrs_permission`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_permission`;
CREATE TABLE `ssrs_permission` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`url` varchar(256) DEFAULT NULL COMMENT 'url地址',
`name` varchar(64) DEFAULT NULL COMMENT 'url描述',
`parent_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of ssrs_permission
-- ----------------------------
INSERT INTO `ssrs_permission` VALUES ('1', '/', '系统设置', null);
INSERT INTO `ssrs_permission` VALUES ('2', '/webSet/index', '网站设置', '1');
INSERT INTO `ssrs_permission` VALUES ('3', '/menu/index', '菜单设置', '1');
INSERT INTO `ssrs_permission` VALUES ('8', '/menu/update', '菜单编辑', '3');
INSERT INTO `ssrs_permission` VALUES ('9', '/menu/del', '菜单删除', '3');
INSERT INTO `ssrs_permission` VALUES ('11', '/role/index', '角色管理', '1');
INSERT INTO `ssrs_permission` VALUES ('12', '/role/add', '角色添加', '11');
INSERT INTO `ssrs_permission` VALUES ('13', '/role/update', '角色编辑', '11');
INSERT INTO `ssrs_permission` VALUES ('14', '/role/del', '角色删除', '11');
INSERT INTO `ssrs_permission` VALUES ('15', '/menu/add', '菜单添加', '3');
INSERT INTO `ssrs_permission` VALUES ('17', '/permission/index', '权限设置', '1');
INSERT INTO `ssrs_permission` VALUES ('20', '/', '测试顶级菜单', null);
INSERT INTO `ssrs_permission` VALUES ('21', '/test/test1', '测试子菜单', '20');
INSERT INTO `ssrs_permission` VALUES ('22', '/permission/add', '权限添加', '17');
INSERT INTO `ssrs_permission` VALUES ('23', '/permission/del', '权限删除', '17');
INSERT INTO `ssrs_permission` VALUES ('24', '/permission/update', '权限修改', '17');
INSERT INTO `ssrs_permission` VALUES ('26', '/user/list', '管理员设置', '1');
INSERT INTO `ssrs_permission` VALUES ('27', '/user/add', '管理员添加', '26');
INSERT INTO `ssrs_permission` VALUES ('28', '/user/update', '管理员编辑', '26');
INSERT INTO `ssrs_permission` VALUES ('29', '/user/del', '管理员删除', '26');
INSERT INTO `ssrs_permission` VALUES ('30', '/member/index', '在线用户设置', '1');
INSERT INTO `ssrs_permission` VALUES ('31', '/member/changeSessionStatus', '用户状态改变', '30');
INSERT INTO `ssrs_permission` VALUES ('32', '/systemLog/index', '系统日志', '1');
-- ----------------------------
-- Table structure for `ssrs_role`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_role`;
CREATE TABLE `ssrs_role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(32) DEFAULT NULL COMMENT '角色名称',
`type` varchar(10) DEFAULT NULL COMMENT '角色类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of ssrs_role
-- ----------------------------
INSERT INTO `ssrs_role` VALUES ('1', '超级管理员', 'admin');
INSERT INTO `ssrs_role` VALUES ('2', '测试角色', 'test');
-- ----------------------------
-- Table structure for `ssrs_role_permission`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_role_permission`;
CREATE TABLE `ssrs_role_permission` (
`rid` bigint(20) DEFAULT NULL COMMENT '角色ID',
`pid` bigint(20) DEFAULT NULL COMMENT '权限ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of ssrs_role_permission
-- ----------------------------
INSERT INTO `ssrs_role_permission` VALUES ('1', '1');
INSERT INTO `ssrs_role_permission` VALUES ('1', '2');
INSERT INTO `ssrs_role_permission` VALUES ('1', '3');
INSERT INTO `ssrs_role_permission` VALUES ('1', '8');
INSERT INTO `ssrs_role_permission` VALUES ('1', '9');
INSERT INTO `ssrs_role_permission` VALUES ('1', '11');
INSERT INTO `ssrs_role_permission` VALUES ('1', '12');
INSERT INTO `ssrs_role_permission` VALUES ('1', '13');
INSERT INTO `ssrs_role_permission` VALUES ('1', '14');
INSERT INTO `ssrs_role_permission` VALUES ('1', '15');
INSERT INTO `ssrs_role_permission` VALUES ('4', '1');
INSERT INTO `ssrs_role_permission` VALUES ('4', '2');
INSERT INTO `ssrs_role_permission` VALUES ('1', '17');
INSERT INTO `ssrs_role_permission` VALUES ('1', '20');
INSERT INTO `ssrs_role_permission` VALUES ('1', '21');
INSERT INTO `ssrs_role_permission` VALUES ('1', '22');
INSERT INTO `ssrs_role_permission` VALUES ('1', '23');
INSERT INTO `ssrs_role_permission` VALUES ('1', '24');
INSERT INTO `ssrs_role_permission` VALUES ('1', '25');
INSERT INTO `ssrs_role_permission` VALUES ('1', '26');
INSERT INTO `ssrs_role_permission` VALUES ('1', '27');
INSERT INTO `ssrs_role_permission` VALUES ('2', '1');
INSERT INTO `ssrs_role_permission` VALUES ('2', '2');
INSERT INTO `ssrs_role_permission` VALUES ('2', '3');
INSERT INTO `ssrs_role_permission` VALUES ('2', '8');
INSERT INTO `ssrs_role_permission` VALUES ('2', '9');
INSERT INTO `ssrs_role_permission` VALUES ('2', '15');
INSERT INTO `ssrs_role_permission` VALUES ('1', '28');
INSERT INTO `ssrs_role_permission` VALUES ('1', '29');
INSERT INTO `ssrs_role_permission` VALUES ('1', '30');
INSERT INTO `ssrs_role_permission` VALUES ('1', '31');
INSERT INTO `ssrs_role_permission` VALUES ('1', '32');
-- ----------------------------
-- Table structure for `ssrs_system_log`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_system_log`;
CREATE TABLE `ssrs_system_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`client_ip` varchar(30) DEFAULT NULL,
`uri` varchar(100) DEFAULT NULL,
`type` varchar(50) DEFAULT NULL,
`method` varchar(10) DEFAULT NULL,
`param_dara` longtext,
`session_id` varchar(100) DEFAULT NULL,
`time` datetime DEFAULT NULL,
`return_time` datetime DEFAULT NULL,
`return_data` longtext,
`http_status_code` varchar(10) DEFAULT NULL,
`time_consuming` int(8) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of ssrs_system_log
-- ----------------------------
-- ----------------------------
-- Table structure for `ssrs_user`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_user`;
CREATE TABLE `ssrs_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`nickname` varchar(20) DEFAULT NULL COMMENT '用户昵称',
`email` varchar(128) DEFAULT NULL COMMENT '邮箱|登录帐号',
`pswd` varchar(32) DEFAULT NULL COMMENT '密码',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
`status` bigint(1) DEFAULT '1' COMMENT '1:有效,0:禁止登录',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of ssrs_user
-- ----------------------------
INSERT INTO `ssrs_user` VALUES ('15', 'ssrs', 'ssrs@qq.com', '1317e6a8b03222040618c475337c67c6', '2018-08-03 19:09:08', '2018-08-17 11:15:25', '1');
-- ----------------------------
-- Table structure for `ssrs_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_user_role`;
CREATE TABLE `ssrs_user_role` (
`uid` bigint(20) DEFAULT NULL COMMENT '用户ID',
`rid` bigint(20) DEFAULT NULL COMMENT '角色ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of ssrs_user_role
-- ----------------------------
INSERT INTO `ssrs_user_role` VALUES ('15', '1');
INSERT INTO `ssrs_user_role` VALUES ('16', '1');
-- ----------------------------
-- Procedure structure for `init_quella_data`
-- ----------------------------
DROP PROCEDURE IF EXISTS `init_quella_data`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `init_quella_data`()
BEGIN
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `ssrs_menu`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_menu`;
CREATE TABLE `ssrs_menu` (
`id` int(5) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`sequence` int(4) NOT NULL COMMENT '排序序号',
`icon` varchar(50) NOT NULL COMMENT '菜单图标',
`title` varchar(50) NOT NULL COMMENT '路径地址',
`url` varchar(100) NOT NULL,
`parent_id` int(5) DEFAULT NULL COMMENT '上级id',
`permission_id` bigint(20) NOT NULL COMMENT '权限id',
`system_menu` int(2) NOT NULL COMMENT '是否允许编辑 | 1:允许,2:不允许',
PRIMARY KEY (`id`),
KEY `parent_id` (`parent_id`),
KEY `permission_id` (`permission_id`),
CONSTRAINT `ssrs_menu_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `ssrs_menu` (`id`),
CONSTRAINT `ssrs_menu_ibfk_2` FOREIGN KEY (`permission_id`) REFERENCES `ssrs_permission` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of ssrs_menu
-- ----------------------------
INSERT INTO `ssrs_menu` VALUES ('2', '1', '', '系统设置', '/', null, '1', '1');
INSERT INTO `ssrs_menu` VALUES ('3', '1', '', '网站设置', '/webSet/index', '2', '2', '2');
INSERT INTO `ssrs_menu` VALUES ('4', '2', '', '菜单设置', '/menu/index', '2', '3', '1');
INSERT INTO `ssrs_menu` VALUES ('7', '3', '', '角色设置', '/role/index', '2', '11', '1');
INSERT INTO `ssrs_menu` VALUES ('9', '4', '', '权限设置', '/permission/index', '2', '17', '1');
INSERT INTO `ssrs_menu` VALUES ('12', '2', '', '测试顶级菜单', '/', null, '20', '1');
INSERT INTO `ssrs_menu` VALUES ('13', '1', '', '测试子菜单', '/test/test1', '12', '21', '1');
INSERT INTO `ssrs_menu` VALUES ('14', '5', '', '管理员设置', '/user/list', '2', '26', '1');
INSERT INTO `ssrs_menu` VALUES ('15', '6', '', '在线用户', '/member/index', '2', '30', '1');
INSERT INTO `ssrs_menu` VALUES ('16', '7', '', '系统日志', '/systemLog/index', '2', '32', '1');
-- ----------------------------
-- Table structure for `ssrs_permission`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_permission`;
CREATE TABLE `ssrs_permission` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`url` varchar(256) DEFAULT NULL COMMENT 'url地址',
`name` varchar(64) DEFAULT NULL COMMENT 'url描述',
`parent_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of ssrs_permission
-- ----------------------------
INSERT INTO `ssrs_permission` VALUES ('1', '/', '系统设置', null);
INSERT INTO `ssrs_permission` VALUES ('2', '/webSet/index', '网站设置', '1');
INSERT INTO `ssrs_permission` VALUES ('3', '/menu/index', '菜单设置', '1');
INSERT INTO `ssrs_permission` VALUES ('8', '/menu/update', '菜单编辑', '3');
INSERT INTO `ssrs_permission` VALUES ('9', '/menu/del', '菜单删除', '3');
INSERT INTO `ssrs_permission` VALUES ('11', '/role/index', '角色管理', '1');
INSERT INTO `ssrs_permission` VALUES ('12', '/role/add', '角色添加', '11');
INSERT INTO `ssrs_permission` VALUES ('13', '/role/update', '角色编辑', '11');
INSERT INTO `ssrs_permission` VALUES ('14', '/role/del', '角色删除', '11');
INSERT INTO `ssrs_permission` VALUES ('15', '/menu/add', '菜单添加', '3');
INSERT INTO `ssrs_permission` VALUES ('17', '/permission/index', '权限设置', '1');
INSERT INTO `ssrs_permission` VALUES ('20', '/', '测试顶级菜单', null);
INSERT INTO `ssrs_permission` VALUES ('21', '/test/test1', '测试子菜单', '20');
INSERT INTO `ssrs_permission` VALUES ('22', '/permission/add', '权限添加', '17');
INSERT INTO `ssrs_permission` VALUES ('23', '/permission/del', '权限删除', '17');
INSERT INTO `ssrs_permission` VALUES ('24', '/permission/update', '权限修改', '17');
INSERT INTO `ssrs_permission` VALUES ('26', '/user/list', '管理员设置', '1');
INSERT INTO `ssrs_permission` VALUES ('27', '/user/add', '管理员添加', '26');
INSERT INTO `ssrs_permission` VALUES ('28', '/user/update', '管理员编辑', '26');
INSERT INTO `ssrs_permission` VALUES ('29', '/user/del', '管理员删除', '26');
INSERT INTO `ssrs_permission` VALUES ('30', '/member/index', '在线用户设置', '1');
INSERT INTO `ssrs_permission` VALUES ('31', '/member/changeSessionStatus', '用户状态改变', '30');
INSERT INTO `ssrs_permission` VALUES ('32', '/systemLog/index', '系统日志', '1');
-- ----------------------------
-- Table structure for `ssrs_role`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_role`;
CREATE TABLE `ssrs_role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(32) DEFAULT NULL COMMENT '角色名称',
`type` varchar(10) DEFAULT NULL COMMENT '角色类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of ssrs_role
-- ----------------------------
INSERT INTO `ssrs_role` VALUES ('1', '超级管理员', 'admin');
INSERT INTO `ssrs_role` VALUES ('2', '测试角色', 'test');
-- ----------------------------
-- Table structure for `ssrs_role_permission`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_role_permission`;
CREATE TABLE `ssrs_role_permission` (
`rid` bigint(20) DEFAULT NULL COMMENT '角色ID',
`pid` bigint(20) DEFAULT NULL COMMENT '权限ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of ssrs_role_permission
-- ----------------------------
INSERT INTO `ssrs_role_permission` VALUES ('1', '1');
INSERT INTO `ssrs_role_permission` VALUES ('1', '2');
INSERT INTO `ssrs_role_permission` VALUES ('1', '3');
INSERT INTO `ssrs_role_permission` VALUES ('1', '8');
INSERT INTO `ssrs_role_permission` VALUES ('1', '9');
INSERT INTO `ssrs_role_permission` VALUES ('1', '11');
INSERT INTO `ssrs_role_permission` VALUES ('1', '12');
INSERT INTO `ssrs_role_permission` VALUES ('1', '13');
INSERT INTO `ssrs_role_permission` VALUES ('1', '14');
INSERT INTO `ssrs_role_permission` VALUES ('1', '15');
INSERT INTO `ssrs_role_permission` VALUES ('4', '1');
INSERT INTO `ssrs_role_permission` VALUES ('4', '2');
INSERT INTO `ssrs_role_permission` VALUES ('1', '17');
INSERT INTO `ssrs_role_permission` VALUES ('1', '20');
INSERT INTO `ssrs_role_permission` VALUES ('1', '21');
INSERT INTO `ssrs_role_permission` VALUES ('1', '22');
INSERT INTO `ssrs_role_permission` VALUES ('1', '23');
INSERT INTO `ssrs_role_permission` VALUES ('1', '24');
INSERT INTO `ssrs_role_permission` VALUES ('1', '25');
INSERT INTO `ssrs_role_permission` VALUES ('1', '26');
INSERT INTO `ssrs_role_permission` VALUES ('1', '27');
INSERT INTO `ssrs_role_permission` VALUES ('2', '1');
INSERT INTO `ssrs_role_permission` VALUES ('2', '2');
INSERT INTO `ssrs_role_permission` VALUES ('2', '3');
INSERT INTO `ssrs_role_permission` VALUES ('2', '8');
INSERT INTO `ssrs_role_permission` VALUES ('2', '9');
INSERT INTO `ssrs_role_permission` VALUES ('2', '15');
INSERT INTO `ssrs_role_permission` VALUES ('1', '28');
INSERT INTO `ssrs_role_permission` VALUES ('1', '29');
INSERT INTO `ssrs_role_permission` VALUES ('1', '30');
INSERT INTO `ssrs_role_permission` VALUES ('1', '31');
INSERT INTO `ssrs_role_permission` VALUES ('1', '32');
-- ----------------------------
-- Table structure for `ssrs_system_log`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_system_log`;
CREATE TABLE `ssrs_system_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`client_ip` varchar(30) DEFAULT NULL,
`uri` varchar(100) DEFAULT NULL,
`type` varchar(50) DEFAULT NULL,
`method` varchar(10) DEFAULT NULL,
`param_dara` longtext,
`session_id` varchar(100) DEFAULT NULL,
`time` datetime DEFAULT NULL,
`return_time` datetime DEFAULT NULL,
`return_data` longtext,
`http_status_code` varchar(10) DEFAULT NULL,
`time_consuming` int(8) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=935 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of ssrs_system_log
-- ----------------------------
-- ----------------------------
-- Table structure for `ssrs_user`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_user`;
CREATE TABLE `ssrs_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`nickname` varchar(20) DEFAULT NULL COMMENT '用户昵称',
`email` varchar(128) DEFAULT NULL COMMENT '邮箱|登录帐号',
`pswd` varchar(32) DEFAULT NULL COMMENT '密码',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
`status` bigint(1) DEFAULT '1' COMMENT '1:有效,0:禁止登录',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of ssrs_user
-- ----------------------------
INSERT INTO `ssrs_user` VALUES ('15', 'ssrs', 'ssrs@qq.com', '1317e6a8b03222040618c475337c67c6', '2018-08-03 19:09:08', '2018-08-17 11:15:25', '1');
-- ----------------------------
-- Table structure for `ssrs_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `ssrs_user_role`;
CREATE TABLE `ssrs_user_role` (
`uid` bigint(20) DEFAULT NULL COMMENT '用户ID',
`rid` bigint(20) DEFAULT NULL COMMENT '角色ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of ssrs_user_role
-- ----------------------------
INSERT INTO `ssrs_user_role` VALUES ('15', '1');
INSERT INTO `ssrs_user_role` VALUES ('16', '1');
END
;;
DELIMITER ; | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for act_evt_log
-- ----------------------------
DROP TABLE IF EXISTS `act_evt_log`;
CREATE TABLE `act_evt_log` (
`LOG_NR_` bigint(20) NOT NULL AUTO_INCREMENT,
`TYPE_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TIME_STAMP_` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`DATA_` longblob,
`LOCK_OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`LOCK_TIME_` timestamp(3) NULL DEFAULT NULL,
`IS_PROCESSED_` tinyint(4) DEFAULT '0',
PRIMARY KEY (`LOG_NR_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_evt_log
-- ----------------------------
-- ----------------------------
-- Table structure for act_ge_bytearray
-- ----------------------------
DROP TABLE IF EXISTS `act_ge_bytearray`;
CREATE TABLE `act_ge_bytearray` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`BYTES_` longblob,
`GENERATED_` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_FK_BYTEARR_DEPL` (`DEPLOYMENT_ID_`),
CONSTRAINT `ACT_FK_BYTEARR_DEPL` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `act_re_deployment` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_ge_bytearray
-- ----------------------------
-- ----------------------------
-- Table structure for act_ge_property
-- ----------------------------
DROP TABLE IF EXISTS `act_ge_property`;
CREATE TABLE `act_ge_property` (
`NAME_` varchar(64) COLLATE utf8_bin NOT NULL,
`VALUE_` varchar(300) COLLATE utf8_bin DEFAULT NULL,
`REV_` int(11) DEFAULT NULL,
PRIMARY KEY (`NAME_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_ge_property
-- ----------------------------
INSERT INTO `act_ge_property` VALUES ('next.dbid', '10001', '5');
INSERT INTO `act_ge_property` VALUES ('schema.history', 'create(5.22.0.0)', '1');
INSERT INTO `act_ge_property` VALUES ('schema.version', '5.22.0.0', '1');
-- ----------------------------
-- Table structure for act_hi_actinst
-- ----------------------------
DROP TABLE IF EXISTS `act_hi_actinst`;
CREATE TABLE `act_hi_actinst` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`ACT_ID_` varchar(255) COLLATE utf8_bin NOT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`CALL_PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`ACT_NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`ACT_TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`START_TIME_` datetime(3) NOT NULL,
`END_TIME_` datetime(3) DEFAULT NULL,
`DURATION_` bigint(20) DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_HI_ACT_INST_START` (`START_TIME_`),
KEY `ACT_IDX_HI_ACT_INST_END` (`END_TIME_`),
KEY `ACT_IDX_HI_ACT_INST_PROCINST` (`PROC_INST_ID_`,`ACT_ID_`),
KEY `ACT_IDX_HI_ACT_INST_EXEC` (`EXECUTION_ID_`,`ACT_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_hi_actinst
-- ----------------------------
-- ----------------------------
-- Table structure for act_hi_attachment
-- ----------------------------
DROP TABLE IF EXISTS `act_hi_attachment`;
CREATE TABLE `act_hi_attachment` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`URL_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`CONTENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TIME_` datetime(3) DEFAULT NULL,
PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_hi_attachment
-- ----------------------------
-- ----------------------------
-- Table structure for act_hi_comment
-- ----------------------------
DROP TABLE IF EXISTS `act_hi_comment`;
CREATE TABLE `act_hi_comment` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TIME_` datetime(3) NOT NULL,
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`ACTION_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`MESSAGE_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`FULL_MSG_` longblob,
PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_hi_comment
-- ----------------------------
-- ----------------------------
-- Table structure for act_hi_detail
-- ----------------------------
DROP TABLE IF EXISTS `act_hi_detail`;
CREATE TABLE `act_hi_detail` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`ACT_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin NOT NULL,
`VAR_TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`REV_` int(11) DEFAULT NULL,
`TIME_` datetime(3) NOT NULL,
`BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DOUBLE_` double DEFAULT NULL,
`LONG_` bigint(20) DEFAULT NULL,
`TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_HI_DETAIL_PROC_INST` (`PROC_INST_ID_`),
KEY `ACT_IDX_HI_DETAIL_ACT_INST` (`ACT_INST_ID_`),
KEY `ACT_IDX_HI_DETAIL_TIME` (`TIME_`),
KEY `ACT_IDX_HI_DETAIL_NAME` (`NAME_`),
KEY `ACT_IDX_HI_DETAIL_TASK_ID` (`TASK_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_hi_detail
-- ----------------------------
-- ----------------------------
-- Table structure for act_hi_identitylink
-- ----------------------------
DROP TABLE IF EXISTS `act_hi_identitylink`;
CREATE TABLE `act_hi_identitylink` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`GROUP_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_HI_IDENT_LNK_USER` (`USER_ID_`),
KEY `ACT_IDX_HI_IDENT_LNK_TASK` (`TASK_ID_`),
KEY `ACT_IDX_HI_IDENT_LNK_PROCINST` (`PROC_INST_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_hi_identitylink
-- ----------------------------
-- ----------------------------
-- Table structure for act_hi_procinst
-- ----------------------------
DROP TABLE IF EXISTS `act_hi_procinst`;
CREATE TABLE `act_hi_procinst` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`BUSINESS_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`START_TIME_` datetime(3) NOT NULL,
`END_TIME_` datetime(3) DEFAULT NULL,
`DURATION_` bigint(20) DEFAULT NULL,
`START_USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`START_ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`END_ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`SUPER_PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DELETE_REASON_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
UNIQUE KEY `PROC_INST_ID_` (`PROC_INST_ID_`),
KEY `ACT_IDX_HI_PRO_INST_END` (`END_TIME_`),
KEY `ACT_IDX_HI_PRO_I_BUSKEY` (`BUSINESS_KEY_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_hi_procinst
-- ----------------------------
-- ----------------------------
-- Table structure for act_hi_taskinst
-- ----------------------------
DROP TABLE IF EXISTS `act_hi_taskinst`;
CREATE TABLE `act_hi_taskinst` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TASK_DEF_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PARENT_TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`START_TIME_` datetime(3) NOT NULL,
`CLAIM_TIME_` datetime(3) DEFAULT NULL,
`END_TIME_` datetime(3) DEFAULT NULL,
`DURATION_` bigint(20) DEFAULT NULL,
`DELETE_REASON_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`PRIORITY_` int(11) DEFAULT NULL,
`DUE_DATE_` datetime(3) DEFAULT NULL,
`FORM_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_HI_TASK_INST_PROCINST` (`PROC_INST_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_hi_taskinst
-- ----------------------------
-- ----------------------------
-- Table structure for act_hi_varinst
-- ----------------------------
DROP TABLE IF EXISTS `act_hi_varinst`;
CREATE TABLE `act_hi_varinst` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin NOT NULL,
`VAR_TYPE_` varchar(100) COLLATE utf8_bin DEFAULT NULL,
`REV_` int(11) DEFAULT NULL,
`BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DOUBLE_` double DEFAULT NULL,
`LONG_` bigint(20) DEFAULT NULL,
`TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`CREATE_TIME_` datetime(3) DEFAULT NULL,
`LAST_UPDATED_TIME_` datetime(3) DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_HI_PROCVAR_PROC_INST` (`PROC_INST_ID_`),
KEY `ACT_IDX_HI_PROCVAR_NAME_TYPE` (`NAME_`,`VAR_TYPE_`),
KEY `ACT_IDX_HI_PROCVAR_TASK_ID` (`TASK_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_hi_varinst
-- ----------------------------
-- ----------------------------
-- Table structure for act_id_group
-- ----------------------------
DROP TABLE IF EXISTS `act_id_group`;
CREATE TABLE `act_id_group` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_id_group
-- ----------------------------
-- ----------------------------
-- Table structure for act_id_info
-- ----------------------------
DROP TABLE IF EXISTS `act_id_info`;
CREATE TABLE `act_id_info` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`USER_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TYPE_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`VALUE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PASSWORD_` longblob,
`PARENT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_id_info
-- ----------------------------
-- ----------------------------
-- Table structure for act_id_membership
-- ----------------------------
DROP TABLE IF EXISTS `act_id_membership`;
CREATE TABLE `act_id_membership` (
`USER_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`GROUP_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`USER_ID_`,`GROUP_ID_`),
KEY `ACT_FK_MEMB_GROUP` (`GROUP_ID_`),
CONSTRAINT `ACT_FK_MEMB_GROUP` FOREIGN KEY (`GROUP_ID_`) REFERENCES `act_id_group` (`ID_`),
CONSTRAINT `ACT_FK_MEMB_USER` FOREIGN KEY (`USER_ID_`) REFERENCES `act_id_user` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_id_membership
-- ----------------------------
-- ----------------------------
-- Table structure for act_id_user
-- ----------------------------
DROP TABLE IF EXISTS `act_id_user`;
CREATE TABLE `act_id_user` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`FIRST_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`LAST_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`EMAIL_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PWD_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PICTURE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_id_user
-- ----------------------------
-- ----------------------------
-- Table structure for act_procdef_info
-- ----------------------------
DROP TABLE IF EXISTS `act_procdef_info`;
CREATE TABLE `act_procdef_info` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`INFO_JSON_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
UNIQUE KEY `ACT_UNIQ_INFO_PROCDEF` (`PROC_DEF_ID_`),
KEY `ACT_IDX_INFO_PROCDEF` (`PROC_DEF_ID_`),
KEY `ACT_FK_INFO_JSON_BA` (`INFO_JSON_ID_`),
CONSTRAINT `ACT_FK_INFO_JSON_BA` FOREIGN KEY (`INFO_JSON_ID_`) REFERENCES `act_ge_bytearray` (`ID_`),
CONSTRAINT `ACT_FK_INFO_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `act_re_procdef` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_procdef_info
-- ----------------------------
-- ----------------------------
-- Table structure for act_re_deployment
-- ----------------------------
DROP TABLE IF EXISTS `act_re_deployment`;
CREATE TABLE `act_re_deployment` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
`DEPLOY_TIME_` timestamp(3) NULL DEFAULT NULL,
PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_re_deployment
-- ----------------------------
-- ----------------------------
-- Table structure for act_re_model
-- ----------------------------
DROP TABLE IF EXISTS `act_re_model`;
CREATE TABLE `act_re_model` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`CREATE_TIME_` timestamp(3) NULL DEFAULT NULL,
`LAST_UPDATE_TIME_` timestamp(3) NULL DEFAULT NULL,
`VERSION_` int(11) DEFAULT NULL,
`META_INFO_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EDITOR_SOURCE_VALUE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EDITOR_SOURCE_EXTRA_VALUE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_FK_MODEL_SOURCE` (`EDITOR_SOURCE_VALUE_ID_`),
KEY `ACT_FK_MODEL_SOURCE_EXTRA` (`EDITOR_SOURCE_EXTRA_VALUE_ID_`),
KEY `ACT_FK_MODEL_DEPLOYMENT` (`DEPLOYMENT_ID_`),
CONSTRAINT `ACT_FK_MODEL_DEPLOYMENT` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `act_re_deployment` (`ID_`),
CONSTRAINT `ACT_FK_MODEL_SOURCE` FOREIGN KEY (`EDITOR_SOURCE_VALUE_ID_`) REFERENCES `act_ge_bytearray` (`ID_`),
CONSTRAINT `ACT_FK_MODEL_SOURCE_EXTRA` FOREIGN KEY (`EDITOR_SOURCE_EXTRA_VALUE_ID_`) REFERENCES `act_ge_bytearray` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_re_model
-- ----------------------------
-- ----------------------------
-- Table structure for act_re_procdef
-- ----------------------------
DROP TABLE IF EXISTS `act_re_procdef`;
CREATE TABLE `act_re_procdef` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`KEY_` varchar(255) COLLATE utf8_bin NOT NULL,
`VERSION_` int(11) NOT NULL,
`DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`RESOURCE_NAME_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`DGRM_RESOURCE_NAME_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`HAS_START_FORM_KEY_` tinyint(4) DEFAULT NULL,
`HAS_GRAPHICAL_NOTATION_` tinyint(4) DEFAULT NULL,
`SUSPENSION_STATE_` int(11) DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
UNIQUE KEY `ACT_UNIQ_PROCDEF` (`KEY_`,`VERSION_`,`TENANT_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_re_procdef
-- ----------------------------
-- ----------------------------
-- Table structure for act_ru_event_subscr
-- ----------------------------
DROP TABLE IF EXISTS `act_ru_event_subscr`;
CREATE TABLE `act_ru_event_subscr` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`EVENT_TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`EVENT_NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`ACTIVITY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`CONFIGURATION_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`CREATED_` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_EVENT_SUBSCR_CONFIG_` (`CONFIGURATION_`),
KEY `ACT_FK_EVENT_EXEC` (`EXECUTION_ID_`),
CONSTRAINT `ACT_FK_EVENT_EXEC` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `act_ru_execution` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_ru_event_subscr
-- ----------------------------
-- ----------------------------
-- Table structure for act_ru_execution
-- ----------------------------
DROP TABLE IF EXISTS `act_ru_execution`;
CREATE TABLE `act_ru_execution` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`BUSINESS_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PARENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`SUPER_EXEC_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`IS_ACTIVE_` tinyint(4) DEFAULT NULL,
`IS_CONCURRENT_` tinyint(4) DEFAULT NULL,
`IS_SCOPE_` tinyint(4) DEFAULT NULL,
`IS_EVENT_SCOPE_` tinyint(4) DEFAULT NULL,
`SUSPENSION_STATE_` int(11) DEFAULT NULL,
`CACHED_ENT_STATE_` int(11) DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`LOCK_TIME_` timestamp(3) NULL DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_EXEC_BUSKEY` (`BUSINESS_KEY_`),
KEY `ACT_FK_EXE_PROCINST` (`PROC_INST_ID_`),
KEY `ACT_FK_EXE_PARENT` (`PARENT_ID_`),
KEY `ACT_FK_EXE_SUPER` (`SUPER_EXEC_`),
KEY `ACT_FK_EXE_PROCDEF` (`PROC_DEF_ID_`),
CONSTRAINT `ACT_FK_EXE_PARENT` FOREIGN KEY (`PARENT_ID_`) REFERENCES `act_ru_execution` (`ID_`),
CONSTRAINT `ACT_FK_EXE_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `act_re_procdef` (`ID_`),
CONSTRAINT `ACT_FK_EXE_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `act_ru_execution` (`ID_`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `ACT_FK_EXE_SUPER` FOREIGN KEY (`SUPER_EXEC_`) REFERENCES `act_ru_execution` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_ru_execution
-- ----------------------------
-- ----------------------------
-- Table structure for act_ru_identitylink
-- ----------------------------
DROP TABLE IF EXISTS `act_ru_identitylink`;
CREATE TABLE `act_ru_identitylink` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`GROUP_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_IDENT_LNK_USER` (`USER_ID_`),
KEY `ACT_IDX_IDENT_LNK_GROUP` (`GROUP_ID_`),
KEY `ACT_IDX_ATHRZ_PROCEDEF` (`PROC_DEF_ID_`),
KEY `ACT_FK_TSKASS_TASK` (`TASK_ID_`),
KEY `ACT_FK_IDL_PROCINST` (`PROC_INST_ID_`),
CONSTRAINT `ACT_FK_ATHRZ_PROCEDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `act_re_procdef` (`ID_`),
CONSTRAINT `ACT_FK_IDL_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `act_ru_execution` (`ID_`),
CONSTRAINT `ACT_FK_TSKASS_TASK` FOREIGN KEY (`TASK_ID_`) REFERENCES `act_ru_task` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_ru_identitylink
-- ----------------------------
-- ----------------------------
-- Table structure for act_ru_job
-- ----------------------------
DROP TABLE IF EXISTS `act_ru_job`;
CREATE TABLE `act_ru_job` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`LOCK_EXP_TIME_` timestamp(3) NULL DEFAULT NULL,
`LOCK_OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`EXCLUSIVE_` tinyint(1) DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`RETRIES_` int(11) DEFAULT NULL,
`EXCEPTION_STACK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXCEPTION_MSG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`DUEDATE_` timestamp(3) NULL DEFAULT NULL,
`REPEAT_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`HANDLER_TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`HANDLER_CFG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_FK_JOB_EXCEPTION` (`EXCEPTION_STACK_ID_`),
CONSTRAINT `ACT_FK_JOB_EXCEPTION` FOREIGN KEY (`EXCEPTION_STACK_ID_`) REFERENCES `act_ge_bytearray` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_ru_job
-- ----------------------------
-- ----------------------------
-- Table structure for act_ru_task
-- ----------------------------
DROP TABLE IF EXISTS `act_ru_task`;
CREATE TABLE `act_ru_task` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PARENT_TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TASK_DEF_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`DELEGATION_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PRIORITY_` int(11) DEFAULT NULL,
`CREATE_TIME_` timestamp(3) NULL DEFAULT NULL,
`DUE_DATE_` datetime(3) DEFAULT NULL,
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`SUSPENSION_STATE_` int(11) DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
`FORM_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_TASK_CREATE` (`CREATE_TIME_`),
KEY `ACT_FK_TASK_EXE` (`EXECUTION_ID_`),
KEY `ACT_FK_TASK_PROCINST` (`PROC_INST_ID_`),
KEY `ACT_FK_TASK_PROCDEF` (`PROC_DEF_ID_`),
CONSTRAINT `ACT_FK_TASK_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `act_ru_execution` (`ID_`),
CONSTRAINT `ACT_FK_TASK_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `act_re_procdef` (`ID_`),
CONSTRAINT `ACT_FK_TASK_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `act_ru_execution` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_ru_task
-- ----------------------------
-- ----------------------------
-- Table structure for act_ru_variable
-- ----------------------------
DROP TABLE IF EXISTS `act_ru_variable`;
CREATE TABLE `act_ru_variable` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`NAME_` varchar(255) COLLATE utf8_bin NOT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DOUBLE_` double DEFAULT NULL,
`LONG_` bigint(20) DEFAULT NULL,
`TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_VARIABLE_TASK_ID` (`TASK_ID_`),
KEY `ACT_FK_VAR_EXE` (`EXECUTION_ID_`),
KEY `ACT_FK_VAR_PROCINST` (`PROC_INST_ID_`),
KEY `ACT_FK_VAR_BYTEARRAY` (`BYTEARRAY_ID_`),
CONSTRAINT `ACT_FK_VAR_BYTEARRAY` FOREIGN KEY (`BYTEARRAY_ID_`) REFERENCES `act_ge_bytearray` (`ID_`),
CONSTRAINT `ACT_FK_VAR_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `act_ru_execution` (`ID_`),
CONSTRAINT `ACT_FK_VAR_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `act_ru_execution` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of act_ru_variable
-- ----------------------------
-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`NAME` varchar(255) DEFAULT NULL,
`PSW` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of admin
-- ----------------------------
INSERT INTO `admin` VALUES ('1', '小强', '123456');
-- ----------------------------
-- Table structure for article
-- ----------------------------
DROP TABLE IF EXISTS `article`;
CREATE TABLE `article` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`TITLE` varchar(200) DEFAULT NULL COMMENT '标题',
`CONTENT` text COMMENT '内容',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`STATUS` int(1) DEFAULT NULL COMMENT '状态',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of article
-- ----------------------------
INSERT INTO `article` VALUES ('4', 'hahaha', '# this is title111', '2017-05-02 09:37:29', '2017-05-02 09:38:50', '0');
INSERT INTO `article` VALUES ('5', 'this is test', ':bowtie::smile:\n\n# fsdf\n\n', '2017-05-02 09:42:22', '2017-05-02 10:08:38', '0');
-- ----------------------------
-- Table structure for flower_category
-- ----------------------------
DROP TABLE IF EXISTS `flower_category`;
CREATE TABLE `flower_category` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`NAME` varchar(255) DEFAULT NULL COMMENT '名称',
`URL` varchar(255) DEFAULT NULL COMMENT '请求地址',
`IMGPATH` varchar(255) DEFAULT NULL COMMENT '图片路径',
`CREATE_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of flower_category
-- ----------------------------
INSERT INTO `flower_category` VALUES ('1', '草本花卉', 'http://www.aihuhua.com/baike/caoben/', 'http://pic1.huashichang.com/2013/0723/23/51ee9daccb116_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('2', '木本花卉', 'http://www.aihuhua.com/baike/muben/', 'http://pic1.huashichang.com/2013/0723/23/51ee9f923378d_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('3', '球根花卉', 'http://www.aihuhua.com/baike/qiugen/', 'http://pic1.huashichang.com/2013/0723/23/51eea0047647f_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('4', '兰科花卉', 'http://www.aihuhua.com/baike/lan/', 'http://pic1.huashichang.com/2013/0723/23/51eea1653c81a_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('5', '宿根花卉', 'http://www.aihuhua.com/baike/sugen/', 'http://pic1.huashichang.com/2013/0723/23/51eea1534c584_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('6', '仙人掌', 'http://www.aihuhua.com/baike/xianrenzhang/', 'http://pic1.huashichang.com/2013/0723/23/51eea1df50dde_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('7', '多肉多浆植物', 'http://www.aihuhua.com/baike/duorouduojiang/', 'http://pic1.huashichang.com/2013/0723/23/51eea23fc1c8d_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('8', '草坪与地被植物', 'http://www.aihuhua.com/baike/caopingdibei/', 'http://pic1.huashichang.com/2013/0723/23/51eea2b717560_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('9', '水生花卉', 'http://www.aihuhua.com/baike/shuisheng/', 'http://pic1.huashichang.com/2013/0723/23/51eea31fa673f_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('10', '蕨类植物', 'http://www.aihuhua.com/baike/juelei/', 'http://pic1.huashichang.com/2013/0723/23/51eea3824ed86_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('11', '苔藓植物', 'http://www.aihuhua.com/baike/taixian/', 'http://pic1.huashichang.com/2014/1117/23/546a1b7b6251e_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('12', '岩生花卉', 'http://www.aihuhua.com/baike/yansheng/', 'http://pic1.huashichang.com/2013/0723/23/51eea418d9f65_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('13', '食虫植物', 'http://www.aihuhua.com/baike/shichong/', 'http://pic1.huashichang.com/2013/0723/23/51eea473af954_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('14', '凤梨科植物', 'http://www.aihuhua.com/baike/fengli/', 'http://pic1.huashichang.com/2013/0723/23/51eea4dbd157b_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('15', '棕榈科植物', 'http://www.aihuhua.com/baike/zonglv/', 'http://pic1.huashichang.com/2013/0723/23/51eea5ca9e799_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('16', '藻类植物', 'http://www.aihuhua.com/baike/zaolei/', 'http://pic1.huashichang.com/2014/1118/00/546a1ba513c3a_70_70.jpg', '2017-05-12 10:44:00');
INSERT INTO `flower_category` VALUES ('17', '地衣植物', 'http://www.aihuhua.com/baike/diyi/', 'http://pic1.huashichang.com/2014/1118/00/546a1bc3e4733_70_70.jpg', '2017-05-12 10:44:00');
-- ----------------------------
-- Table structure for leave_bill
-- ----------------------------
DROP TABLE IF EXISTS `leave_bill`;
CREATE TABLE `leave_bill` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`DAYS` int(11) DEFAULT NULL COMMENT '请假天数',
`CONTENT` varchar(255) DEFAULT NULL,
`REMARK` varchar(255) DEFAULT NULL,
`LEAVE_DATE` date DEFAULT NULL COMMENT '请假开始时间',
`STATE` int(11) DEFAULT NULL,
`USER_ID` bigint(20) DEFAULT NULL COMMENT '请假人',
`CREATE_DATE` datetime DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of leave_bill
-- ----------------------------
INSERT INTO `leave_bill` VALUES ('1', '5', '回家吃饭。。。', '回家吃饭。。。', '2017-05-17', '0', '2', null);
INSERT INTO `leave_bill` VALUES ('2', '10', '去嗨', '去浪', '2017-05-19', '0', '1', null);
-- ----------------------------
-- Table structure for menu
-- ----------------------------
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`PID` bigint(20) NOT NULL COMMENT '父ID',
`TITLE` varchar(200) DEFAULT NULL COMMENT '菜单名称',
`STATUS` int(11) DEFAULT '1' COMMENT '状态',
`CREATE_TIME` datetime DEFAULT NULL,
`HREF` varchar(200) DEFAULT NULL COMMENT '请求地址',
`ICON` varchar(50) DEFAULT NULL COMMENT '菜单图标',
PRIMARY KEY (`ID`,`PID`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of menu
-- ----------------------------
INSERT INTO `menu` VALUES ('1', '0', '系统管理', '0', '2017-04-19 17:59:10', '', '');
INSERT INTO `menu` VALUES ('3', '1', '用户列表', '0', '2017-04-20 13:25:00', 'user/userPage', '');
INSERT INTO `menu` VALUES ('7', '1', '菜单列表', '0', '2017-04-20 14:13:36', 'menu/menuPage', '');
INSERT INTO `menu` VALUES ('9', '1', '角色管理', '0', '2017-04-24 09:41:00', 'role/rolePage', '');
INSERT INTO `menu` VALUES ('12', '0', '文章管理', '0', '2017-04-28 10:29:42', '', '');
INSERT INTO `menu` VALUES ('13', '12', '文章列表', '0', '2017-04-28 10:31:01', 'article/articlePage', '');
INSERT INTO `menu` VALUES ('14', '0', '功能杂项', '0', '2017-05-02 10:30:57', '', '');
INSERT INTO `menu` VALUES ('15', '14', '二维码', '0', '2017-05-02 10:31:20', 'qrcode/qrcodePage', '');
INSERT INTO `menu` VALUES ('17', '0', '工作流管理', '0', '2017-05-16 17:38:37', '', '');
INSERT INTO `menu` VALUES ('18', '17', '工作列列表', '0', '2017-05-16 17:39:54', 'process/processPage', '');
INSERT INTO `menu` VALUES ('19', '17', '请假列表', '0', '2017-05-17 17:19:49', 'leaveBill/leaveBillPage', '');
INSERT INTO `menu` VALUES ('21', '0', '动态任务管理', '0', '2017-05-19 09:50:28', '', '');
INSERT INTO `menu` VALUES ('22', '21', '任务列表', '0', '2017-05-19 09:51:05', 'job/jobPage', '');
-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`TITLE` varchar(255) DEFAULT NULL COMMENT '角色名称',
`STATUS` int(11) DEFAULT NULL COMMENT '状态',
`CREATE_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES ('1', '超级管理员', '0', '2017-04-19 17:56:02');
INSERT INTO `role` VALUES ('2', 'test', '0', '2017-04-24 10:41:24');
-- ----------------------------
-- Table structure for role_menu
-- ----------------------------
DROP TABLE IF EXISTS `role_menu`;
CREATE TABLE `role_menu` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`ROLE_ID` bigint(20) DEFAULT NULL COMMENT '角色ID',
`MENU_ID` bigint(20) DEFAULT NULL COMMENT '菜单ID',
`CREATE_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=211 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of role_menu
-- ----------------------------
INSERT INTO `role_menu` VALUES ('125', '2', '3', '2017-04-27 17:20:32');
INSERT INTO `role_menu` VALUES ('126', '2', '1', '2017-04-27 17:20:32');
INSERT INTO `role_menu` VALUES ('198', '1', '1', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('199', '1', '3', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('200', '1', '7', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('201', '1', '9', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('202', '1', '12', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('203', '1', '13', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('204', '1', '14', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('205', '1', '15', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('206', '1', '17', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('207', '1', '18', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('208', '1', '19', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('209', '1', '21', '2017-05-19 09:51:15');
INSERT INTO `role_menu` VALUES ('210', '1', '22', '2017-05-19 09:51:15');
-- ----------------------------
-- Table structure for role_user
-- ----------------------------
DROP TABLE IF EXISTS `role_user`;
CREATE TABLE `role_user` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`ROLE_ID` bigint(20) DEFAULT NULL COMMENT '角色ID',
`USER_ID` bigint(20) DEFAULT NULL COMMENT '用户ID',
`CREATE_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of role_user
-- ----------------------------
INSERT INTO `role_user` VALUES ('1', '1', '1', '2017-04-19 17:55:02');
INSERT INTO `role_user` VALUES ('2', '2', '2', '2017-04-24 14:29:10');
INSERT INTO `role_user` VALUES ('5', '1', '5', '2017-04-27 17:42:29');
INSERT INTO `role_user` VALUES ('6', '1', '6', '2017-04-28 09:47:25');
-- ----------------------------
-- Table structure for schedule_job
-- ----------------------------
DROP TABLE IF EXISTS `schedule_job`;
CREATE TABLE `schedule_job` (
`JOB_ID` bigint(20) NOT NULL AUTO_INCREMENT,
`JOB_NAME` varchar(255) DEFAULT NULL COMMENT '任务名称',
`JOB_GROUP` varchar(255) DEFAULT NULL COMMENT '任务分组',
`JOB_STATUS` varchar(255) DEFAULT NULL COMMENT '任务状态 1开启:0停止',
`CRON_EXPRESSION` varchar(255) DEFAULT NULL COMMENT 'cron表达式',
`DESCRIPTION` varchar(255) DEFAULT NULL COMMENT '描述',
`BEAN_CLASS` varchar(255) DEFAULT NULL COMMENT '调用类(包名加类名)',
`SPRING_ID` varchar(255) DEFAULT NULL COMMENT 'spring bean 名称',
`METHOD_NAME` varchar(255) DEFAULT NULL COMMENT '调用方法名称',
`CREATE_TIME` datetime DEFAULT NULL,
`UPDATE_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`JOB_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of schedule_job
-- ----------------------------
INSERT INTO `schedule_job` VALUES ('2', 'main', 'main', '0', '0/1 * * * * ?', ' this is test', 'com.wish.quartz.Handx', '', 'main', '2017-05-08 09:48:23', '2017-05-08 14:25:13');
INSERT INTO `schedule_job` VALUES ('4', 'springBean', 'springBean', '0', '0/1 * * * * ?', '这是调用一个springid测试', '', 'mySpringQuartz', 'run', '2017-05-08 13:58:56', '2017-05-11 14:34:56');
INSERT INTO `schedule_job` VALUES ('5', 'startProcess', 'startProcess', '0', '0/5 * * * * ?', '定时启动请假', '', 'leaveBillService', 'startProcess', '2017-05-19 09:43:09', '2017-05-19 18:18:56');
INSERT INTO `schedule_job` VALUES ('6', 'initRedisData', 'initRedisData', '0', '0/5 * * * * ?', '定时同步数据到redis中', '', 'redisScheduler', 'initRedis', '2017-05-19 10:56:22', '2017-05-19 18:22:37');
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`NAME` varchar(100) DEFAULT NULL COMMENT '姓名',
`PASSWORD` varchar(64) DEFAULT NULL COMMENT '密码',
`ACCOUNT` varchar(64) DEFAULT NULL COMMENT '账号',
`PHONE` varchar(11) DEFAULT NULL COMMENT '联系方式',
`STATUS` int(11) DEFAULT NULL COMMENT '状态',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '新建时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', '超级超级小管理', 'e10adc3949ba59abbe56e057f20f883e', '12345', '110', '0', '2017-04-19 17:13:40');
INSERT INTO `user` VALUES ('2', 'handx', 'e10adc3949ba59abbe56e057f20f883e', '123456', '110', '0', '2017-04-20 14:28:54'); | the_stack |
-- 2019-10-11T08:43:20.971Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Anwendungs-ID', PrintName='Anwendungs-ID',Updated=TO_TIMESTAMP('2019-10-11 11:43:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577187 AND AD_Language='de_CH'
;
-- 2019-10-11T08:43:21.015Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577187,'de_CH')
;
-- 2019-10-11T08:43:25.629Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Anwendungs-ID', PrintName='Anwendungs-ID',Updated=TO_TIMESTAMP('2019-10-11 11:43:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577187 AND AD_Language='de_DE'
;
-- 2019-10-11T08:43:25.633Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577187,'de_DE')
;
-- 2019-10-11T08:43:25.646Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577187,'de_DE')
;
-- 2019-10-11T08:43:25.651Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='applicationID', Name='Anwendungs-ID', Description=NULL, Help=NULL WHERE AD_Element_ID=577187
;
-- 2019-10-11T08:43:25.653Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='applicationID', Name='Anwendungs-ID', Description=NULL, Help=NULL, AD_Element_ID=577187 WHERE UPPER(ColumnName)='APPLICATIONID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-10-11T08:43:25.680Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='applicationID', Name='Anwendungs-ID', Description=NULL, Help=NULL WHERE AD_Element_ID=577187 AND IsCentrallyMaintained='Y'
;
-- 2019-10-11T08:43:25.683Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Anwendungs-ID', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577187) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577187)
;
-- 2019-10-11T08:43:25.737Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Anwendungs-ID', Name='Anwendungs-ID' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=577187)
;
-- 2019-10-11T08:43:25.740Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Anwendungs-ID', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577187
;
-- 2019-10-11T08:43:25.743Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Anwendungs-ID', Description=NULL, Help=NULL WHERE AD_Element_ID = 577187
;
-- 2019-10-11T08:43:25.745Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Anwendungs-ID', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577187
;
-- 2019-10-11T08:43:27.934Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-10-11 11:43:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577187 AND AD_Language='en_US'
;
-- 2019-10-11T08:43:27.935Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577187,'en_US')
;
-- 2019-10-11T08:44:40.146Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutoApplyValidationRule,IsAutocomplete,IsCalculated,IsDimension,IsDLMPartitionBoundary,IsEncrypted,IsForceIncludeInGeneratedModel,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsRangeFilter,IsSelectionColumn,IsShowFilterIncrementButtons,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SelectionColumnSeqNo,SeqNo,Updated,UpdatedBy,Version) VALUES (0,569138,577187,0,10,541411,'applicationID',TO_TIMESTAMP('2019-10-11 11:44:40','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.shipper.gateway.dhl',255,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','Anwendungs-ID',0,0,TO_TIMESTAMP('2019-10-11 11:44:40','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 2019-10-11T08:44:40.150Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Column_ID=569138 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2019-10-11T08:44:40.155Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_Column_Translation_From_AD_Element(577187)
;
-- 2019-10-11T08:45:41.134Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577188,0,'ApplicationToken',TO_TIMESTAMP('2019-10-11 11:45:41','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Application Token','Application Token',TO_TIMESTAMP('2019-10-11 11:45:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-10-11T08:45:41.136Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577188 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2019-10-11T08:45:46.627Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-10-11 11:45:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577188 AND AD_Language='de_CH'
;
-- 2019-10-11T08:45:46.629Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577188,'de_CH')
;
-- 2019-10-11T08:45:47.024Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-10-11 11:45:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577188 AND AD_Language='de_DE'
;
-- 2019-10-11T08:45:47.026Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577188,'de_DE')
;
-- 2019-10-11T08:45:47.033Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577188,'de_DE')
;
-- 2019-10-11T08:45:47.846Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-10-11 11:45:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577188 AND AD_Language='en_US'
;
-- 2019-10-11T08:45:47.848Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577188,'en_US')
;
-- 2019-10-11T08:45:55.333Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Anwendungs-TokenAnwendungs-Token', PrintName='Anwendungs-Token',Updated=TO_TIMESTAMP('2019-10-11 11:45:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577188 AND AD_Language='de_CH'
;
-- 2019-10-11T08:45:55.337Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577188,'de_CH')
;
-- 2019-10-11T08:45:59.081Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Anwendungs-Token', PrintName='Anwendungs-Token',Updated=TO_TIMESTAMP('2019-10-11 11:45:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577188 AND AD_Language='de_DE'
;
-- 2019-10-11T08:45:59.083Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577188,'de_DE')
;
-- 2019-10-11T08:45:59.094Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577188,'de_DE')
;
-- 2019-10-11T08:45:59.096Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='ApplicationToken', Name='Anwendungs-Token', Description=NULL, Help=NULL WHERE AD_Element_ID=577188
;
-- 2019-10-11T08:45:59.097Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ApplicationToken', Name='Anwendungs-Token', Description=NULL, Help=NULL, AD_Element_ID=577188 WHERE UPPER(ColumnName)='APPLICATIONTOKEN' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-10-11T08:45:59.099Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ApplicationToken', Name='Anwendungs-Token', Description=NULL, Help=NULL WHERE AD_Element_ID=577188 AND IsCentrallyMaintained='Y'
;
-- 2019-10-11T08:45:59.100Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Anwendungs-Token', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577188) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577188)
;
-- 2019-10-11T08:45:59.110Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Anwendungs-Token', Name='Anwendungs-Token' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=577188)
;
-- 2019-10-11T08:45:59.112Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Anwendungs-Token', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577188
;
-- 2019-10-11T08:45:59.115Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Anwendungs-Token', Description=NULL, Help=NULL WHERE AD_Element_ID = 577188
;
-- 2019-10-11T08:45:59.116Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Anwendungs-Token', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577188
;
-- 2019-10-11T08:46:12.793Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutoApplyValidationRule,IsAutocomplete,IsCalculated,IsDimension,IsDLMPartitionBoundary,IsEncrypted,IsForceIncludeInGeneratedModel,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsRangeFilter,IsSelectionColumn,IsShowFilterIncrementButtons,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SelectionColumnSeqNo,SeqNo,Updated,UpdatedBy,Version) VALUES (0,569139,577188,0,10,541411,'ApplicationToken',TO_TIMESTAMP('2019-10-11 11:46:12','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.shipper.gateway.dhl',255,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','Anwendungs-Token',0,0,TO_TIMESTAMP('2019-10-11 11:46:12','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 2019-10-11T08:46:12.795Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Column_ID=569139 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2019-10-11T08:46:12.799Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_Column_Translation_From_AD_Element(577188)
;
-- 2019-10-11T08:49:42.659Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,569138,589547,0,542055,0,TO_TIMESTAMP('2019-10-11 11:49:42','YYYY-MM-DD HH24:MI:SS'),100,0,'D',0,'Y','Y','Y','N','N','N','N','N','Anwendungs-ID',20,20,0,1,1,TO_TIMESTAMP('2019-10-11 11:49:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-10-11T08:49:42.663Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Field_ID=589547 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2019-10-11T08:49:42.667Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(577187)
;
-- 2019-10-11T08:49:42.679Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=589547
;
-- 2019-10-11T08:49:42.690Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(589547)
;
-- 2019-10-11T08:49:52.008Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET DisplayLength=1024,Updated=TO_TIMESTAMP('2019-10-11 11:49:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=589547
;
-- 2019-10-11T08:50:08.419Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,569139,589548,0,542055,0,TO_TIMESTAMP('2019-10-11 11:50:08','YYYY-MM-DD HH24:MI:SS'),100,1024,'D',0,'Y','Y','Y','N','N','N','N','N','Anwendungs-Token',30,30,0,1,1,TO_TIMESTAMP('2019-10-11 11:50:08','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-10-11T08:50:08.421Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Field_ID=589548 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2019-10-11T08:50:08.424Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(577188)
;
-- 2019-10-11T08:50:08.430Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=589548
;
-- 2019-10-11T08:50:08.432Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(589548)
;
-- 2019-10-11T08:50:52.831Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('DHL_Shipper_Config','ALTER TABLE public.DHL_Shipper_Config ADD COLUMN applicationID VARCHAR(255)')
;
-- 2019-10-11T09:10:50.974Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577189,0,'AccountNumber',TO_TIMESTAMP('2019-10-11 12:10:50','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Account Number','Account Number',TO_TIMESTAMP('2019-10-11 12:10:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-10-11T09:10:50.978Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577189 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2019-10-11T09:10:54.689Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-10-11 12:10:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577189 AND AD_Language='de_CH'
;
-- 2019-10-11T09:10:54.692Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577189,'de_CH')
;
-- 2019-10-11T09:10:55.026Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-10-11 12:10:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577189 AND AD_Language='de_DE'
;
-- 2019-10-11T09:10:55.027Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577189,'de_DE')
;
-- 2019-10-11T09:10:55.037Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577189,'de_DE')
;
-- 2019-10-11T09:10:56.007Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-10-11 12:10:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577189 AND AD_Language='en_US'
;
-- 2019-10-11T09:10:56.009Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577189,'en_US')
;
-- 2019-10-11T09:10:59.319Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Kontonummer Number', PrintName='Kontonummer',Updated=TO_TIMESTAMP('2019-10-11 12:10:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577189 AND AD_Language='de_CH'
;
-- 2019-10-11T09:10:59.320Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577189,'de_CH')
;
-- 2019-10-11T09:11:02.940Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Kontonummer', PrintName='Kontonummer',Updated=TO_TIMESTAMP('2019-10-11 12:11:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577189 AND AD_Language='de_DE'
;
-- 2019-10-11T09:11:02.943Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577189,'de_DE')
;
-- 2019-10-11T09:11:02.957Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577189,'de_DE')
;
-- 2019-10-11T09:11:02.967Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='AccountNumber', Name='Kontonummer', Description=NULL, Help=NULL WHERE AD_Element_ID=577189
;
-- 2019-10-11T09:11:02.968Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='AccountNumber', Name='Kontonummer', Description=NULL, Help=NULL, AD_Element_ID=577189 WHERE UPPER(ColumnName)='ACCOUNTNUMBER' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-10-11T09:11:02.970Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='AccountNumber', Name='Kontonummer', Description=NULL, Help=NULL WHERE AD_Element_ID=577189 AND IsCentrallyMaintained='Y'
;
-- 2019-10-11T09:11:02.971Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Kontonummer', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577189) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577189)
;
-- 2019-10-11T09:11:02.981Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Kontonummer', Name='Kontonummer' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=577189)
;
-- 2019-10-11T09:11:02.983Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Kontonummer', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577189
;
-- 2019-10-11T09:11:02.985Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Kontonummer', Description=NULL, Help=NULL WHERE AD_Element_ID = 577189
;
-- 2019-10-11T09:11:02.987Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Kontonummer', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577189
;
-- 2019-10-11T09:11:35.671Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutoApplyValidationRule,IsAutocomplete,IsCalculated,IsDimension,IsDLMPartitionBoundary,IsEncrypted,IsForceIncludeInGeneratedModel,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsRangeFilter,IsSelectionColumn,IsShowFilterIncrementButtons,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SelectionColumnSeqNo,SeqNo,Updated,UpdatedBy,Version) VALUES (0,569140,577189,0,10,541411,'AccountNumber',TO_TIMESTAMP('2019-10-11 12:11:35','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.shipper.gateway.dhl',255,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','Kontonummer',0,0,TO_TIMESTAMP('2019-10-11 12:11:35','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 2019-10-11T09:11:35.674Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Column_ID=569140 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2019-10-11T09:11:35.678Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_Column_Translation_From_AD_Element(577189)
;
-- 2019-10-11T09:11:38.787Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('DHL_Shipper_Config','ALTER TABLE public.DHL_Shipper_Config ADD COLUMN AccountNumber VARCHAR(255)')
;
-- 2019-10-11T09:12:00.905Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,569140,589549,0,542055,0,TO_TIMESTAMP('2019-10-11 12:12:00','YYYY-MM-DD HH24:MI:SS'),100,255,'D',0,'Y','Y','Y','N','N','N','N','N','Kontonummer',40,40,0,1,1,TO_TIMESTAMP('2019-10-11 12:12:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-10-11T09:12:00.907Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Field_ID=589549 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2019-10-11T09:12:00.916Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(577189)
;
-- 2019-10-11T09:12:00.922Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=589549
;
-- 2019-10-11T09:12:00.924Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(589549)
; | the_stack |
SET search_path = aouser, pg_catalog;
--
-- Name: document upd_pg_date; Type: TRIGGER; Schema: aouser; Owner: fec
--
CREATE TRIGGER upd_pg_date BEFORE UPDATE ON document FOR EACH ROW EXECUTE PROCEDURE public.upd_pg_date();
--
-- Name: ao upd_pg_date; Type: TRIGGER; Schema: aouser; Owner: fec
--
CREATE TRIGGER upd_pg_date BEFORE UPDATE ON ao FOR EACH ROW EXECUTE PROCEDURE public.upd_pg_date();
SET search_path = disclosure, pg_catalog;
--
-- Name: f_item_receipt_or_exp f_item_sched_a_after_trigger; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER f_item_sched_a_after_trigger AFTER INSERT OR UPDATE ON f_item_receipt_or_exp FOR EACH ROW EXECUTE PROCEDURE public.ofec_sched_a_insert_update_queues('2007');
--
-- Name: f_item_receipt_or_exp f_item_sched_a_before_trigger; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER f_item_sched_a_before_trigger BEFORE DELETE OR UPDATE ON f_item_receipt_or_exp FOR EACH ROW EXECUTE PROCEDURE public.ofec_sched_a_delete_update_queues('2007');
--
-- Name: f_item_receipt_or_exp f_item_sched_b_after_trigger; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER f_item_sched_b_after_trigger AFTER INSERT OR UPDATE ON f_item_receipt_or_exp FOR EACH ROW EXECUTE PROCEDURE public.ofec_sched_b_insert_update_queues('2007');
--
-- Name: f_item_receipt_or_exp f_item_sched_b_before_trigger; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER f_item_sched_b_before_trigger BEFORE DELETE OR UPDATE ON f_item_receipt_or_exp FOR EACH ROW EXECUTE PROCEDURE public.ofec_sched_b_delete_update_queues('2007');
--
-- Name: nml_sched_e nml_form_24_trigger; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER nml_form_24_trigger BEFORE INSERT OR DELETE OR UPDATE ON nml_sched_e FOR EACH ROW EXECUTE PROCEDURE public.ofec_sched_e_update_notice_queues();
--
-- Name: nml_sched_a nml_sched_a_after_trigger; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER nml_sched_a_after_trigger AFTER INSERT OR UPDATE ON nml_sched_a FOR EACH ROW EXECUTE PROCEDURE public.ofec_sched_a_insert_update_queues('2007');
--
-- Name: nml_sched_a nml_sched_a_before_trigger; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER nml_sched_a_before_trigger BEFORE DELETE OR UPDATE ON nml_sched_a FOR EACH ROW EXECUTE PROCEDURE public.ofec_sched_a_delete_update_queues('2007');
--
-- Name: nml_sched_b nml_sched_b_after_trigger; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER nml_sched_b_after_trigger AFTER INSERT OR UPDATE ON nml_sched_b FOR EACH ROW EXECUTE PROCEDURE public.ofec_sched_b_insert_update_queues('2007');
--
-- Name: nml_sched_b nml_sched_b_before_trigger; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER nml_sched_b_before_trigger BEFORE DELETE OR UPDATE ON nml_sched_b FOR EACH ROW EXECUTE PROCEDURE public.ofec_sched_b_delete_update_queues('2007');
--
-- Name: nml_form_57 ofec_f57_trigger; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER ofec_f57_trigger BEFORE INSERT OR DELETE OR UPDATE ON nml_form_57 FOR EACH ROW EXECUTE PROCEDURE public.ofec_f57_update_notice_queues();
--
-- Name: nml_sched_d ofec_sched_d_queue_trigger; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER ofec_sched_d_queue_trigger BEFORE INSERT OR UPDATE ON nml_sched_d FOR EACH ROW EXECUTE PROCEDURE public.ofec_sched_d_update();
--
-- Name: fec_fitem_sched_a tri_fec_fitem_sched_a; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a BEFORE INSERT ON fec_fitem_sched_a FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1975_1976 tri_fec_fitem_sched_a_1975_1976; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1975_1976 BEFORE INSERT ON fec_fitem_sched_a_1975_1976 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1977_1978 tri_fec_fitem_sched_a_1977_1978; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1977_1978 BEFORE INSERT ON fec_fitem_sched_a_1977_1978 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1979_1980 tri_fec_fitem_sched_a_1979_1980; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1979_1980 BEFORE INSERT ON fec_fitem_sched_a_1979_1980 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1981_1982 tri_fec_fitem_sched_a_1981_1982; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1981_1982 BEFORE INSERT ON fec_fitem_sched_a_1981_1982 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1983_1984 tri_fec_fitem_sched_a_1983_1984; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1983_1984 BEFORE INSERT ON fec_fitem_sched_a_1983_1984 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1985_1986 tri_fec_fitem_sched_a_1985_1986; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1985_1986 BEFORE INSERT ON fec_fitem_sched_a_1985_1986 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1987_1988 tri_fec_fitem_sched_a_1987_1988; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1987_1988 BEFORE INSERT ON fec_fitem_sched_a_1987_1988 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1989_1990 tri_fec_fitem_sched_a_1989_1990; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1989_1990 BEFORE INSERT ON fec_fitem_sched_a_1989_1990 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1991_1992 tri_fec_fitem_sched_a_1991_1992; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1991_1992 BEFORE INSERT ON fec_fitem_sched_a_1991_1992 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1993_1994 tri_fec_fitem_sched_a_1993_1994; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1993_1994 BEFORE INSERT ON fec_fitem_sched_a_1993_1994 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1995_1996 tri_fec_fitem_sched_a_1995_1996; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1995_1996 BEFORE INSERT ON fec_fitem_sched_a_1995_1996 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1997_1998 tri_fec_fitem_sched_a_1997_1998; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1997_1998 BEFORE INSERT ON fec_fitem_sched_a_1997_1998 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_1999_2000 tri_fec_fitem_sched_a_1999_2000; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_1999_2000 BEFORE INSERT ON fec_fitem_sched_a_1999_2000 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_2001_2002 tri_fec_fitem_sched_a_2001_2002; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_2001_2002 BEFORE INSERT ON fec_fitem_sched_a_2001_2002 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_2003_2004 tri_fec_fitem_sched_a_2003_2004; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_2003_2004 BEFORE INSERT ON fec_fitem_sched_a_2003_2004 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_2005_2006 tri_fec_fitem_sched_a_2005_2006; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_2005_2006 BEFORE INSERT ON fec_fitem_sched_a_2005_2006 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_2007_2008 tri_fec_fitem_sched_a_2007_2008; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_2007_2008 BEFORE INSERT ON fec_fitem_sched_a_2007_2008 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_2009_2010 tri_fec_fitem_sched_a_2009_2010; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_2009_2010 BEFORE INSERT ON fec_fitem_sched_a_2009_2010 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_2011_2012 tri_fec_fitem_sched_a_2011_2012; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_2011_2012 BEFORE INSERT ON fec_fitem_sched_a_2011_2012 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_2013_2014 tri_fec_fitem_sched_a_2013_2014; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_2013_2014 BEFORE INSERT ON fec_fitem_sched_a_2013_2014 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_2015_2016 tri_fec_fitem_sched_a_2015_2016; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_2015_2016 BEFORE INSERT ON fec_fitem_sched_a_2015_2016 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_a_2017_2018 tri_fec_fitem_sched_a_2017_2018; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_a_2017_2018 BEFORE INSERT ON fec_fitem_sched_a_2017_2018 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_a_insert();
--
-- Name: fec_fitem_sched_b tri_fec_fitem_sched_b; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b BEFORE INSERT ON fec_fitem_sched_b FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1975_1976 tri_fec_fitem_sched_b_1975_1976; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1975_1976 BEFORE INSERT ON fec_fitem_sched_b_1975_1976 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1977_1978 tri_fec_fitem_sched_b_1977_1978; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1977_1978 BEFORE INSERT ON fec_fitem_sched_b_1977_1978 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1979_1980 tri_fec_fitem_sched_b_1979_1980; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1979_1980 BEFORE INSERT ON fec_fitem_sched_b_1979_1980 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1981_1982 tri_fec_fitem_sched_b_1981_1982; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1981_1982 BEFORE INSERT ON fec_fitem_sched_b_1981_1982 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1983_1984 tri_fec_fitem_sched_b_1983_1984; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1983_1984 BEFORE INSERT ON fec_fitem_sched_b_1983_1984 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1985_1986 tri_fec_fitem_sched_b_1985_1986; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1985_1986 BEFORE INSERT ON fec_fitem_sched_b_1985_1986 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1987_1988 tri_fec_fitem_sched_b_1987_1988; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1987_1988 BEFORE INSERT ON fec_fitem_sched_b_1987_1988 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1989_1990 tri_fec_fitem_sched_b_1989_1990; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1989_1990 BEFORE INSERT ON fec_fitem_sched_b_1989_1990 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1991_1992 tri_fec_fitem_sched_b_1991_1992; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1991_1992 BEFORE INSERT ON fec_fitem_sched_b_1991_1992 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1993_1994 tri_fec_fitem_sched_b_1993_1994; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1993_1994 BEFORE INSERT ON fec_fitem_sched_b_1993_1994 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1995_1996 tri_fec_fitem_sched_b_1995_1996; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1995_1996 BEFORE INSERT ON fec_fitem_sched_b_1995_1996 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1997_1998 tri_fec_fitem_sched_b_1997_1998; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1997_1998 BEFORE INSERT ON fec_fitem_sched_b_1997_1998 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_1999_2000 tri_fec_fitem_sched_b_1999_2000; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_1999_2000 BEFORE INSERT ON fec_fitem_sched_b_1999_2000 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_2001_2002 tri_fec_fitem_sched_b_2001_2002; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_2001_2002 BEFORE INSERT ON fec_fitem_sched_b_2001_2002 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_2003_2004 tri_fec_fitem_sched_b_2003_2004; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_2003_2004 BEFORE INSERT ON fec_fitem_sched_b_2003_2004 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_2005_2006 tri_fec_fitem_sched_b_2005_2006; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_2005_2006 BEFORE INSERT ON fec_fitem_sched_b_2005_2006 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_2007_2008 tri_fec_fitem_sched_b_2007_2008; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_2007_2008 BEFORE INSERT ON fec_fitem_sched_b_2007_2008 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_2009_2010 tri_fec_fitem_sched_b_2009_2010; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_2009_2010 BEFORE INSERT ON fec_fitem_sched_b_2009_2010 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_2011_2012 tri_fec_fitem_sched_b_2011_2012; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_2011_2012 BEFORE INSERT ON fec_fitem_sched_b_2011_2012 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_2013_2014 tri_fec_fitem_sched_b_2013_2014; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_2013_2014 BEFORE INSERT ON fec_fitem_sched_b_2013_2014 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_2015_2016 tri_fec_fitem_sched_b_2015_2016; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_2015_2016 BEFORE INSERT ON fec_fitem_sched_b_2015_2016 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_b_2017_2018 tri_fec_fitem_sched_b_2017_2018; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_b_2017_2018 BEFORE INSERT ON fec_fitem_sched_b_2017_2018 FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_b_insert();
--
-- Name: fec_fitem_sched_e tri_fec_fitem_sched_e; Type: TRIGGER; Schema: disclosure; Owner: fec
--
CREATE TRIGGER tri_fec_fitem_sched_e BEFORE INSERT ON fec_fitem_sched_e FOR EACH ROW EXECUTE PROCEDURE fec_fitem_sched_e_insert();
SET search_path = public, pg_catalog;
--
-- Name: ofec_sched_a_master insert_sched_a_trigger_tmp; Type: TRIGGER; Schema: public; Owner: fec
--
CREATE TRIGGER insert_sched_a_trigger_tmp BEFORE INSERT ON ofec_sched_a_master FOR EACH ROW EXECUTE PROCEDURE insert_sched_master('1978');
--
-- Name: ofec_sched_b_master insert_sched_b_trigger_tmp; Type: TRIGGER; Schema: public; Owner: fec
--
CREATE TRIGGER insert_sched_b_trigger_tmp BEFORE INSERT ON ofec_sched_b_master FOR EACH ROW EXECUTE PROCEDURE insert_sched_master('1978'); | the_stack |
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--;
-- Schema upgrade from 4.11.2.0 to 4.12.0.0
--;
-- [CLOUDSTACK-10314] Add reason column to ACL rule table
ALTER TABLE `cloud`.`network_acl_item` ADD COLUMN `reason` VARCHAR(2500) AFTER `display`;
-- [CLOUDSTACK-9846] Make provision to store content and subject for Alerts in separate columns.
ALTER TABLE `cloud`.`alert` ADD COLUMN `content` VARCHAR(5000);
-- Fix the name of the column used to hold IPv4 range in 'vlan' table.
ALTER TABLE `vlan` CHANGE `description` `ip4_range` varchar(255);
-- [CLOUDSTACK-10344] bug when moving ACL rules (change order with drag and drop)
-- We are only adding the permission to the default rules. Any custom rule must be configured by the root admin.
INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, `permission`, `sort_order`) values (UUID(), 2, 'moveNetworkAclItem', 'ALLOW', 100) ON DUPLICATE KEY UPDATE rule=rule;
INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, `permission`, `sort_order`) values (UUID(), 3, 'moveNetworkAclItem', 'ALLOW', 302) ON DUPLICATE KEY UPDATE rule=rule;
INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, `permission`, `sort_order`) values (UUID(), 4, 'moveNetworkAclItem', 'ALLOW', 260) ON DUPLICATE KEY UPDATE rule=rule;
UPDATE `cloud`.`async_job` SET `removed` = now() WHERE `removed` IS NULL;
-- PR#1448 update description of 'execute.in.sequence.network.element.commands' parameter to reflect an unused command that has been removed. The removed class command is 'UserDataCommand'.
update `cloud`.`configuration` set description = 'If set to true, DhcpEntryCommand, SavePasswordCommand, VmDataCommand will be synchronized on the agent side. If set to false, these commands become asynchronous. Default value is false.' where name = 'execute.in.sequence.network.element.commands';
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'StorageManager', 'kvm.storage.offline.migration.wait', '10800', 'Timeout in seconds for offline (non-live) storage migration to complete on KVM', '10800', null, 'Global', 0);
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'StorageManager', 'kvm.storage.online.migration.wait', '10800', 'Timeout in seconds for online (live) storage migration to complete on KVM (migrateVirtualMachineWithVolume)', '10800', null, 'Global', 0);
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'StorageManager', 'max.number.managed.clustered.file.systems', '200', 'XenServer and VMware only: Maximum number of managed SRs or datastores per compute cluster', '200', null, 'Cluster', 0);
-- add KVM Guest OS mapping for Windows Server 2019
INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (276, UUID(), 6, 'Windows Server 2019 (64-bit)', now());
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Windows Server 2019', 276, now(), 0);
-- changed fingerprint type to TEXT, it avoids db exception when creating the certificate issue #3123
ALTER TABLE `cloud`.`sslcerts` MODIFY `fingerprint` TEXT;
-- add KVM / qemu io bursting options PR 3133
alter table `cloud`.`disk_offering` add `bytes_read_rate_max` bigint(20) default null after `bytes_read_rate`;
alter table `cloud`.`disk_offering` add `bytes_read_rate_max_length` bigint(20) default null after `bytes_read_rate_max`;
alter table `cloud`.`disk_offering` add `bytes_write_rate_max` bigint(20) default null after `bytes_write_rate`;
alter table `cloud`.`disk_offering` add `bytes_write_rate_max_length` bigint(20) default null after `bytes_write_rate_max`;
alter table `cloud`.`disk_offering` add `iops_read_rate_max` bigint(20) default null after `iops_read_rate`;
alter table `cloud`.`disk_offering` add `iops_read_rate_max_length` bigint(20) default null after `iops_read_rate_max`;
alter table `cloud`.`disk_offering` add `iops_write_rate_max` bigint(20) default null after `iops_write_rate`;
alter table `cloud`.`disk_offering` add `iops_write_rate_max_length` bigint(20) default null after `iops_write_rate_max`;
CREATE OR REPLACE VIEW `cloud`.`disk_offering_view` AS
SELECT
`disk_offering`.`id` AS `id`,
`disk_offering`.`uuid` AS `uuid`,
`disk_offering`.`name` AS `name`,
`disk_offering`.`display_text` AS `display_text`,
`disk_offering`.`provisioning_type` AS `provisioning_type`,
`disk_offering`.`disk_size` AS `disk_size`,
`disk_offering`.`min_iops` AS `min_iops`,
`disk_offering`.`max_iops` AS `max_iops`,
`disk_offering`.`created` AS `created`,
`disk_offering`.`tags` AS `tags`,
`disk_offering`.`customized` AS `customized`,
`disk_offering`.`customized_iops` AS `customized_iops`,
`disk_offering`.`removed` AS `removed`,
`disk_offering`.`use_local_storage` AS `use_local_storage`,
`disk_offering`.`system_use` AS `system_use`,
`disk_offering`.`hv_ss_reserve` AS `hv_ss_reserve`,
`disk_offering`.`bytes_read_rate` AS `bytes_read_rate`,
`disk_offering`.`bytes_read_rate_max` AS `bytes_read_rate_max`,
`disk_offering`.`bytes_read_rate_max_length` AS `bytes_read_rate_max_length`,
`disk_offering`.`bytes_write_rate` AS `bytes_write_rate`,
`disk_offering`.`bytes_write_rate_max` AS `bytes_write_rate_max`,
`disk_offering`.`bytes_write_rate_max_length` AS `bytes_write_rate_max_length`,
`disk_offering`.`iops_read_rate` AS `iops_read_rate`,
`disk_offering`.`iops_read_rate_max` AS `iops_read_rate_max`,
`disk_offering`.`iops_read_rate_max_length` AS `iops_read_rate_max_length`,
`disk_offering`.`iops_write_rate` AS `iops_write_rate`,
`disk_offering`.`iops_write_rate_max` AS `iops_write_rate_max`,
`disk_offering`.`iops_write_rate_max_length` AS `iops_write_rate_max_length`,
`disk_offering`.`cache_mode` AS `cache_mode`,
`disk_offering`.`sort_key` AS `sort_key`,
`disk_offering`.`type` AS `type`,
`disk_offering`.`display_offering` AS `display_offering`,
`domain`.`id` AS `domain_id`,
`domain`.`uuid` AS `domain_uuid`,
`domain`.`name` AS `domain_name`,
`domain`.`path` AS `domain_path`
FROM
(`disk_offering`
LEFT JOIN `domain` ON ((`disk_offering`.`domain_id` = `domain`.`id`)))
WHERE
(`disk_offering`.`state` = 'ACTIVE');
CREATE OR REPLACE VIEW `cloud`.`service_offering_view` AS
SELECT
`service_offering`.`id` AS `id`,
`disk_offering`.`uuid` AS `uuid`,
`disk_offering`.`name` AS `name`,
`disk_offering`.`display_text` AS `display_text`,
`disk_offering`.`provisioning_type` AS `provisioning_type`,
`disk_offering`.`created` AS `created`,
`disk_offering`.`tags` AS `tags`,
`disk_offering`.`removed` AS `removed`,
`disk_offering`.`use_local_storage` AS `use_local_storage`,
`disk_offering`.`system_use` AS `system_use`,
`disk_offering`.`customized_iops` AS `customized_iops`,
`disk_offering`.`min_iops` AS `min_iops`,
`disk_offering`.`max_iops` AS `max_iops`,
`disk_offering`.`hv_ss_reserve` AS `hv_ss_reserve`,
`disk_offering`.`bytes_read_rate` AS `bytes_read_rate`,
`disk_offering`.`bytes_read_rate_max` AS `bytes_read_rate_max`,
`disk_offering`.`bytes_read_rate_max_length` AS `bytes_read_rate_max_length`,
`disk_offering`.`bytes_write_rate` AS `bytes_write_rate`,
`disk_offering`.`bytes_write_rate_max` AS `bytes_write_rate_max`,
`disk_offering`.`bytes_write_rate_max_length` AS `bytes_write_rate_max_length`,
`disk_offering`.`iops_read_rate` AS `iops_read_rate`,
`disk_offering`.`iops_read_rate_max` AS `iops_read_rate_max`,
`disk_offering`.`iops_read_rate_max_length` AS `iops_read_rate_max_length`,
`disk_offering`.`iops_write_rate` AS `iops_write_rate`,
`disk_offering`.`iops_write_rate_max` AS `iops_write_rate_max`,
`disk_offering`.`iops_write_rate_max_length` AS `iops_write_rate_max_length`,
`disk_offering`.`cache_mode` AS `cache_mode`,
`service_offering`.`cpu` AS `cpu`,
`service_offering`.`speed` AS `speed`,
`service_offering`.`ram_size` AS `ram_size`,
`service_offering`.`nw_rate` AS `nw_rate`,
`service_offering`.`mc_rate` AS `mc_rate`,
`service_offering`.`ha_enabled` AS `ha_enabled`,
`service_offering`.`limit_cpu_use` AS `limit_cpu_use`,
`service_offering`.`host_tag` AS `host_tag`,
`service_offering`.`default_use` AS `default_use`,
`service_offering`.`vm_type` AS `vm_type`,
`service_offering`.`sort_key` AS `sort_key`,
`service_offering`.`is_volatile` AS `is_volatile`,
`service_offering`.`deployment_planner` AS `deployment_planner`,
`domain`.`id` AS `domain_id`,
`domain`.`uuid` AS `domain_uuid`,
`domain`.`name` AS `domain_name`,
`domain`.`path` AS `domain_path`
FROM
((`service_offering`
JOIN `disk_offering` ON ((`service_offering`.`id` = `disk_offering`.`id`)))
LEFT JOIN `domain` ON ((`disk_offering`.`domain_id` = `domain`.`id`)))
WHERE
(`disk_offering`.`state` = 'Active');
-- PR#2578 New column for listManagementServers API call
ALTER TABLE `mshost` ADD COLUMN `uuid` varchar(40) AFTER `name`; | the_stack |
-- 2017-08-17T18:51:34.282
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543396,0,'AD_UI_ElementType',TO_TIMESTAMP('2017-08-17 18:51:34','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Element type','Element type',TO_TIMESTAMP('2017-08-17 18:51:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-08-17T18:51:34.286
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543396 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2017-08-17T19:15:21.728
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540736,TO_TIMESTAMP('2017-08-17 19:15:21','YYYY-MM-DD HH24:MI:SS'),100,'UI element type','D','Y','N','AD_UI_ElementType',TO_TIMESTAMP('2017-08-17 19:15:21','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-08-17T19:15:21.729
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540736 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-08-17T19:15:58.532
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,540736,541297,TO_TIMESTAMP('2017-08-17 19:15:58','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Field',TO_TIMESTAMP('2017-08-17 19:15:58','YYYY-MM-DD HH24:MI:SS'),100,'F','Field')
;
-- 2017-08-17T19:15:58.536
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541297 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-08-17T19:17:37.503
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,540736,541298,TO_TIMESTAMP('2017-08-17 19:17:37','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Labels',TO_TIMESTAMP('2017-08-17 19:17:37','YYYY-MM-DD HH24:MI:SS'),100,'L','Labels')
;
-- 2017-08-17T19:17:37.506
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541298 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-08-17T19:18:31.185
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,DefaultValue,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsDLMPartitionBoundary,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,557048,543396,0,17,540736,540783,'N','AD_UI_ElementType',TO_TIMESTAMP('2017-08-17 19:18:31','YYYY-MM-DD HH24:MI:SS'),100,'N','F','D',1,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','Y','N','Element type',0,TO_TIMESTAMP('2017-08-17 19:18:31','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 2017-08-17T19:18:31.187
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=557048 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2017-08-17T19:18:36.047
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('ad_ui_element','ALTER TABLE public.AD_UI_Element ADD COLUMN AD_UI_ElementType CHAR(1) DEFAULT ''F'' NOT NULL')
;
-- 2017-08-17T19:20:00.669
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,557048,559467,0,540754,TO_TIMESTAMP('2017-08-17 19:20:00','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','Y','Y','N','N','N','N','N','Element type',TO_TIMESTAMP('2017-08-17 19:20:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-08-17T19:20:00.673
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=559467 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-08-17T19:20:42.854
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=60,Updated=TO_TIMESTAMP('2017-08-17 19:20:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=559467
;
-- 2017-08-17T19:20:42.859
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=70,Updated=TO_TIMESTAMP('2017-08-17 19:20:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557167
;
-- 2017-08-17T19:20:42.865
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=80,Updated=TO_TIMESTAMP('2017-08-17 19:20:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557208
;
-- 2017-08-17T19:20:42.871
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90,Updated=TO_TIMESTAMP('2017-08-17 19:20:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558504
;
-- 2017-08-17T19:20:42.877
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=100,Updated=TO_TIMESTAMP('2017-08-17 19:20:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557169
;
-- 2017-08-17T19:20:42.882
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110,Updated=TO_TIMESTAMP('2017-08-17 19:20:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557210
;
-- 2017-08-17T19:20:42.886
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=120,Updated=TO_TIMESTAMP('2017-08-17 19:20:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557180
;
-- 2017-08-17T19:20:42.890
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=130,Updated=TO_TIMESTAMP('2017-08-17 19:20:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557211
;
-- 2017-08-17T19:20:42.892
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=140,Updated=TO_TIMESTAMP('2017-08-17 19:20:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557212
;
-- 2017-08-17T19:20:42.895
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=150,Updated=TO_TIMESTAMP('2017-08-17 19:20:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557213
;
-- 2017-08-17T19:20:42.900
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=160,Updated=TO_TIMESTAMP('2017-08-17 19:20:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557214
;
-- 2017-08-17T19:49:49.784
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543398,0,'Labels_Tab_ID',TO_TIMESTAMP('2017-08-17 19:49:49','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Labels content tab','Labels content tab',TO_TIMESTAMP('2017-08-17 19:49:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-08-17T19:49:49.789
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543398 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2017-08-17T19:51:07.572
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543399,0,'Labels_Selector_Field_ID',TO_TIMESTAMP('2017-08-17 19:51:07','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Labels selector field','Labels selector field',TO_TIMESTAMP('2017-08-17 19:51:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-08-17T19:51:07.576
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543399 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2017-08-17T19:52:57.044
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Val_Rule_ID,AD_Reference_ID,FieldLength,Version,IsKey,IsParent,IsTranslated,IsIdentifier,SeqNo,AD_Client_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,DDL_NoForeignKey,IsSelectionColumn,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,IsEncrypted,IsAdvancedText,IsLazyLoading,AD_Table_ID,IsCalculated,AllowZoomTo,AD_Reference_Value_ID,ColumnName,IsGenericZoomOrigin,AD_Column_ID,IsDimension,IsMandatory,IsStaleable,IsUseDocSequence,IsDLMPartitionBoundary,IsGenericZoomKeyColumn,AD_Org_ID,Name,EntityType) VALUES (163,18,10,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2017-08-17 19:52:56','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-08-17 19:52:56','YYYY-MM-DD HH24:MI:SS'),100,543398,'Y','N','N','N','N','N','Y','N','N','N',540783,'N','N',278,'Labels_Tab_ID','N',557050,'N','N','N','N','N','N',0,'Labels content tab','D')
;
-- 2017-08-17T19:52:57.045
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=557050 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2017-08-17T19:53:54.825
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540737,TO_TIMESTAMP('2017-08-17 19:53:54','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','AD_Field',TO_TIMESTAMP('2017-08-17 19:53:54','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 2017-08-17T19:53:54.827
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540737 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-08-17T19:54:30.188
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy) VALUES (0,167,0,540737,107,TO_TIMESTAMP('2017-08-17 19:54:30','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_TIMESTAMP('2017-08-17 19:54:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-08-17T19:55:21.104
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,540364,'AD_Field.AD_Tab_ID=@Labels_Tab_ID@',TO_TIMESTAMP('2017-08-17 19:55:20','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','AD_Field_for_Labels_Tab_ID','S',TO_TIMESTAMP('2017-08-17 19:55:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-08-17T19:56:00.143
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Val_Rule_ID,AD_Reference_ID,FieldLength,Version,IsKey,IsParent,IsTranslated,IsIdentifier,SeqNo,AD_Client_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,DDL_NoForeignKey,IsSelectionColumn,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,IsEncrypted,IsAdvancedText,IsLazyLoading,AD_Table_ID,IsCalculated,AllowZoomTo,AD_Reference_Value_ID,ColumnName,IsGenericZoomOrigin,AD_Column_ID,IsDimension,IsMandatory,IsStaleable,IsUseDocSequence,IsDLMPartitionBoundary,IsGenericZoomKeyColumn,AD_Org_ID,Name,EntityType) VALUES (540364,18,10,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2017-08-17 19:56:00','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-08-17 19:56:00','YYYY-MM-DD HH24:MI:SS'),100,543399,'Y','N','N','N','N','N','Y','N','N','N',540783,'N','N',540737,'Labels_Selector_Field_ID','N',557051,'N','N','N','N','N','N',0,'Labels selector field','D')
;
-- 2017-08-17T19:56:00.147
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=557051 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2017-08-17T19:56:35.221
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO t_alter_column values('ad_ui_element','AD_UI_ElementType','CHAR(1)',null,'F')
;
-- 2017-08-17T19:56:35.247
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementType='F' WHERE AD_UI_ElementType IS NULL
;
-- 2017-08-17T19:57:09.076
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('ad_ui_element','ALTER TABLE public.AD_UI_Element ADD COLUMN Labels_Tab_ID NUMERIC(10)')
;
-- 2017-08-17T19:57:09.084
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE AD_UI_Element ADD CONSTRAINT LabelsTab_ADUIElement FOREIGN KEY (Labels_Tab_ID) REFERENCES public.AD_Tab DEFERRABLE INITIALLY DEFERRED
;
-- 2017-08-17T19:57:22.182
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('ad_ui_element','ALTER TABLE public.AD_UI_Element ADD COLUMN Labels_Selector_Field_ID NUMERIC(10)')
;
-- 2017-08-17T19:57:22.191
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE AD_UI_Element ADD CONSTRAINT LabelsSelectorField_ADUIElemen FOREIGN KEY (Labels_Selector_Field_ID) REFERENCES public.AD_Field DEFERRABLE INITIALLY DEFERRED
;
-- 2017-08-17T19:59:39.647
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,557050,559469,0,540754,TO_TIMESTAMP('2017-08-17 19:59:39','YYYY-MM-DD HH24:MI:SS'),100,10,'D','Y','Y','Y','N','N','N','N','N','Labels content tab',TO_TIMESTAMP('2017-08-17 19:59:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-08-17T19:59:39.649
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=559469 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-08-17T19:59:50.763
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,557051,559470,0,540754,TO_TIMESTAMP('2017-08-17 19:59:50','YYYY-MM-DD HH24:MI:SS'),100,10,'D','Y','Y','Y','N','N','N','N','N','Labels selector field',TO_TIMESTAMP('2017-08-17 19:59:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-08-17T19:59:50.764
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=559470 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-08-17T20:00:20.093
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=80,Updated=TO_TIMESTAMP('2017-08-17 20:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=559469
;
-- 2017-08-17T20:00:20.101
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90,Updated=TO_TIMESTAMP('2017-08-17 20:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=559470
;
-- 2017-08-17T20:00:20.110
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=100,Updated=TO_TIMESTAMP('2017-08-17 20:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557208
;
-- 2017-08-17T20:00:20.117
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110,Updated=TO_TIMESTAMP('2017-08-17 20:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558504
;
-- 2017-08-17T20:00:20.125
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=120,Updated=TO_TIMESTAMP('2017-08-17 20:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557169
;
-- 2017-08-17T20:00:20.132
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=130,Updated=TO_TIMESTAMP('2017-08-17 20:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557210
;
-- 2017-08-17T20:00:20.137
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=140,Updated=TO_TIMESTAMP('2017-08-17 20:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557180
;
-- 2017-08-17T20:00:20.141
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=150,Updated=TO_TIMESTAMP('2017-08-17 20:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557211
;
-- 2017-08-17T20:00:20.143
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=160,Updated=TO_TIMESTAMP('2017-08-17 20:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557212
;
-- 2017-08-17T20:00:20.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=170,Updated=TO_TIMESTAMP('2017-08-17 20:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557213
;
-- 2017-08-17T20:00:20.148
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=180,Updated=TO_TIMESTAMP('2017-08-17 20:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557214
;
-- 2017-08-17T20:00:27.017
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557167
;
-- 2017-08-17T20:00:27.019
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557169
;
-- 2017-08-17T20:00:27.023
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557180
;
-- 2017-08-17T20:00:27.024
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557208
;
-- 2017-08-17T20:00:27.026
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557210
;
-- 2017-08-17T20:00:27.027
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557211
;
-- 2017-08-17T20:00:27.028
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557212
;
-- 2017-08-17T20:00:27.028
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=170,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557213
;
-- 2017-08-17T20:00:27.029
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=180,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557214
;
-- 2017-08-17T20:00:27.030
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558504
;
-- 2017-08-17T20:00:27.030
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=559467
;
-- 2017-08-17T20:00:27.031
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=559469
;
-- 2017-08-17T20:00:27.032
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-08-17 20:00:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=559470
;
-- 2017-08-17T20:01:05.912
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET DisplayLogic='@AD_UI_ElementType@=F',Updated=TO_TIMESTAMP('2017-08-17 20:01:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557167
;
-- 2017-08-17T20:01:19.926
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET DisplayLogic='@AD_UI_ElementType@=L',Updated=TO_TIMESTAMP('2017-08-17 20:01:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=559469
;
-- 2017-08-17T20:01:28.106
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET DisplayLogic='@AD_UI_ElementType@=L', IsSameLine='Y',Updated=TO_TIMESTAMP('2017-08-17 20:01:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=559470
; | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for growth_change_history
-- ----------------------------
DROP TABLE IF EXISTS `growth_change_history`;
CREATE TABLE `growth_change_history` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_id` bigint(20) NULL DEFAULT NULL COMMENT 'user_id',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create_time',
`change_count` int(11) NULL DEFAULT NULL COMMENT '改变的值(正负计数)',
`note` varchar(0) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`source_type` tinyint(4) NULL DEFAULT NULL COMMENT '积分来源[0-购物,1-管理员修改]',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '成长值变化历史记录' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for integration_change_history
-- ----------------------------
DROP TABLE IF EXISTS `integration_change_history`;
CREATE TABLE `integration_change_history` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_id` bigint(20) NULL DEFAULT NULL COMMENT 'user_id',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create_time',
`change_count` int(11) NULL DEFAULT NULL COMMENT '变化的值',
`note` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`source_tyoe` tinyint(4) NULL DEFAULT NULL COMMENT '来源[0->购物;1->管理员修改;2->活动]',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '积分变化历史记录' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for undo_log
-- ----------------------------
DROP TABLE IF EXISTS `undo_log`;
CREATE TABLE `undo_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`branch_id` bigint(20) NOT NULL,
`xid` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`context` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`rollback_info` longblob NOT NULL,
`log_status` int(11) NOT NULL,
`log_created` datetime(0) NOT NULL,
`log_modified` datetime(0) NOT NULL,
`ext` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `ux_undo_log`(`xid`, `branch_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user_collect_spu
-- ----------------------------
DROP TABLE IF EXISTS `user_collect_spu`;
CREATE TABLE `user_collect_spu` (
`id` bigint(20) NOT NULL COMMENT 'id',
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
`spu_id` bigint(20) NULL DEFAULT NULL COMMENT 'spu_id',
`spu_name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'spu_name',
`spu_img` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'spu_img',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create_time',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户收藏的商品' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user_collect_subject
-- ----------------------------
DROP TABLE IF EXISTS `user_collect_subject`;
CREATE TABLE `user_collect_subject` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`subject_id` bigint(20) NULL DEFAULT NULL COMMENT 'subject_id',
`subject_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'subject_name',
`subject_img` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'subject_img',
`subject_urll` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '活动url',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户收藏的专题活动' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user_level
-- ----------------------------
DROP TABLE IF EXISTS `user_level`;
CREATE TABLE `user_level` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '等级名称',
`growth_point` int(11) NULL DEFAULT NULL COMMENT '等级需要的成长值',
`default_status` tinyint(4) NULL DEFAULT NULL COMMENT '是否为默认等级[0->不是;1->是]',
`free_freight_point` decimal(18, 4) NULL DEFAULT NULL COMMENT '免运费标准',
`comment_growth_point` int(11) NULL DEFAULT NULL COMMENT '每次评价获取的成长值',
`priviledge_free_freight` tinyint(4) NULL DEFAULT NULL COMMENT '是否有免邮特权',
`priviledge_user_price` tinyint(4) NULL DEFAULT NULL COMMENT '是否有用户价格特权',
`priviledge_birthday` tinyint(4) NULL DEFAULT NULL COMMENT '是否有生日特权',
`note` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户等级' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user_login_log
-- ----------------------------
DROP TABLE IF EXISTS `user_login_log`;
CREATE TABLE `user_login_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_id` bigint(20) NULL DEFAULT NULL COMMENT 'user_id',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'ip',
`city` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'city',
`login_type` tinyint(1) NULL DEFAULT NULL COMMENT '登录类型[1-web,2-app]',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户登录记录' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user_receive_address
-- ----------------------------
DROP TABLE IF EXISTS `user_receive_address`;
CREATE TABLE `user_receive_address` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_id` bigint(20) NULL DEFAULT NULL COMMENT 'user_id',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '收货人姓名',
`phone` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '电话',
`post_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮政编码',
`province` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省份/直辖市',
`city` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '城市',
`region` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区',
`detail_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详细地址(街道)',
`areacode` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省市区代码',
`default_status` tinyint(1) NULL DEFAULT NULL COMMENT '是否默认',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户收货地址' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user_statistics_info
-- ----------------------------
DROP TABLE IF EXISTS `user_statistics_info`;
CREATE TABLE `user_statistics_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
`consume_amount` decimal(18, 4) NULL DEFAULT NULL COMMENT '累计消费金额',
`coupon_amount` decimal(18, 4) NULL DEFAULT NULL COMMENT '累计优惠金额',
`order_count` int(11) NULL DEFAULT NULL COMMENT '订单数量',
`coupon_count` int(11) NULL DEFAULT NULL COMMENT '优惠券数量',
`comment_count` int(11) NULL DEFAULT NULL COMMENT '评价数',
`return_order_count` int(11) NULL DEFAULT NULL COMMENT '退货数量',
`login_count` int(11) NULL DEFAULT NULL COMMENT '登录次数',
`attend_count` int(11) NULL DEFAULT NULL COMMENT '关注数量',
`fans_count` int(11) NULL DEFAULT NULL COMMENT '粉丝数量',
`collect_product_count` int(11) NULL DEFAULT NULL COMMENT '收藏的商品数量',
`collect_subject_count` int(11) NULL DEFAULT NULL COMMENT '收藏的专题活动数量',
`collect_comment_count` int(11) NULL DEFAULT NULL COMMENT '收藏的评论数量',
`invite_friend_count` int(11) NULL DEFAULT NULL COMMENT '邀请的朋友数量',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户统计信息' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`level_id` bigint(20) NULL DEFAULT NULL COMMENT '用户等级id',
`username` char(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名',
`password` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码',
`nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '昵称',
`mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号码',
`email` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`header` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像',
`gender` tinyint(4) NULL DEFAULT NULL COMMENT '性别',
`birth` date NULL DEFAULT NULL COMMENT '生日',
`city` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所在城市',
`job` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '职业',
`sign` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '个性签名',
`source_type` tinyint(4) NULL DEFAULT NULL COMMENT '用户来源',
`integration` int(11) NULL DEFAULT NULL COMMENT '积分',
`growth` int(11) NULL DEFAULT NULL COMMENT '成长值',
`status` tinyint(4) NULL DEFAULT NULL COMMENT '启用状态',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '注册时间',
`social_uid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '社交用户id',
`access_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '访问令牌',
`expires_in` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '令牌过期时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1; | the_stack |
-- 26.10.2016 16:40
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:40:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4547
;
-- 26.10.2016 16:40
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:40:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4289
;
-- 26.10.2016 16:40
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:40:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11500
;
-- 26.10.2016 16:40
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:40:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4291
;
-- 26.10.2016 16:40
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:40:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11413
;
-- 26.10.2016 16:40
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:40:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4293
;
-- 26.10.2016 16:40
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:40:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4295
;
-- 26.10.2016 16:40
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:40:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11422
;
-- 26.10.2016 16:40
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:40:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11424
;
-- 26.10.2016 16:44
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557236
;
-- 26.10.2016 16:44
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557237
;
-- 26.10.2016 16:44
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:44:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557238
;
-- 26.10.2016 16:44
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:44:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557239
;
-- 26.10.2016 16:44
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:44:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557240
;
-- 26.10.2016 16:44
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:44:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557241
;
-- 26.10.2016 16:44
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:44:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557242
;
-- 26.10.2016 16:44
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:44:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557244
;
-- 26.10.2016 16:44
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:44:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11460
;
-- 26.10.2016 16:44
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:44:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557247
;
-- 26.10.2016 16:45
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ !''A_CustomerComplaint'' & @R_RequestType_InternalName/-1@ ! ''B_VendorComplaint'' & @R_RequestType_InternalName/-1@ ! ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:45:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11418
;
-- 26.10.2016 16:45
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ =''A_CustomerComplaint'' | @R_RequestType_InternalName/-1@ = ''B_VendorComplaint'' | @R_RequestType_InternalName/-1@ = ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:45:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4301
;
-- 26.10.2016 16:45
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ =''A_CustomerComplaint'' | @R_RequestType_InternalName/-1@ = ''B_VendorComplaint'' | @R_RequestType_InternalName/-1@ = ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:45:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557259
;
-- 26.10.2016 16:45
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ =''A_CustomerComplaint'' | @R_RequestType_InternalName/-1@ = ''B_VendorComplaint'' | @R_RequestType_InternalName/-1@ = ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:45:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557258
;
-- 26.10.2016 16:45
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ =''A_CustomerComplaint'' | @R_RequestType_InternalName/-1@ = ''B_VendorComplaint'' | @R_RequestType_InternalName/-1@ = ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:45:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557257
;
-- 26.10.2016 16:45
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ =''A_CustomerComplaint'' | @R_RequestType_InternalName/-1@ = ''B_VendorComplaint'' | @R_RequestType_InternalName/-1@ = ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:45:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557256
;
-- 26.10.2016 16:45
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ =''A_CustomerComplaint'' | @R_RequestType_InternalName/-1@ = ''B_VendorComplaint'' | @R_RequestType_InternalName/-1@ = ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:45:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5182
;
-- 26.10.2016 16:45
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ =''A_CustomerComplaint'' | @R_RequestType_InternalName/-1@ = ''B_VendorComplaint'' | @R_RequestType_InternalName/-1@ = ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:45:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557245
;
-- 26.10.2016 16:45
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ =''A_CustomerComplaint'' | @R_RequestType_InternalName/-1@ = ''B_VendorComplaint'' | @R_RequestType_InternalName/-1@ = ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:45:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557250
;
-- 26.10.2016 16:45
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ =''A_CustomerComplaint'' | @R_RequestType_InternalName/-1@ = ''B_VendorComplaint'' | @R_RequestType_InternalName/-1@ = ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:45:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557235
;
-- 26.10.2016 16:46
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@R_RequestType_InternalName/-1@ =''A_CustomerComplaint'' | @R_RequestType_InternalName/-1@ = ''B_VendorComplaint'' | @R_RequestType_InternalName/-1@ = ''C_ConsumerComplaint''',Updated=TO_TIMESTAMP('2016-10-26 16:46:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557234
; | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for action
-- ----------------------------
DROP TABLE IF EXISTS `action`;
CREATE TABLE `action` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`strategy_id` bigint(20) unsigned NOT NULL,
`type` int(1) unsigned NOT NULL,
`kind` int(1) NOT NULL,
`alarm_subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`alarm_template` varchar(1024) COLLATE utf8_unicode_ci NOT NULL,
`restore_subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`restore_template` varchar(1024) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`script_id` int(10) unsigned NOT NULL,
`begin_time` time NOT NULL DEFAULT '00:00:00',
`end_time` time NOT NULL DEFAULT '23:59:59',
`time_period` int(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `fk_action_strategy_id` (`strategy_id`),
KEY `script_id` (`script_id`),
CONSTRAINT `action_ibfk_1` FOREIGN KEY (`script_id`) REFERENCES `scripts` (`id`),
CONSTRAINT `fk_action_strategy_id` FOREIGN KEY (`strategy_id`) REFERENCES `strategy` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for action_result
-- ----------------------------
DROP TABLE IF EXISTS `action_result`;
CREATE TABLE `action_result` (
`strategy_event_id` bigint(20) unsigned NOT NULL,
`count` int(4) NOT NULL DEFAULT '1',
`action_id` bigint(20) unsigned NOT NULL,
`action_type` tinyint(1) unsigned NOT NULL,
`action_kind` tinyint(1) NOT NULL,
`script_id` int(1) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`username` char(255) COLLATE utf8_unicode_ci NOT NULL,
`phone` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`mail` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`weixin` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`content` text COLLATE utf8_unicode_ci NOT NULL,
`success` tinyint(1) unsigned NOT NULL,
`response` text COLLATE utf8_unicode_ci NOT NULL,
KEY `fk_action_result_strategy_event_id` (`strategy_event_id`),
KEY `index_strategy_event_id_count` (`strategy_event_id`,`count`),
CONSTRAINT `fk_action_result_strategy_event_id` FOREIGN KEY (`strategy_event_id`) REFERENCES `strategy_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for action_user_group
-- ----------------------------
DROP TABLE IF EXISTS `action_user_group`;
CREATE TABLE `action_user_group` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`action_id` int(10) unsigned NOT NULL,
`user_group_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_action_id_user_group_id` (`action_id`,`user_group_id`),
KEY `fk_action_user_group_user_group_id` (`user_group_id`),
CONSTRAINT `fk_action_user_group_action_id` FOREIGN KEY (`action_id`) REFERENCES `action` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_action_user_group_user_group_id` FOREIGN KEY (`user_group_id`) REFERENCES `user_group` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for chart
-- ----------------------------
DROP TABLE IF EXISTS `chart`;
CREATE TABLE `chart` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`creator` varchar(255) NOT NULL DEFAULT '',
`span` int(255) NOT NULL DEFAULT '12',
`height` int(255) NOT NULL DEFAULT '100',
`create_at` datetime NOT NULL,
`type` varchar(255) NOT NULL,
`panel_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `chart_panel_id_fk` (`panel_id`),
CONSTRAINT `chart_panel_id_fk` FOREIGN KEY (`panel_id`) REFERENCES `panel` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for chart_element
-- ----------------------------
DROP TABLE IF EXISTS `chart_element`;
CREATE TABLE `chart_element` (
`metric` varchar(1024) NOT NULL,
`tags` varchar(2048) NOT NULL,
`chart_id` int(10) unsigned NOT NULL,
KEY `chart_element_chart_id_fk` (`chart_id`),
CONSTRAINT `chart_element_chart_id_fk` FOREIGN KEY (`chart_id`) REFERENCES `chart` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for host
-- ----------------------------
DROP TABLE IF EXISTS `host`;
CREATE TABLE `host` (
`id` char(32) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`ip` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`hostname` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`agent_version` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Unknown',
`status` enum('0','1','2','3') COLLATE utf8_unicode_ci NOT NULL DEFAULT '3',
`create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`mute_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`uptime` float NOT NULL DEFAULT '0',
`idle_pct` float NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_host_id` (`id`),
UNIQUE KEY `idx_hostname_ip` (`hostname`,`ip`,`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for host_group
-- ----------------------------
DROP TABLE IF EXISTS `host_group`;
CREATE TABLE `host_group` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` text COLLATE utf8_unicode_ci NOT NULL,
`product_id` int(10) unsigned NOT NULL,
`creator` varchar(1024) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`create_at` datetime NOT NULL,
`update_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_name_product_id` (`name`,`product_id`) USING BTREE,
KEY `group_product_id_fk` (`product_id`),
CONSTRAINT `group_product_id_fk` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for host_group_host
-- ----------------------------
DROP TABLE IF EXISTS `host_group_host`;
CREATE TABLE `host_group_host` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`host_id` char(32) COLLATE utf8_unicode_ci NOT NULL,
`host_group_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_host_id_group_id` (`host_id`,`host_group_id`),
KEY `fk_host_group_group_id` (`host_group_id`),
CONSTRAINT `fk_host_group_group_id` FOREIGN KEY (`host_group_id`) REFERENCES `host_group` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_host_group_host_id` FOREIGN KEY (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for host_group_plugin
-- ----------------------------
DROP TABLE IF EXISTS `host_group_plugin`;
CREATE TABLE `host_group_plugin` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`group_id` int(10) unsigned NOT NULL,
`plugin_id` int(10) unsigned NOT NULL,
`args` varchar(1024) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`interval` int(1) NOT NULL DEFAULT '60',
`timeout` int(1) NOT NULL DEFAULT '10',
PRIMARY KEY (`id`),
KEY `group_id` (`group_id`),
KEY `plugin_id` (`plugin_id`),
CONSTRAINT `fk_group_id` FOREIGN KEY (`group_id`) REFERENCES `host_group` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_plugin_id` FOREIGN KEY (`plugin_id`) REFERENCES `plugin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for host_plugin
-- ----------------------------
DROP TABLE IF EXISTS `host_plugin`;
CREATE TABLE `host_plugin` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`host_id` char(32) COLLATE utf8_unicode_ci NOT NULL,
`plugin_id` int(10) unsigned NOT NULL,
`args` varchar(1024) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`interval` int(1) NOT NULL DEFAULT '60',
`timeout` int(1) NOT NULL DEFAULT '10',
PRIMARY KEY (`id`),
KEY `fk_host_plugin_plugin_id` (`plugin_id`),
KEY `fk_host_plugin_host_id` (`host_id`),
CONSTRAINT `fk_host_plugin_host_id` FOREIGN KEY (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_host_plugin_plugin_id` FOREIGN KEY (`plugin_id`) REFERENCES `plugin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for metric
-- ----------------------------
DROP TABLE IF EXISTS `metric`;
CREATE TABLE `metric` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`host_id` char(32) COLLATE utf8_unicode_ci NOT NULL,
`metric` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'cpu.idle/cpu=all',
`tags` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`dt` enum('GAUGE','DERIVE','COUNTER') COLLATE utf8_unicode_ci NOT NULL,
`cycle` int(10) NOT NULL,
`create_at` datetime NOT NULL,
`update_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_name` (`metric`,`host_id`,`tags`) USING BTREE,
KEY `fk_metric_host` (`host_id`),
CONSTRAINT `fk_metric_host` FOREIGN KEY (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for operations
-- ----------------------------
DROP TABLE IF EXISTS `operations`;
CREATE TABLE `operations` (
`ip` char(15) COLLATE utf8_unicode_ci NOT NULL,
`operator` char(255) COLLATE utf8_unicode_ci NOT NULL,
`method` char(10) COLLATE utf8_unicode_ci NOT NULL,
`api` text COLLATE utf8_unicode_ci NOT NULL,
`body` text COLLATE utf8_unicode_ci NOT NULL,
`result` tinyint(1) unsigned NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
KEY `operation_time` (`time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for panel
-- ----------------------------
DROP TABLE IF EXISTS `panel`;
CREATE TABLE `panel` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`creator` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk_panel_product_id` (`product_id`),
CONSTRAINT `fk_panel_product_id` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for plugin
-- ----------------------------
DROP TABLE IF EXISTS `plugin`;
CREATE TABLE `plugin` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`path` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`args` varchar(1024) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`interval` int(1) NOT NULL DEFAULT '60',
`timeout` int(1) NOT NULL DEFAULT '10',
`checksum` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`update_at` datetime NOT NULL,
`create_at` datetime NOT NULL,
`creator` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for product
-- ----------------------------
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` varchar(1024) NOT NULL DEFAULT '',
`creator` varchar(1024) NOT NULL DEFAULT '',
`create_at` datetime NOT NULL,
`is_delete` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `product_name_uindex` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for product_host
-- ----------------------------
DROP TABLE IF EXISTS `product_host`;
CREATE TABLE `product_host` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL,
`host_id` char(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `product_host_product_id_host_id_unique` (`product_id`,`host_id`),
KEY `product_host_host_id_fk` (`host_id`),
KEY `host_id_fk` (`product_id`),
CONSTRAINT `product_host_host_id_fk` FOREIGN KEY (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `product_host_product_id_fk` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for product_user
-- ----------------------------
DROP TABLE IF EXISTS `product_user`;
CREATE TABLE `product_user` (
`product_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
UNIQUE KEY `product_user_product_id_user_id_unique` (`product_id`,`user_id`),
KEY `product_user_product_id_fk` (`product_id`),
KEY `product_user_user_id_fk` (`user_id`),
CONSTRAINT `product_user_product_id_fk` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`),
CONSTRAINT `product_user_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for scripts
-- ----------------------------
DROP TABLE IF EXISTS `scripts`;
CREATE TABLE `scripts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`file_path` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_name` (`name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for strategy
-- ----------------------------
DROP TABLE IF EXISTS `strategy`;
CREATE TABLE `strategy` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`priority` int(1) unsigned NOT NULL,
`alarm_count` int(4) unsigned NOT NULL DEFAULT '0',
`cycle` int(10) unsigned NOT NULL DEFAULT '5',
`expression` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
`enable` tinyint(1) unsigned NOT NULL DEFAULT '0',
`user_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `product_id` (`product_id`,`name`) USING BTREE,
KEY `fk_strategy_product_id` (`product_id`),
CONSTRAINT `fk_strategy_product_id` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for strategy_event
-- ----------------------------
DROP TABLE IF EXISTS `strategy_event`;
CREATE TABLE `strategy_event` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL,
`strategy_id` bigint(20) unsigned NOT NULL,
`strategy_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`priority` int(1) unsigned NOT NULL,
`cycle` int(10) unsigned NOT NULL,
`alarm_count` int(4) unsigned NOT NULL,
`expression` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`aware_end_time` timestamp NOT NULL DEFAULT '1980-01-01 00:00:00',
`count` int(4) unsigned NOT NULL DEFAULT '1',
`status` int(1) unsigned NOT NULL DEFAULT '1',
`host_id` char(32) COLLATE utf8_unicode_ci NOT NULL,
`host_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`ip` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_host_id_strategy_id_status` (`host_id`,`strategy_id`,`status`),
KEY `fk_strategy_event_product_id` (`product_id`),
CONSTRAINT `fk_strategy_event_product_id` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for strategy_event_failed
-- ----------------------------
DROP TABLE IF EXISTS `strategy_event_failed`;
CREATE TABLE `strategy_event_failed` (
`strategy_id` bigint(20) unsigned NOT NULL,
`host_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` int(11) NOT NULL,
`message` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY `idx_strategy_id_host_id` (`strategy_id`,`host_id`) USING BTREE,
KEY `strategy_id` (`strategy_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for strategy_event_process
-- ----------------------------
DROP TABLE IF EXISTS `strategy_event_process`;
CREATE TABLE `strategy_event_process` (
`strategy_event_id` bigint(20) unsigned NOT NULL,
`process_status` int(255) DEFAULT NULL,
`process_user` varchar(255) DEFAULT NULL,
`process_comments` varchar(255) DEFAULT NULL,
`process_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
KEY `strategy_event_id` (`strategy_event_id`),
CONSTRAINT `fk_strategy_event_id` FOREIGN KEY (`strategy_event_id`) REFERENCES `strategy_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for strategy_event_record
-- ----------------------------
DROP TABLE IF EXISTS `strategy_event_record`;
CREATE TABLE `strategy_event_record` (
`strategy_event_id` bigint(20) unsigned NOT NULL,
`count` int(4) unsigned NOT NULL DEFAULT '1',
`strategy_id` bigint(20) unsigned NOT NULL,
`strategy_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`priority` int(1) unsigned NOT NULL,
`cycle` int(10) unsigned NOT NULL,
`alarm_count` int(4) unsigned NOT NULL,
`expression` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`aware_end_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`status` int(1) unsigned NOT NULL DEFAULT '1',
`host_id` char(32) COLLATE utf8_unicode_ci NOT NULL,
`host_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`ip` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
KEY `idx_strategy_event_record_strategy_event_id` (`strategy_event_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for strategy_group
-- ----------------------------
DROP TABLE IF EXISTS `strategy_group`;
CREATE TABLE `strategy_group` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`strategy_id` bigint(20) unsigned NOT NULL,
`group_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_strategy_id_group_id` (`strategy_id`,`group_id`),
KEY `fk_strategy_group_group_id` (`group_id`),
CONSTRAINT `fk_strategy_group_group_id` FOREIGN KEY (`group_id`) REFERENCES `host_group` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_strategy_group_strategy_id` FOREIGN KEY (`strategy_id`) REFERENCES `strategy` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for strategy_host_exclude
-- ----------------------------
DROP TABLE IF EXISTS `strategy_host_exclude`;
CREATE TABLE `strategy_host_exclude` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`strategy_id` bigint(20) unsigned NOT NULL,
`host_id` char(32) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_strategy_id_host_id` (`strategy_id`,`host_id`),
KEY `idx_strategy_host_host_id` (`host_id`),
CONSTRAINT `fk_strategy_host_host_id` FOREIGN KEY (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_strategy_host_strategy_id` FOREIGN KEY (`strategy_id`) REFERENCES `strategy` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for strategy_template
-- ----------------------------
DROP TABLE IF EXISTS `strategy_template`;
CREATE TABLE `strategy_template` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`alarm_count` int(4) unsigned NOT NULL,
`cycle` int(10) unsigned NOT NULL,
`expression` varchar(255) NOT NULL,
`description` varchar(1024) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for trigger
-- ----------------------------
DROP TABLE IF EXISTS `trigger`;
CREATE TABLE `trigger` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`strategy_id` bigint(20) unsigned NOT NULL,
`metric` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tags` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`number` int(10) unsigned NOT NULL DEFAULT '0',
`index` char(10) COLLATE utf8_unicode_ci NOT NULL,
`method` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`symbol` char(5) COLLATE utf8_unicode_ci NOT NULL,
`threshold` double(255,2) NOT NULL,
`description` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_strategy_id_index_index` (`strategy_id`,`index`),
CONSTRAINT `fk_strategy_strategy_id` FOREIGN KEY (`strategy_id`) REFERENCES `strategy` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for trigger_event
-- ----------------------------
DROP TABLE IF EXISTS `trigger_event`;
CREATE TABLE `trigger_event` (
`strategy_event_id` bigint(20) unsigned NOT NULL,
`index` char(10) COLLATE utf8_unicode_ci NOT NULL,
`metric` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tags` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`number` int(10) unsigned NOT NULL DEFAULT '0',
`aggregate_tags` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`current_threshold` double(255,2) NOT NULL,
`method` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`symbol` char(5) COLLATE utf8_unicode_ci NOT NULL,
`threshold` double(255,2) NOT NULL,
`triggered` tinyint(1) NOT NULL DEFAULT '0',
KEY `fk_trigger_event_strategy_event_id` (`strategy_event_id`),
CONSTRAINT `fk_trigger_event_strategy_event_id` FOREIGN KEY (`strategy_event_id`) REFERENCES `strategy_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for trigger_event_record
-- ----------------------------
DROP TABLE IF EXISTS `trigger_event_record`;
CREATE TABLE `trigger_event_record` (
`strategy_event_id` bigint(20) unsigned NOT NULL,
`count` int(4) unsigned NOT NULL DEFAULT '1',
`index` char(10) COLLATE utf8_unicode_ci NOT NULL,
`metric` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tags` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`number` int(10) unsigned NOT NULL DEFAULT '0',
`aggregate_tags` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`current_threshold` double(255,2) NOT NULL,
`method` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`symbol` char(5) COLLATE utf8_unicode_ci NOT NULL,
`threshold` double(255,2) NOT NULL,
`triggered` tinyint(1) NOT NULL DEFAULT '0',
KEY `strategy_event_id` (`strategy_event_id`),
CONSTRAINT `fk_trigger_event_record_strategy_event_id` FOREIGN KEY (`strategy_event_id`) REFERENCES `strategy_event_record` (`strategy_event_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for trigger_template
-- ----------------------------
DROP TABLE IF EXISTS `trigger_template`;
CREATE TABLE `trigger_template` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`strategy_template_id` int(10) unsigned NOT NULL,
`metric` varchar(255) NOT NULL,
`tags` varchar(255) NOT NULL,
`number` int(10) NOT NULL,
`index` char(10) NOT NULL,
`method` varchar(10) NOT NULL,
`symbol` char(5) NOT NULL,
`threshold` double(255,2) NOT NULL,
`description` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `strategy_template_id` (`strategy_template_id`),
CONSTRAINT `trigger_template_ibfk_1` FOREIGN KEY (`strategy_template_id`) REFERENCES `strategy_template` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` char(255) COLLATE utf8_unicode_ci NOT NULL,
`display_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`password` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`role` tinyint(1) NOT NULL DEFAULT '0',
`phone` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`mail` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`wechat` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`status` tinyint(1) NOT NULL DEFAULT '0',
`create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for user_group
-- ----------------------------
DROP TABLE IF EXISTS `user_group`;
CREATE TABLE `user_group` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`product_id` int(10) unsigned NOT NULL,
`description` varchar(1024) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`creator` varchar(1024) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_name` (`name`,`product_id`) USING BTREE,
KEY `user_group_product_id_fk` (`product_id`),
CONSTRAINT `user_group_product_id_fk` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Table structure for user_group_user
-- ----------------------------
DROP TABLE IF EXISTS `user_group_user`;
CREATE TABLE `user_group_user` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`user_group_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_user_id_group_id` (`user_id`,`user_group_id`),
KEY `fk_user_usergroup_user_group_id` (`user_group_id`),
CONSTRAINT `fk_user_user_group_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_user_usergroup_user_group_id` FOREIGN KEY (`user_group_id`) REFERENCES `user_group` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `strategy_event_failed`
ADD CONSTRAINT `stragety_event_failed_host_id_fk` FOREIGN KEY (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `strategy_event_failed_strategy_id_fk` FOREIGN KEY (`strategy_id`) REFERENCES `strategy` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `strategy_event_record`
ADD CONSTRAINT `strategy_event_record_host_id_fk` FOREIGN KEY (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- 增加用户类型
ALTER TABLE `owl`.`user`
ADD COLUMN `type` varchar(255) NOT NULL DEFAULT '' AFTER `wechat`;
-- 插件增加备注
ALTER TABLE `host_group_plugin` ADD COLUMN `comment` varchar(1024) NOT NULL DEFAULT '' AFTER `timeout`;
ALTER TABLE `host_plugin` ADD COLUMN `comment` varchar(1024) NOT NULL DEFAULT '' AFTER `timeout`;
ALTER TABLE `plugin` ADD COLUMN `comment` text NOT NULL AFTER `creator`;
SET FOREIGN_KEY_CHECKS = 1; | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for system_apis
-- ----------------------------
DROP TABLE IF EXISTS `system_apis`;
CREATE TABLE `system_apis` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`created_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
`updated_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0),
`deleted_at` datetime(0) NULL DEFAULT '2006-01-02 15:04:05',
`path` varchar(191) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'api路径',
`description` varchar(191) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'api中文描述',
`api_group` varchar(191) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'api组',
`method` varchar(191) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'POST' COMMENT '请求方法',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_apis_deleted_at`(`deleted_at`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 83 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of system_apis
-- ----------------------------
INSERT INTO `system_apis` VALUES (1, '2021-04-23 20:56:12', '2021-05-04 01:25:11', '2021-05-04 09:25:11', '/admin/updateadminpassword', '修改密码', 'admin', 'PUT');
INSERT INTO `system_apis` VALUES (2, '2021-04-23 20:56:18', '2021-05-04 01:25:17', '2021-05-04 09:25:17', '/admin/logout', '退出登录', 'admin', 'POST');
INSERT INTO `system_apis` VALUES (3, '2021-04-23 22:43:51', '2021-05-04 01:25:05', '2021-05-04 09:25:05', '/admin/info', '-获取信息', 'admin', 'GET');
INSERT INTO `system_apis` VALUES (4, '2021-04-24 04:05:11', '2021-04-24 04:19:43', '2006-01-02 15:04:05', '/admin/delete', '删除', 'admin', 'DELETE');
INSERT INTO `system_apis` VALUES (5, '2021-04-24 04:07:24', '2021-04-24 04:19:22', '2006-01-02 15:04:05', '/admin/list', '列表', 'admin', 'POST');
INSERT INTO `system_apis` VALUES (6, '2021-04-24 04:20:13', '2021-04-24 04:20:13', '2006-01-02 15:04:05', '/admin/deleteBatch', '删除批量', 'admin', 'DELETE');
INSERT INTO `system_apis` VALUES (7, '2021-04-24 04:20:40', '2021-04-24 04:20:40', '2006-01-02 15:04:05', '/admin/find', '查询', 'admin', 'POST');
INSERT INTO `system_apis` VALUES (8, '2021-04-24 04:20:59', '2021-04-24 04:20:59', '2006-01-02 15:04:05', '/admin/adminAdd', '添加', 'admin', 'POST');
INSERT INTO `system_apis` VALUES (9, '2021-04-24 04:21:16', '2021-04-24 04:21:16', '2006-01-02 15:04:05', '/admin/adminUpdate', '修改', 'admin', 'PUT');
INSERT INTO `system_apis` VALUES (10, '2021-04-24 04:22:13', '2021-04-24 04:22:13', '2006-01-02 15:04:05', '/systemMenu/list', '列表', 'systemMenu', 'POST');
INSERT INTO `system_apis` VALUES (11, '2021-04-24 04:22:31', '2021-04-24 04:22:31', '2006-01-02 15:04:05', '/systemMenu/delete', '删除', 'systemMenu', 'DELETE');
INSERT INTO `system_apis` VALUES (12, '2021-04-24 04:22:53', '2021-04-24 04:22:53', '2006-01-02 15:04:05', '/systemMenu/deleteBatch', '删除批量', 'systemMenu', 'DELETE');
INSERT INTO `system_apis` VALUES (13, '2021-04-24 04:23:21', '2021-04-24 04:23:21', '2006-01-02 15:04:05', '/systemMenu/find', '查询', 'systemMenu', 'POST');
INSERT INTO `system_apis` VALUES (14, '2021-04-24 04:23:35', '2021-04-24 04:23:35', '2006-01-02 15:04:05', '/systemMenu/add', '添加', 'systemMenu', 'POST');
INSERT INTO `system_apis` VALUES (15, '2021-04-24 04:23:54', '2021-04-24 04:23:54', '2006-01-02 15:04:05', '/systemMenu/update', '修改', 'systemMenu', 'PUT');
INSERT INTO `system_apis` VALUES (16, '2021-04-24 04:28:06', '2021-04-24 04:28:06', '2006-01-02 15:04:05', '/systemApi/list', '列表', 'systemApi', 'POST');
INSERT INTO `system_apis` VALUES (17, '2021-04-24 04:28:06', '2021-04-24 04:28:06', '2006-01-02 15:04:05', '/systemApi/delete', '删除', 'systemApi', 'DELETE');
INSERT INTO `system_apis` VALUES (18, '2021-04-24 04:28:06', '2021-04-24 04:31:36', '2006-01-02 15:04:05', '/systemApi/deleteBatch', '删除批量', 'systemApi', 'DELETE');
INSERT INTO `system_apis` VALUES (19, '2021-04-24 04:28:06', '2021-04-24 04:28:06', '2006-01-02 15:04:05', '/systemApi/find', '查询', 'systemApi', 'POST');
INSERT INTO `system_apis` VALUES (20, '2021-04-24 04:28:06', '2021-04-24 04:28:06', '2006-01-02 15:04:05', '/systemApi/add', '添加', 'systemApi', 'POST');
INSERT INTO `system_apis` VALUES (21, '2021-04-24 04:28:06', '2021-04-24 04:28:06', '2006-01-02 15:04:05', '/systemApi/update', '修改', 'systemApi', 'PUT');
INSERT INTO `system_apis` VALUES (22, '2021-04-24 04:30:40', '2021-04-24 04:30:40', '2006-01-02 15:04:05', '/systemRole/list', '列表', 'systemRole', 'POST');
INSERT INTO `system_apis` VALUES (23, '2021-04-24 04:30:40', '2021-04-24 04:30:40', '2006-01-02 15:04:05', '/systemRole/delete', '删除', 'systemRole', 'DELETE');
INSERT INTO `system_apis` VALUES (24, '2021-04-24 04:30:40', '2021-04-24 04:31:37', '2006-01-02 15:04:05', '/systemRole/deleteBatch', '删除批量', 'systemRole', 'DELETE');
INSERT INTO `system_apis` VALUES (25, '2021-04-24 04:30:40', '2021-04-24 04:30:40', '2006-01-02 15:04:05', '/systemRole/find', '查询', 'systemRole', 'POST');
INSERT INTO `system_apis` VALUES (26, '2021-04-24 04:30:40', '2021-04-24 04:30:40', '2006-01-02 15:04:05', '/systemRole/add', '添加', 'systemRole', 'POST');
INSERT INTO `system_apis` VALUES (27, '2021-04-24 04:30:40', '2021-04-24 04:30:40', '2006-01-02 15:04:05', '/systemRole/update', '修改', 'systemRole', 'PUT');
INSERT INTO `system_apis` VALUES (28, '2021-04-24 04:31:04', '2021-04-24 04:31:04', '2006-01-02 15:04:05', '/systemDepartment/list', '列表', 'systemDepartment', 'POST');
INSERT INTO `system_apis` VALUES (29, '2021-04-24 04:31:04', '2021-04-24 04:31:04', '2006-01-02 15:04:05', '/systemDepartment/delete', '删除', 'systemDepartment', 'DELETE');
INSERT INTO `system_apis` VALUES (30, '2021-04-24 04:31:04', '2021-04-24 04:31:39', '2006-01-02 15:04:05', '/systemDepartment/deleteBatch', '删除批量', 'systemDepartment', 'DELETE');
INSERT INTO `system_apis` VALUES (31, '2021-04-24 04:31:04', '2021-04-24 04:31:04', '2006-01-02 15:04:05', '/systemDepartment/find', '查询', 'systemDepartment', 'POST');
INSERT INTO `system_apis` VALUES (32, '2021-04-24 04:31:04', '2021-04-24 04:31:04', '2006-01-02 15:04:05', '/systemDepartment/add', '添加', 'systemDepartment', 'POST');
INSERT INTO `system_apis` VALUES (33, '2021-04-24 04:31:04', '2021-04-24 04:31:04', '2006-01-02 15:04:05', '/systemDepartment/update', '修改', 'systemDepartment', 'PUT');
INSERT INTO `system_apis` VALUES (34, '2021-04-27 16:23:30', '2021-04-27 16:23:30', '2006-01-02 15:04:05', '/systemDepartment/parentList', '获取一级部门', 'systemDepartment', 'POST');
INSERT INTO `system_apis` VALUES (35, '2021-04-27 16:24:59', '2021-05-02 14:17:53', '2006-01-02 15:04:05', '/systemRoleApi/byRoleId', '-获取角色iD\'sApi', 'systemRoleApi', 'POST');
INSERT INTO `system_apis` VALUES (36, '2021-04-27 16:29:25', '2021-04-27 16:29:25', '2006-01-02 15:04:05', '/systemMenu/treeList', '获取菜单树[权限分配]', 'systemMenu', 'POST');
INSERT INTO `system_apis` VALUES (37, '2021-04-27 16:30:27', '2021-04-27 16:30:27', '2006-01-02 15:04:05', '/systemRoleApi/add', '角色API添加', 'systemRoleApi', 'POST');
INSERT INTO `system_apis` VALUES (38, '2021-04-27 16:32:45', '2021-05-02 14:17:59', '2006-01-02 15:04:05', '/systemRoleMenu/byRoleId', '-获取Role\'sMenu', 'systemRoleMenu', 'POST');
INSERT INTO `system_apis` VALUES (39, '2021-04-27 16:33:47', '2021-04-27 16:33:47', '2006-01-02 15:04:05', '/systemRoleMenu/add', 'Role\'sMenu添加', 'systemRoleMenu', 'POST');
INSERT INTO `system_apis` VALUES (40, '2021-04-27 16:35:38', '2021-04-27 16:35:38', '2006-01-02 15:04:05', '/systemMenu/parentList', '获取一级菜单', 'systemMenu', 'POST');
INSERT INTO `system_apis` VALUES (41, '2021-04-27 16:36:35', '2021-04-27 16:36:35', '2006-01-02 15:04:05', '/systemRole/parentList', '获取一级角色', 'systemRole', 'POST');
INSERT INTO `system_apis` VALUES (77, '2021-05-22 01:23:55', '2021-05-22 01:23:55', '2006-01-02 15:04:05', '/verifyCode/add', '添加', 'verifyCode', 'POST');
INSERT INTO `system_apis` VALUES (78, '2021-05-22 01:23:56', '2021-05-22 01:23:56', '2006-01-02 15:04:05', '/verifyCode/update', '修改', 'verifyCode', 'PUT');
INSERT INTO `system_apis` VALUES (79, '2021-05-22 01:23:56', '2021-05-22 01:23:56', '2006-01-02 15:04:05', '/verifyCode/find', '查询', 'verifyCode', 'POST');
INSERT INTO `system_apis` VALUES (80, '2021-05-22 01:23:56', '2021-05-22 01:23:56', '2006-01-02 15:04:05', '/verifyCode/delete', '删除', 'verifyCode', 'DELETE');
INSERT INTO `system_apis` VALUES (81, '2021-05-22 01:23:57', '2021-05-22 01:23:57', '2006-01-02 15:04:05', '/verifyCode/deleteBatch', '删除批量', 'verifyCode', 'DELETE');
INSERT INTO `system_apis` VALUES (82, '2021-05-22 01:23:57', '2021-05-22 01:23:57', '2006-01-02 15:04:05', '/verifyCode/list', '列表', 'verifyCode', 'POST');
-- ----------------------------
-- Table structure for system_departments
-- ----------------------------
DROP TABLE IF EXISTS `system_departments`;
CREATE TABLE `system_departments` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`created_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
`updated_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0),
`deleted_at` datetime(0) NULL DEFAULT '2006-01-02 15:04:05',
`ancestors` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '祖级列表',
`name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '部门名称',
`leader` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '负责人',
`phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '联系电话',
`email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '邮箱',
`status` int(11) NULL DEFAULT 0 COMMENT '部门状态(0正常 1停用)',
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
`sort` int(11) NULL DEFAULT 0 COMMENT '排序',
`parent_id` int(11) NULL DEFAULT 0 COMMENT '父级ID',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_departments_deleted_at`(`deleted_at`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of system_departments
-- ----------------------------
INSERT INTO `system_departments` VALUES (4, '2021-04-24 00:52:57', '2021-04-24 14:35:33', '2006-01-02 15:04:05', '1', '成都分部', '1', '1', '1', 1, '1', '1', 123, 9);
INSERT INTO `system_departments` VALUES (5, '2021-04-24 01:06:25', '2021-04-24 14:59:01', '2006-01-02 15:04:05', '12', '武汉分部', '135212343873', '12', '11', 12, '361018729@qq.com', '12', 12, 9);
INSERT INTO `system_departments` VALUES (6, '2021-04-24 01:12:12', '2021-04-25 09:06:57', '2006-01-02 15:04:05', '123,123,12,321,3,213,12,3', '深圳分部', '张明', '1352345677', '12345729@qq.com', 0, '李节节', '李明', 123, 0);
INSERT INTO `system_departments` VALUES (7, '2021-04-24 01:47:29', '2021-04-24 14:59:09', '2006-01-02 15:04:05', '12', '广州分部', '145134893873', '12', '12', 12, '361018729@qq.com', '12', 12, 0);
INSERT INTO `system_departments` VALUES (8, '2021-04-24 02:17:40', '2021-04-24 14:58:37', '2006-01-02 15:04:05', '1123,1111', '北京分部', 'liming11', '135248235', '361012312318729@qq.com', 0, 'zhangshan123', 'wangwu', 1, 9);
INSERT INTO `system_departments` VALUES (9, '2021-04-24 02:26:22', '2021-04-24 14:58:23', '2006-01-02 15:04:05', '123', '总部', '23', '13524891234', '123@qq.com', 1, '1', '2', 0, 0);
INSERT INTO `system_departments` VALUES (10, '2021-04-24 06:03:02', '2021-04-24 14:58:53', '2006-01-02 15:04:05', '1,1,1,1,1,1', '上海分部', '李明', '13512345123', '34324@a.com', 0, '111', '122', 0, 9);
INSERT INTO `system_departments` VALUES (11, '2021-05-02 13:38:57', '2021-05-02 13:40:12', '2021-05-02 21:40:12', '', 'aaa', 'bbb', '123123123', '123123123', 0, '', '', 0, 0);
INSERT INTO `system_departments` VALUES (12, '2021-05-02 13:39:10', '2021-05-02 13:40:12', '2021-05-02 21:40:12', '', 'aaaaaa23123231', '123123123', '123123', '123123123', 0, '', '', 0, 0);
INSERT INTO `system_departments` VALUES (13, '2021-05-02 13:39:19', '2021-05-02 13:39:33', '2021-05-02 21:39:33', '', 'a12312312', '123123', '123123', '123123', 0, '', '', 0, 0);
-- ----------------------------
-- Table structure for system_menus
-- ----------------------------
DROP TABLE IF EXISTS `system_menus`;
CREATE TABLE `system_menus` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
`created_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加日期',
`updated_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改日期',
`deleted_at` datetime(0) NULL DEFAULT '2006-01-02 15:04:05' COMMENT '删除日期',
`parent_id` int(11) NULL DEFAULT 0 COMMENT '父菜单ID',
`path` varchar(191) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '路由path',
`name` varchar(191) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '路由name',
`hidden` int(11) NULL DEFAULT 0 COMMENT '1是0否在列表隐藏',
`component` varchar(191) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对应前端vue文件路径',
`sort` int(11) NULL DEFAULT 0 COMMENT '排序标记',
`title` varchar(191) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单名称',
`icon` varchar(191) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_menus_deleted_at`(`deleted_at`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 29 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of system_menus
-- ----------------------------
INSERT INTO `system_menus` VALUES (11, '2021-04-23 13:31:02', '2021-05-02 15:31:54', '2006-01-02 15:04:05', 15, 'adminList', 'adminList', 0, 'view/superAdmin/systemUser/index', 1, '管理员管理', 'user-solid');
INSERT INTO `system_menus` VALUES (12, '2021-04-24 06:03:33', '2021-05-02 15:34:42', '2006-01-02 15:04:05', 15, 'systemApiList', 'systemApiList', 0, 'view/superAdmin/systemApi/index', 3, 'Api管理', 's-tools');
INSERT INTO `system_menus` VALUES (13, '2021-04-24 11:39:33', '2021-05-02 15:31:43', '2006-01-02 15:04:05', 15, 'systemMenuList', 'systemMenuList', 0, 'view/superAdmin/systemMenu/index', 2, '菜单管理', 'menu');
INSERT INTO `system_menus` VALUES (14, '2021-04-24 11:44:54', '2021-05-02 15:34:07', '2006-01-02 15:04:05', 15, 'systemRoleList', 'systemRoleList', 0, 'view/superAdmin/systemRole/index', 4, '角色管理', 's-tools');
INSERT INTO `system_menus` VALUES (15, '2021-04-24 11:50:20', '2021-05-24 01:09:31', '2006-01-02 15:04:05', 0, 'admin', 'admin', 0, 'view/superAdmin/index', 0, '超级管理员', 'suitcase');
INSERT INTO `system_menus` VALUES (16, '2021-04-24 12:57:27', '2021-05-02 15:33:58', '2006-01-02 15:04:05', 15, 'systemDepartmentList', 'systemDepartmentList', 0, 'view/superAdmin/systemDepartment/index', 5, '部门管理', 's-tools');
INSERT INTO `system_menus` VALUES (17, '2021-04-24 13:24:29', '2021-05-02 11:42:33', '2006-01-02 15:04:05', 0, 'dashboard', 'dashboard', 0, 'view/dashboard/index', -1, 'Dashboard', 's-home');
INSERT INTO `system_menus` VALUES (18, '2021-05-04 20:34:16', '2021-05-24 01:10:48', '2006-01-02 15:04:05', 0, 'k8s', 'k8s', 0, 'view/superAdmin/index', 2, 'K8S管理', 's-grid');
INSERT INTO `system_menus` VALUES (19, '2021-05-04 20:36:52', '2021-05-05 10:28:31', '2006-01-02 15:04:05', 18, 'deployment', 'deployment', 0, 'view/k8s/deployment', 0, 'Deployment', 'star-on');
INSERT INTO `system_menus` VALUES (20, '2021-05-05 10:18:20', '2021-05-05 11:08:35', '2006-01-02 15:04:05', 18, 'namespace', 'namespace', 0, 'view/k8s/namespace', 1, 'Namespace', 'star-on');
INSERT INTO `system_menus` VALUES (21, '2021-05-05 10:18:20', '2021-05-05 11:09:04', '2006-01-02 15:04:05', 18, 'service', 'service', 0, 'view/k8s/service', 2, 'Service', 'star-on');
INSERT INTO `system_menus` VALUES (22, '2021-05-05 10:18:20', '2021-05-05 11:09:27', '2006-01-02 15:04:05', 18, 'ingress', 'ingress', 0, 'view/k8s/ingress', 3, 'Ingress', 'star-on');
INSERT INTO `system_menus` VALUES (23, '2021-05-05 10:18:20', '2021-05-07 01:54:36', '2006-01-02 15:04:05', 18, 'pods', 'pods', 0, 'view/k8s/pods', 3, 'Pods', 'star-on');
-- ----------------------------
-- Table structure for system_role_apis
-- ----------------------------
DROP TABLE IF EXISTS `system_role_apis`;
CREATE TABLE `system_role_apis` (
`p_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
`v0` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
`v1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
`v2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
`v3` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
`v4` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
`v5` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT ''
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色API关系' ROW_FORMAT = Compact;
-- ----------------------------
-- Records of system_role_apis
-- ----------------------------
INSERT INTO `system_role_apis` VALUES ('p', '4', '/admin/adminUpdate', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '4', '/admin/adminAdd', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '4', '/admin/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '1', '/systemRole/list', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/admin/adminUpdate', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/admin/adminAdd', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/admin/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/admin/deleteBatch', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/admin/list', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/admin/delete', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/admin/info', 'GET', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/admin/logout', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/admin/updateadminpassword', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/systemApi/add', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/systemApi/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/systemApi/deleteBatch', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '6', '/systemApi/delete', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '8', '/systemApi/update', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '8', '/systemApi/add', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '8', '/systemApi/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '8', '/systemApi/deleteBatch', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '8', '/systemApi/delete', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '8', '/systemApi/list', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/admin/info', 'GET', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemDepartment/parentList', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemDepartment/update', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemDepartment/add', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemDepartment/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemDepartment/deleteBatch', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemDepartment/delete', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemDepartment/list', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemRole/parentList', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemRole/update', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemRole/add', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemRole/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemRole/deleteBatch', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemRole/delete', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemRole/list', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemRoleApi/byRoleId', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '5', '/systemRoleMenu/byRoleId', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/admin/adminUpdate', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/admin/adminAdd', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/admin/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/admin/deleteBatch', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/admin/list', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/admin/delete', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemApi/update', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemApi/add', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemApi/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemApi/deleteBatch', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemApi/delete', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemApi/list', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemDepartment/parentList', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemDepartment/update', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemDepartment/add', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemDepartment/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemDepartment/deleteBatch', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemDepartment/delete', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemDepartment/list', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemMenu/parentList', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemMenu/treeList', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemMenu/update', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemMenu/add', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemMenu/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemMenu/deleteBatch', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemMenu/delete', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemMenu/list', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemRole/parentList', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemRole/update', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemRole/add', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemRole/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemRole/deleteBatch', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemRole/delete', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemRole/list', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemRoleApi/add', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemRoleApi/byRoleId', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemRoleMenu/add', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/systemRoleMenu/byRoleId', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/verifyCode/list', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/verifyCode/deleteBatch', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/verifyCode/delete', 'DELETE', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/verifyCode/find', 'POST', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/verifyCode/update', 'PUT', '', '', '');
INSERT INTO `system_role_apis` VALUES ('p', '7', '/verifyCode/add', 'POST', '', '', '');
-- ----------------------------
-- Table structure for system_role_menus
-- ----------------------------
DROP TABLE IF EXISTS `system_role_menus`;
CREATE TABLE `system_role_menus` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`role_id` int(11) NULL DEFAULT 0 COMMENT '角色ID',
`menu_id` int(11) NULL DEFAULT 0 COMMENT '菜单ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 222 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色菜单关系' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of system_role_menus
-- ----------------------------
INSERT INTO `system_role_menus` VALUES (54, 4, 17);
INSERT INTO `system_role_menus` VALUES (69, 6, 17);
INSERT INTO `system_role_menus` VALUES (70, 6, 15);
INSERT INTO `system_role_menus` VALUES (71, 6, 11);
INSERT INTO `system_role_menus` VALUES (72, 6, 13);
INSERT INTO `system_role_menus` VALUES (84, 8, 15);
INSERT INTO `system_role_menus` VALUES (85, 8, 13);
INSERT INTO `system_role_menus` VALUES (86, 8, 12);
INSERT INTO `system_role_menus` VALUES (94, 5, 17);
INSERT INTO `system_role_menus` VALUES (95, 5, 15);
INSERT INTO `system_role_menus` VALUES (96, 5, 14);
INSERT INTO `system_role_menus` VALUES (97, 5, 16);
INSERT INTO `system_role_menus` VALUES (204, 7, 17);
INSERT INTO `system_role_menus` VALUES (205, 7, 15);
INSERT INTO `system_role_menus` VALUES (206, 7, 11);
INSERT INTO `system_role_menus` VALUES (207, 7, 13);
INSERT INTO `system_role_menus` VALUES (208, 7, 12);
INSERT INTO `system_role_menus` VALUES (209, 7, 14);
INSERT INTO `system_role_menus` VALUES (210, 7, 16);
INSERT INTO `system_role_menus` VALUES (211, 7, 18);
INSERT INTO `system_role_menus` VALUES (212, 7, 19);
INSERT INTO `system_role_menus` VALUES (213, 7, 20);
INSERT INTO `system_role_menus` VALUES (214, 7, 21);
INSERT INTO `system_role_menus` VALUES (215, 7, 23);
INSERT INTO `system_role_menus` VALUES (216, 7, 22);
INSERT INTO `system_role_menus` VALUES (217, 7, 24);
INSERT INTO `system_role_menus` VALUES (218, 7, 26);
INSERT INTO `system_role_menus` VALUES (219, 7, 25);
INSERT INTO `system_role_menus` VALUES (220, 7, 28);
INSERT INTO `system_role_menus` VALUES (221, 7, 27);
-- ----------------------------
-- Table structure for system_roles
-- ----------------------------
DROP TABLE IF EXISTS `system_roles`;
CREATE TABLE `system_roles` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`created_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
`updated_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0),
`deleted_at` datetime(0) NULL DEFAULT '2006-01-02 15:04:05',
`name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色名',
`sort` int(11) NULL DEFAULT 0 COMMENT '排序',
`parent_id` int(11) NULL DEFAULT 0 COMMENT '父级ID',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_apis_deleted_at`(`deleted_at`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of system_roles
-- ----------------------------
INSERT INTO `system_roles` VALUES (4, '2021-04-23 23:56:39', '2021-04-24 23:02:31', '2006-01-02 15:04:05', '销售部管理员', 6, 6);
INSERT INTO `system_roles` VALUES (5, '2021-04-23 23:57:33', '2021-04-25 09:07:58', '2006-01-02 15:04:05', '技术部管理员', 6, 0);
INSERT INTO `system_roles` VALUES (6, '2021-04-23 23:58:44', '2021-04-24 23:02:24', '2006-01-02 15:04:05', '总部管理员', 0, 0);
INSERT INTO `system_roles` VALUES (7, '2021-04-24 06:02:20', '2021-04-24 13:11:51', '2006-01-02 15:04:05', '超级管理员', 0, 0);
INSERT INTO `system_roles` VALUES (8, '2021-05-02 14:05:23', '2021-05-02 14:06:13', '2006-01-02 15:04:05', 'aa', 0, 6);
INSERT INTO `system_roles` VALUES (9, '2021-05-02 14:05:30', '2021-05-02 14:06:14', '2006-01-02 15:04:05', 'aa1', 0, 0);
INSERT INTO `system_roles` VALUES (10, '2021-05-02 14:05:34', '2021-05-02 14:06:15', '2006-01-02 15:04:05', 'aa234324324', 0, 0);
-- ----------------------------
-- Table structure for system_users
-- ----------------------------
DROP TABLE IF EXISTS `system_users`;
CREATE TABLE `system_users` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`dept_id` int(11) NULL DEFAULT 0 COMMENT '部门ID',
`role_id` int(11) NULL DEFAULT 0 COMMENT '角色ID',
`user_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户账号',
`nick_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户昵称',
`user_type` int(11) NULL DEFAULT 0 COMMENT '用户类型(0系统用户)',
`email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户邮箱',
`phonenumber` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '手机号码',
`sex` int(11) NULL DEFAULT 0 COMMENT '用户性别(0男 1女 2未知)',
`avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '头像地址',
`password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '密码',
`status` int(11) NULL DEFAULT 0 COMMENT '帐号状态(0正常 1停用)',
`del_flag` int(11) NULL DEFAULT 0 COMMENT '删除标志(0代表存在 2代表删除)',
`login_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '最后登录IP',
`login_date` datetime(0) NULL DEFAULT '2006-01-02 15:04:05' COMMENT '最后登录时间',
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT 'Empty string' COMMENT '备注',
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
`created_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`updated_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
`deleted_at` datetime(0) NULL DEFAULT '2006-01-02 15:04:05' COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统用户信息表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of system_users
-- ----------------------------
INSERT INTO `system_users` VALUES (1, 9, 7, 'admin', '张三', 1, '1234729@qq.com', '12345677', 1, 'bf0812cf724eef1e27fb4c3946d8b05f_20210519015947.jpeg', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, '127.0.0.1', '2021-12-08 09:54:06', '', 'remarks1', '', '2021-04-24 06:34:04', '2021-12-08 09:54:06', '2006-01-02 15:04:05');
-- ----------------------------
-- Table structure for verify_codes
-- ----------------------------
DROP TABLE IF EXISTS `verify_codes`;
CREATE TABLE `verify_codes` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`created_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
`updated_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0),
`deleted_at` datetime(0) NULL DEFAULT '2006-01-02 15:04:05',
`account` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '号码(手机或邮箱)',
`code` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '验证码',
`type` int(11) NULL DEFAULT 0 COMMENT '类型0手机1邮箱',
`status` int(11) NULL DEFAULT 0 COMMENT '状态0未验证1已验证2验证错误',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_apis_deleted_at`(`deleted_at`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '验证码表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of verify_codes
-- ----------------------------
INSERT INTO `verify_codes` VALUES (1, '2021-05-22 11:42:32', '2021-05-22 11:42:16', '2006-01-02 15:04:05', '361018729@qq.com', '3777', 1, 1);
INSERT INTO `verify_codes` VALUES (2, '2021-05-22 12:26:00', '2021-05-22 12:28:05', '2006-01-02 15:04:05', '361018729@qq.com', '8522', 1, 1);
INSERT INTO `verify_codes` VALUES (3, '2021-05-22 12:26:18', '2021-05-22 12:26:20', '2006-01-02 15:04:05', '361018729@qq.com', '2227', 1, 1);
SET FOREIGN_KEY_CHECKS = 1; | the_stack |
--
-- MERGE INTO, test explain command
--
-- initial
CREATE SCHEMA mergeinto_explain;
SET current_schema = mergeinto_explain;
CREATE TABLE products_base
(
product_id INTEGER DEFAULT 0,
product_name VARCHAR(60) DEFAULT 'null',
category VARCHAR(60) DEFAULT 'unknown',
total INTEGER DEFAULT '0'
);
INSERT INTO products_base VALUES (1501, 'vivitar 35mm', 'electrncs', 100);
INSERT INTO products_base VALUES (1502, 'olympus is50', 'electrncs', 100);
INSERT INTO products_base VALUES (1600, 'play gym', 'toys', 100);
INSERT INTO products_base VALUES (1601, 'lamaze', 'toys', 100);
INSERT INTO products_base VALUES (1666, 'harry potter', 'dvd', 100);
CREATE TABLE newproducts_base
(
product_id INTEGER DEFAULT 0,
product_name VARCHAR(60) DEFAULT 'null',
category VARCHAR(60) DEFAULT 'unknown',
total INTEGER DEFAULT '0'
);
INSERT INTO newproducts_base VALUES (1502, 'olympus camera', 'electrncs', 200);
INSERT INTO newproducts_base VALUES (1601, 'lamaze', 'toys', 200);
INSERT INTO newproducts_base VALUES (1666, 'harry potter', 'toys', 200);
INSERT INTO newproducts_base VALUES (1700, 'wait interface', 'books', 200);
ANALYZE products_base;
ANALYZE newproducts_base;
--
-- row table
--
CREATE TABLE products_row
(
product_id INTEGER DEFAULT 0,
product_name VARCHAR(60) DEFAULT 'null',
category VARCHAR(60) DEFAULT 'unknown',
total INTEGER DEFAULT '0'
);
CREATE TABLE newproducts_row
(
product_id INTEGER DEFAULT 0,
product_name VARCHAR(60) DEFAULT 'null',
category VARCHAR(60) DEFAULT 'unknown',
total INTEGER DEFAULT '0'
);
INSERT INTO products_row SELECT * FROM products_base;
INSERT INTO newproducts_row SELECT * FROM newproducts_base;
ANALYZE products_row;
ANALYZE newproducts_row;
-- explain verbose
EXPLAIN (VERBOSE on, COSTS off)
MERGE INTO products_row p
USING newproducts_row np
ON p.product_id = np.product_id
WHEN MATCHED THEN
UPDATE SET product_name = np.product_name, category = np.category, total = np.total
WHEN NOT MATCHED THEN
INSERT VALUES (np.product_id, np.product_name, np.category, np.total);
EXPLAIN (VERBOSE on, COSTS off)
MERGE INTO products_row p
USING newproducts_row np
ON p.product_id = np.product_id
WHEN MATCHED THEN
UPDATE SET product_name = np.product_name, category = np.category, total = np.total
WHERE p.total+np.total < 1000
WHEN NOT MATCHED THEN
INSERT VALUES (np.product_id, np.product_name, np.category, np.total)
WHERE np.total < 1000;
EXPLAIN (VERBOSE on, COSTS off)
MERGE INTO products_row p
USING newproducts_row np
ON p.product_id = np.product_id
WHEN MATCHED THEN
UPDATE SET product_name = np.product_name, category = np.category, total = np.total
WHERE p.total < 1000
WHEN NOT MATCHED THEN
INSERT VALUES (np.product_id, np.product_name, np.category, np.total)
WHERE np.product_id IS NOT NULL AND np.product_name IS NOT NULL;
-- explain analyze
BEGIN;
EXPLAIN (ANALYZE on, COSTS off, TIMING off)
MERGE INTO products_row p
USING newproducts_row np
ON p.product_id = np.product_id
WHEN MATCHED THEN
UPDATE SET product_name = np.product_name, category = np.category, total = np.total
WHEN NOT MATCHED THEN
INSERT VALUES (np.product_id, np.product_name, np.category, np.total);
ROLLBACK;
-- explain performance
\o merge_explain.txt
BEGIN;
EXPLAIN PERFORMANCE
MERGE INTO products_row p
USING newproducts_row np
ON p.product_id = np.product_id
WHEN MATCHED THEN
UPDATE SET product_name = np.product_name, category = np.category, total = np.total
WHEN NOT MATCHED THEN
INSERT VALUES (np.product_id, np.product_name, np.category, np.total);
ROLLBACK;
\o
-- explain analyze
BEGIN;
EXPLAIN (ANALYZE on, COSTS off, TIMING off)
MERGE INTO products_row p
USING newproducts_row np
ON p.product_id = np.product_id
WHEN MATCHED THEN
UPDATE SET product_name = np.product_name, category = np.category, total = np.total
WHEN NOT MATCHED THEN
INSERT VALUES (np.product_id, np.product_name, np.category, np.total);
ROLLBACK;
drop table if exists item cascade;
create table item
(
a int default 3,
item_id number(18,10) ,
item_name varchar(100) ,
item_level number(39,0),
item_desc varchar(250) ,
item_subclass_cd varchar(50) ,
item_type_cd varchar(50) ,
inventory_ind char(300) ,
vendor_party_id smallint ,
commodity_cd varchar(50),
brand_cd varchar(50) ,
item_available char(100)
) with(orientation=column)
partition by range (vendor_party_id)
(
partition item_1 values less than (0),
partition item_2 values less than (1),
partition item_3 values less than (2),
partition item_4 values less than (3),
partition item_5 values less than (6),
partition item_6 values less than (8),
partition item_7 values less than (10),
partition item_8 values less than (15),
partition item_9 values less than (maxvalue)
) ENABLE ROW MOVEMENT;
drop table if exists region cascade;
create table region
(
a int default 8,
region_cd varchar(50) ,
region_name varchar(100) ,
division_cd varchar(50) ,
REGION_MGR_ASSOCIATE_ID number(18,9)
);
drop table if exists associate_benefit_expense cascade;
create table associate_benefit_expense
(
a int default 44,
period_end_dt date ,
associate_expns_type_cd varchar(50) ,
associate_party_id integer ,
benefit_hours_qty decimal(38,11) ,
benefit_cost_amt number(38,4)
)
partition by range (associate_expns_type_cd )
(
partition associate_benefit_expense_1 values less than ('B'),
partition associate_benefit_expense_2 values less than ('E'),
partition associate_benefit_expense_3 values less than ('G'),
partition associate_benefit_expense_4 values less than ('I'),
partition associate_benefit_expense_5 values less than ('L'),
partition associate_benefit_expense_6 values less than ('N'),
partition associate_benefit_expense_7 values less than ('P'),
partition associate_benefit_expense_8 values less than ('Q'),
partition associate_benefit_expense_9 values less than ('R'),
partition associate_benefit_expense_10 values less than ('T'),
partition associate_benefit_expense_11 values less than ('U'),
partition associate_benefit_expense_12 values less than ('V'),
partition associate_benefit_expense_13 values less than (maxvalue)
)ENABLE ROW MOVEMENT;
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (0.12, ' ' , 'A' , NULL, 'TGK' , 'A' , 2, 'A' , 'A' , 'Y');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (1.3, 'B' , NULL, 'B' , 'B' , NULL, 1, 'B' , NULL , 'N');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (2.23, 'C' , 'C' , NULL, 'C' , 'C' , 2, 'C' , 'C' , 'N');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (3.33, 'D' , 'D' , 'PT' , NULL, 'D' , 3, 'D' , 'D' , 'N');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (4.98, ' ' , NULL, 'E' , 'E' , 'E' , 4, 'E' , 'E' , 'Y');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (5.01, NULL, 'F' , ' ' , 'F' , 'F' , 5, 'F' , 'F' , 'N');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (6, 'G' , 'G' , 'G' , '_D' , 'G' , 6, 'G' , NULL ,'N');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (0.7, NULL, NULL, NULL, 'H' , 'H' , 7, NULL, 'G' , 'Y');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (0.08, 'I' , ' ' , ' T ' , NULL, 'I' , 8, 'I' , '' , 'N');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (9.12, ' ' , 'J' , ' PP' , 'J' , 'J' , 9, 'J' , NULL , 'Y');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (10.10, NULL, ' ' , 'A' , 'A' , 'A' , 2, NULL, 'A','Y');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (11.11, 'B' , 'B' , 'B' , 'BCDAA' , NULL, 1, 'B' , 'B','N');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (12.02, 'D' , NULL, NULL, 'C' , 'C' , 2, 'C' , 'C','N');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (13.99, NULL, ' ' , 'D' , 'D' , 'D' , 3, 'D' , 'D','Y');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (14, 'G' , 'E' , 'E' , NULL, 'E' , 4, 'E' , 'E','N');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (15, 'F' , ' ' , 'C' , 'CLEANING' , 'F' , 5, 'F' , 'F','Y');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (16, '' , 'Z' , NULL, 'G' , 'G' , 6, 'G' , NULL,'N');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (17, NULL, '' , ' PAPER' , 'H' , '' , 7, NULL, NULL,'Y');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (19, ' ' , 'B' , '' , '' , 'I' , 8, 'I' , NULL,'N');
INSERT INTO ITEM (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (20 , 'A' , 'J' , 'J' , 'J' , NULL, 9, 'J' , 'G','Y');
/*--REGION--*/
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('A', 'A ', 'A', 0.123433);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('B', 'B', 'B', NULL);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('C', 'C', 'C', 2.232008908);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('D', ' DD', 'D', 3.878789);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('E', 'A', 'E', 4.89060603);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('F', 'F', 'F', 5.82703827);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('G', 'G', 'TTT', NULL);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('H', 'H', 'G', 7.3829083);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('I', 'C', 'M', 8.983989);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('J', 'J', 'G', NULL);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('K', ' ', 'C', 2.232008908);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('L', 'D', 'X', 3.878789);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('M', 'TTTTTT ', 'D' , 4.89060603);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('N', 'G' , 'B' , NULL);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('O' , 'G', 'F', 6.6703972);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1970-01-01', 'A', 5, 0.5 , 0.5);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1973-01-01', 'B', 1, NULL, 1.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1976-01-01', 'C', 2, 2.0 , NULL);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1979-01-01', 'D', 3, 3.0 , 3.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1982-01-01', 'E', 4, 4.0 , 4.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1985-01-01', 'F', 5, 5.0 , 5.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1988-01-01', 'F', 6, NULL, 6.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1991-01-01', 'G', 6, NULL, NULL);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1994-01-01', 'G', 15, 8.0 , 8.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1997-01-01', 'G', 16, 9.0 , 9.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1983-01-03', 'I', 14, 4.0 , 4.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1984-01-01', 'GO', 15, 5.0 , NULL);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1985-05-01', 'I', 16, 6.0 , 6.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1990-01-01', 'TTT', 16, NULL, 7.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1992-02-01', 'A', 15, 8.0 , 8.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1997-02-01', 'G', 17, 9.0 , NULL);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1997-05-01', 'G' , 17, 9.0 , NULL);
explain (verbose on, costs off)
MERGE INTO item Table_006 USING (
SELECT Table_001.REGION_MGR_ASSOCIATE_ID Column_003,CAST(Table_001.region_name AS varchar) Column_004,
Table_002.associate_expns_type_cd Column_005,'o' Column_006,'F' Column_007,10 Column_008,pg_client_encoding() Column_010
FROM region Table_001,associate_benefit_expense Table_002) Table_005 ON ( Table_005.Column_004 = Table_006.item_subclass_cd ) WHEN NOT MATCHED
THEN INSERT ( Table_006.item_level, Table_006.item_desc) VALUES ( Table_005.Column_003, Table_005.Column_005 );
MERGE INTO item Table_006 USING (
SELECT Table_001.REGION_MGR_ASSOCIATE_ID Column_003,CAST(Table_001.region_name AS varchar) Column_004,
Table_002.associate_expns_type_cd Column_005,'o' Column_006,'F' Column_007,10 Column_008,pg_client_encoding() Column_010
FROM region Table_001,associate_benefit_expense Table_002) Table_005 ON ( Table_005.Column_004 = Table_006.item_subclass_cd ) WHEN NOT MATCHED
THEN INSERT ( Table_006.item_level, Table_006.item_desc) VALUES ( Table_005.Column_003, Table_005.Column_005 );
-- clean up
DROP SCHEMA mergeinto_explain CASCADE; | the_stack |
--
-- Test inheritance features
--
CREATE TABLE a (aa TEXT);
CREATE TABLE b (bb TEXT) INHERITS (a);
CREATE TABLE c (cc TEXT) INHERITS (a);
CREATE TABLE d (dd TEXT) INHERITS (b,c,a);
INSERT INTO a(aa) VALUES('aaa');
INSERT INTO a(aa) VALUES('aaaa');
INSERT INTO a(aa) VALUES('aaaaa');
INSERT INTO a(aa) VALUES('aaaaaa');
INSERT INTO a(aa) VALUES('aaaaaaa');
INSERT INTO a(aa) VALUES('aaaaaaaa');
INSERT INTO b(aa) VALUES('bbb');
INSERT INTO b(aa) VALUES('bbbb');
INSERT INTO b(aa) VALUES('bbbbb');
INSERT INTO b(aa) VALUES('bbbbbb');
INSERT INTO b(aa) VALUES('bbbbbbb');
INSERT INTO b(aa) VALUES('bbbbbbbb');
INSERT INTO c(aa) VALUES('ccc');
INSERT INTO c(aa) VALUES('cccc');
INSERT INTO c(aa) VALUES('ccccc');
INSERT INTO c(aa) VALUES('cccccc');
INSERT INTO c(aa) VALUES('ccccccc');
INSERT INTO c(aa) VALUES('cccccccc');
INSERT INTO d(aa) VALUES('ddd');
INSERT INTO d(aa) VALUES('dddd');
INSERT INTO d(aa) VALUES('ddddd');
INSERT INTO d(aa) VALUES('dddddd');
INSERT INTO d(aa) VALUES('ddddddd');
INSERT INTO d(aa) VALUES('dddddddd');
SELECT relname, a.* FROM a, pg_class where a.tableoid = pg_class.oid;
SELECT relname, b.* FROM b, pg_class where b.tableoid = pg_class.oid;
SELECT relname, c.* FROM c, pg_class where c.tableoid = pg_class.oid;
SELECT relname, d.* FROM d, pg_class where d.tableoid = pg_class.oid;
SELECT relname, a.* FROM ONLY a, pg_class where a.tableoid = pg_class.oid;
SELECT relname, b.* FROM ONLY b, pg_class where b.tableoid = pg_class.oid;
SELECT relname, c.* FROM ONLY c, pg_class where c.tableoid = pg_class.oid;
SELECT relname, d.* FROM ONLY d, pg_class where d.tableoid = pg_class.oid;
UPDATE a SET aa='zzzz' WHERE aa='aaaa';
UPDATE ONLY a SET aa='zzzzz' WHERE aa='aaaaa';
UPDATE b SET aa='zzz' WHERE aa='aaa';
UPDATE ONLY b SET aa='zzz' WHERE aa='aaa';
UPDATE a SET aa='zzzzzz' WHERE aa LIKE 'aaa%';
SELECT relname, a.* FROM a, pg_class where a.tableoid = pg_class.oid;
SELECT relname, b.* FROM b, pg_class where b.tableoid = pg_class.oid;
SELECT relname, c.* FROM c, pg_class where c.tableoid = pg_class.oid;
SELECT relname, d.* FROM d, pg_class where d.tableoid = pg_class.oid;
SELECT relname, a.* FROM ONLY a, pg_class where a.tableoid = pg_class.oid;
SELECT relname, b.* FROM ONLY b, pg_class where b.tableoid = pg_class.oid;
SELECT relname, c.* FROM ONLY c, pg_class where c.tableoid = pg_class.oid;
SELECT relname, d.* FROM ONLY d, pg_class where d.tableoid = pg_class.oid;
UPDATE b SET aa='new';
SELECT relname, a.* FROM a, pg_class where a.tableoid = pg_class.oid;
SELECT relname, b.* FROM b, pg_class where b.tableoid = pg_class.oid;
SELECT relname, c.* FROM c, pg_class where c.tableoid = pg_class.oid;
SELECT relname, d.* FROM d, pg_class where d.tableoid = pg_class.oid;
SELECT relname, a.* FROM ONLY a, pg_class where a.tableoid = pg_class.oid;
SELECT relname, b.* FROM ONLY b, pg_class where b.tableoid = pg_class.oid;
SELECT relname, c.* FROM ONLY c, pg_class where c.tableoid = pg_class.oid;
SELECT relname, d.* FROM ONLY d, pg_class where d.tableoid = pg_class.oid;
UPDATE a SET aa='new';
DELETE FROM ONLY c WHERE aa='new';
SELECT relname, a.* FROM a, pg_class where a.tableoid = pg_class.oid;
SELECT relname, b.* FROM b, pg_class where b.tableoid = pg_class.oid;
SELECT relname, c.* FROM c, pg_class where c.tableoid = pg_class.oid;
SELECT relname, d.* FROM d, pg_class where d.tableoid = pg_class.oid;
SELECT relname, a.* FROM ONLY a, pg_class where a.tableoid = pg_class.oid;
SELECT relname, b.* FROM ONLY b, pg_class where b.tableoid = pg_class.oid;
SELECT relname, c.* FROM ONLY c, pg_class where c.tableoid = pg_class.oid;
SELECT relname, d.* FROM ONLY d, pg_class where d.tableoid = pg_class.oid;
DELETE FROM a;
SELECT relname, a.* FROM a, pg_class where a.tableoid = pg_class.oid;
SELECT relname, b.* FROM b, pg_class where b.tableoid = pg_class.oid;
SELECT relname, c.* FROM c, pg_class where c.tableoid = pg_class.oid;
SELECT relname, d.* FROM d, pg_class where d.tableoid = pg_class.oid;
SELECT relname, a.* FROM ONLY a, pg_class where a.tableoid = pg_class.oid;
SELECT relname, b.* FROM ONLY b, pg_class where b.tableoid = pg_class.oid;
SELECT relname, c.* FROM ONLY c, pg_class where c.tableoid = pg_class.oid;
SELECT relname, d.* FROM ONLY d, pg_class where d.tableoid = pg_class.oid;
-- Confirm PRIMARY KEY adds NOT NULL constraint to child table
CREATE TEMP TABLE z (b TEXT, PRIMARY KEY(aa, b)) inherits (a);
INSERT INTO z VALUES (NULL, 'text'); -- should fail
-- Check UPDATE with inherited target and an inherited source table
create table foo1(f1 int, f2 int);
create table foo2(f3 int) inherits (foo1);
create table bar(f1 int, f2 int);
create table bar2(f3 int) inherits (bar);
insert into foo1 values(1,1);
insert into foo1 values(3,3);
insert into foo2 values(2,2,2);
insert into foo2 values(3,3,3);
insert into bar values(1,1);
insert into bar values(2,2);
insert into bar values(3,3);
insert into bar values(4,4);
insert into bar2 values(1,1,1);
insert into bar2 values(2,2,2);
insert into bar2 values(3,3,3);
insert into bar2 values(4,4,4);
update bar set f2 = f2 + 100 where f1 in (select f1 from foo1);
select tableoid::regclass::text as relname, bar.* from bar order by 1,2;
-- Check UPDATE with inherited target and an appendrel subquery
update bar set f2 = f2 + 100
from
( select f1 from foo1 union all select f1+3 from foo1 ) ss
where bar.f1 = ss.f1;
select tableoid::regclass::text as relname, bar.* from bar order by 1,2;
drop table foo1 cascade;
drop table bar cascase;
-- Check UPDATE with *partitioned* inherited target and an appendrel subquery
create table some_tab (a int);
insert into some_tab values (0);
create table some_tab_child () inherits (some_tab);
insert into some_tab_child values (1);
create table parted_tab (a int, b char) partition by list (a);
create table parted_tab_part1 partition of parted_tab for values in (1);
create table parted_tab_part2 partition of parted_tab for values in (2);
create table parted_tab_part3 partition of parted_tab for values in (3);
insert into parted_tab values (1, 'a'), (2, 'a'), (3, 'a');
update parted_tab set b = 'b'
from
(select a from some_tab union all select a+1 from some_tab) ss (a)
where parted_tab.a = ss.a;
select tableoid::regclass::text as relname, parted_tab.* from parted_tab order by 1,2;
truncate parted_tab;
insert into parted_tab values (1, 'a'), (2, 'a'), (3, 'a');
update parted_tab set b = 'b'
from
(select 0 from parted_tab union all select 1 from parted_tab) ss (a)
where parted_tab.a = ss.a;
select tableoid::regclass::text as relname, parted_tab.* from parted_tab order by 1,2;
drop table parted_tab;
-- Check UPDATE with multi-level partitioned inherited target
create table mlparted_tab (a int, b char, c text) partition by list (a);
create table mlparted_tab_part1 partition of mlparted_tab for values in (1);
create table mlparted_tab_part2 partition of mlparted_tab for values in (2) partition by list (b);
create table mlparted_tab_part3 partition of mlparted_tab for values in (3);
create table mlparted_tab_part2a partition of mlparted_tab_part2 for values in ('a');
create table mlparted_tab_part2b partition of mlparted_tab_part2 for values in ('b');
insert into mlparted_tab values (1, 'a'), (2, 'a'), (2, 'b'), (3, 'a');
update mlparted_tab mlp set c = 'xxx'
from
(select a from some_tab union all select a+1 from some_tab) ss (a)
where (mlp.a = ss.a and mlp.b = 'b') or mlp.a = 3;
select tableoid::regclass::text as relname, mlparted_tab.* from mlparted_tab order by 1,2;
drop table mlparted_tab;
drop table some_tab cascade;
/* Test multiple inheritance of column defaults */
CREATE TABLE firstparent (tomorrow date default now()::date + 1);
CREATE TABLE secondparent (tomorrow date default now() :: date + 1);
CREATE TABLE jointchild () INHERITS (firstparent, secondparent); -- ok
CREATE TABLE thirdparent (tomorrow date default now()::date - 1);
CREATE TABLE otherchild () INHERITS (firstparent, thirdparent); -- not ok
CREATE TABLE otherchild (tomorrow date default now())
INHERITS (firstparent, thirdparent); -- ok, child resolves ambiguous default
DROP TABLE firstparent, secondparent, jointchild, thirdparent, otherchild;
-- Test changing the type of inherited columns
insert into d values('test','one','two','three');
alter table a alter column aa type integer using bit_length(aa);
select * from d;
-- check that oid column is handled properly during alter table inherit
create table oid_parent (a int) with oids;
create table oid_child () inherits (oid_parent);
select attinhcount, attislocal from pg_attribute
where attrelid = 'oid_child'::regclass and attname = 'oid';
drop table oid_child;
create table oid_child (a int) without oids;
alter table oid_child inherit oid_parent; -- fail
alter table oid_child set with oids;
select attinhcount, attislocal from pg_attribute
where attrelid = 'oid_child'::regclass and attname = 'oid';
alter table oid_child inherit oid_parent;
select attinhcount, attislocal from pg_attribute
where attrelid = 'oid_child'::regclass and attname = 'oid';
alter table oid_child set without oids; -- fail
alter table oid_parent set without oids;
select attinhcount, attislocal from pg_attribute
where attrelid = 'oid_child'::regclass and attname = 'oid';
alter table oid_child set without oids;
select attinhcount, attislocal from pg_attribute
where attrelid = 'oid_child'::regclass and attname = 'oid';
drop table oid_parent cascade;
-- Test non-inheritable parent constraints
create table p1(ff1 int);
alter table p1 add constraint p1chk check (ff1 > 0) no inherit;
alter table p1 add constraint p2chk check (ff1 > 10);
-- connoinherit should be true for NO INHERIT constraint
select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.connoinherit from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname = 'p1' order by 1,2;
-- Test that child does not inherit NO INHERIT constraints
create table c1 () inherits (p1);
\d p1
\d c1
-- Test that child does not override inheritable constraints of the parent
create table c2 (constraint p2chk check (ff1 > 10) no inherit) inherits (p1); --fails
drop table p1 cascade;
-- Tests for casting between the rowtypes of parent and child
-- tables. See the pgsql-hackers thread beginning Dec. 4/04
create table base (i integer);
create table derived () inherits (base);
insert into derived (i) values (0);
select derived::base from derived;
select NULL::derived::base;
drop table derived;
drop table base;
create table p1(ff1 int);
create table p2(f1 text);
create function p2text(p2) returns text as 'select $1.f1' language sql;
-- POLAR_END_FUNC
create table c1(f3 int) inherits(p1,p2);
insert into c1 values(123456789, 'hi', 42);
select p2text(c1.*) from c1;
drop function p2text(p2);
drop table c1;
drop table p2;
drop table p1;
CREATE TABLE ac (aa TEXT);
alter table ac add constraint ac_check check (aa is not null);
CREATE TABLE bc (bb TEXT) INHERITS (ac);
select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.consrc from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname in ('ac', 'bc') order by 1,2;
insert into ac (aa) values (NULL);
insert into bc (aa) values (NULL);
alter table bc drop constraint ac_check; -- fail, disallowed
alter table ac drop constraint ac_check;
select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.consrc from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname in ('ac', 'bc') order by 1,2;
-- try the unnamed-constraint case
alter table ac add check (aa is not null);
select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.consrc from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname in ('ac', 'bc') order by 1,2;
insert into ac (aa) values (NULL);
insert into bc (aa) values (NULL);
alter table bc drop constraint ac_aa_check; -- fail, disallowed
alter table ac drop constraint ac_aa_check;
select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.consrc from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname in ('ac', 'bc') order by 1,2;
alter table ac add constraint ac_check check (aa is not null);
alter table bc no inherit ac;
select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.consrc from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname in ('ac', 'bc') order by 1,2;
alter table bc drop constraint ac_check;
select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.consrc from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname in ('ac', 'bc') order by 1,2;
alter table ac drop constraint ac_check;
select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.consrc from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname in ('ac', 'bc') order by 1,2;
drop table bc;
drop table ac;
create table ac (a int constraint check_a check (a <> 0));
create table bc (a int constraint check_a check (a <> 0), b int constraint check_b check (b <> 0)) inherits (ac);
select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.consrc from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname in ('ac', 'bc') order by 1,2;
drop table bc;
drop table ac;
create table ac (a int constraint check_a check (a <> 0));
create table bc (b int constraint check_b check (b <> 0));
create table cc (c int constraint check_c check (c <> 0)) inherits (ac, bc);
select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.consrc from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname in ('ac', 'bc', 'cc') order by 1,2;
alter table cc no inherit bc;
select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.consrc from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname in ('ac', 'bc', 'cc') order by 1,2;
drop table cc;
drop table bc;
drop table ac;
create table p1(f1 int);
create table p2(f2 int);
create table c1(f3 int) inherits(p1,p2);
insert into c1 values(1,-1,2);
alter table p2 add constraint cc check (f2>0); -- fail
alter table p2 add check (f2>0); -- check it without a name, too
delete from c1;
insert into c1 values(1,1,2);
alter table p2 add check (f2>0);
insert into c1 values(1,-1,2); -- fail
create table c2(f3 int) inherits(p1,p2);
\d c2
create table c3 (f4 int) inherits(c1,c2);
\d c3
drop table p1 cascade;
drop table p2 cascade;
create table pp1 (f1 int);
create table cc1 (f2 text, f3 int) inherits (pp1);
alter table pp1 add column a1 int check (a1 > 0);
\d cc1
create table cc2(f4 float) inherits(pp1,cc1);
\d cc2
alter table pp1 add column a2 int check (a2 > 0);
\d cc2
drop table pp1 cascade;
-- Test for renaming in simple multiple inheritance
CREATE TABLE inht1 (a int, b int);
CREATE TABLE inhs1 (b int, c int);
CREATE TABLE inhts (d int) INHERITS (inht1, inhs1);
ALTER TABLE inht1 RENAME a TO aa;
ALTER TABLE inht1 RENAME b TO bb; -- to be failed
ALTER TABLE inhts RENAME aa TO aaa; -- to be failed
ALTER TABLE inhts RENAME d TO dd;
\d+ inhts
DROP TABLE inhts;
-- Test for renaming in diamond inheritance
CREATE TABLE inht2 (x int) INHERITS (inht1);
CREATE TABLE inht3 (y int) INHERITS (inht1);
CREATE TABLE inht4 (z int) INHERITS (inht2, inht3);
ALTER TABLE inht1 RENAME aa TO aaa;
\d+ inht4
CREATE TABLE inhts (d int) INHERITS (inht2, inhs1);
ALTER TABLE inht1 RENAME aaa TO aaaa;
ALTER TABLE inht1 RENAME b TO bb; -- to be failed
\d+ inhts
WITH RECURSIVE r AS (
SELECT 'inht1'::regclass AS inhrelid
UNION ALL
SELECT c.inhrelid FROM pg_inherits c, r WHERE r.inhrelid = c.inhparent
)
SELECT a.attrelid::regclass, a.attname, a.attinhcount, e.expected
FROM (SELECT inhrelid, count(*) AS expected FROM pg_inherits
WHERE inhparent IN (SELECT inhrelid FROM r) GROUP BY inhrelid) e
JOIN pg_attribute a ON e.inhrelid = a.attrelid WHERE NOT attislocal
ORDER BY a.attrelid::regclass::name, a.attnum;
DROP TABLE inht1, inhs1 CASCADE;
-- Test non-inheritable indices [UNIQUE, EXCLUDE] constraints
CREATE TABLE test_constraints (id int, val1 varchar, val2 int, UNIQUE(val1, val2));
CREATE TABLE test_constraints_inh () INHERITS (test_constraints);
\d+ test_constraints
ALTER TABLE ONLY test_constraints DROP CONSTRAINT test_constraints_val1_val2_key;
\d+ test_constraints
\d+ test_constraints_inh
DROP TABLE test_constraints_inh;
DROP TABLE test_constraints;
CREATE TABLE test_ex_constraints (
c circle,
EXCLUDE USING gist (c WITH &&)
);
CREATE TABLE test_ex_constraints_inh () INHERITS (test_ex_constraints);
\d+ test_ex_constraints
ALTER TABLE test_ex_constraints DROP CONSTRAINT test_ex_constraints_c_excl;
\d+ test_ex_constraints
\d+ test_ex_constraints_inh
DROP TABLE test_ex_constraints_inh;
DROP TABLE test_ex_constraints;
-- Test non-inheritable foreign key constraints
CREATE TABLE test_primary_constraints(id int PRIMARY KEY);
CREATE TABLE test_foreign_constraints(id1 int REFERENCES test_primary_constraints(id));
CREATE TABLE test_foreign_constraints_inh () INHERITS (test_foreign_constraints);
\d+ test_primary_constraints
\d+ test_foreign_constraints
ALTER TABLE test_foreign_constraints DROP CONSTRAINT test_foreign_constraints_id1_fkey;
\d+ test_foreign_constraints
\d+ test_foreign_constraints_inh
DROP TABLE test_foreign_constraints_inh;
DROP TABLE test_foreign_constraints;
DROP TABLE test_primary_constraints;
-- Test foreign key behavior
create table inh_fk_1 (a int primary key);
insert into inh_fk_1 values (1), (2), (3);
create table inh_fk_2 (x int primary key, y int references inh_fk_1 on delete cascade);
insert into inh_fk_2 values (11, 1), (22, 2), (33, 3);
create table inh_fk_2_child () inherits (inh_fk_2);
insert into inh_fk_2_child values (111, 1), (222, 2);
delete from inh_fk_1 where a = 1;
select * from inh_fk_1 order by 1;
select * from inh_fk_2 order by 1, 2;
drop table inh_fk_1, inh_fk_2, inh_fk_2_child;
-- Test that parent and child CHECK constraints can be created in either order
create table p1(f1 int);
create table p1_c1() inherits(p1);
alter table p1 add constraint inh_check_constraint1 check (f1 > 0);
alter table p1_c1 add constraint inh_check_constraint1 check (f1 > 0);
alter table p1_c1 add constraint inh_check_constraint2 check (f1 < 10);
alter table p1 add constraint inh_check_constraint2 check (f1 < 10);
select conrelid::regclass::text as relname, conname, conislocal, coninhcount
from pg_constraint where conname like 'inh\_check\_constraint%'
order by 1, 2;
drop table p1 cascade;
-- Test that a valid child can have not-valid parent, but not vice versa
create table invalid_check_con(f1 int);
create table invalid_check_con_child() inherits(invalid_check_con);
alter table invalid_check_con_child add constraint inh_check_constraint check(f1 > 0) not valid;
alter table invalid_check_con add constraint inh_check_constraint check(f1 > 0); -- fail
alter table invalid_check_con_child drop constraint inh_check_constraint;
insert into invalid_check_con values(0);
alter table invalid_check_con_child add constraint inh_check_constraint check(f1 > 0);
alter table invalid_check_con add constraint inh_check_constraint check(f1 > 0) not valid;
insert into invalid_check_con values(0); -- fail
insert into invalid_check_con_child values(0); -- fail
select conrelid::regclass::text as relname, conname,
convalidated, conislocal, coninhcount, connoinherit
from pg_constraint where conname like 'inh\_check\_constraint%'
order by 1, 2;
-- We don't drop the invalid_check_con* tables, to test dump/reload with
--
-- Test parameterized append plans for inheritance trees
--
create table patest0 (id, x) as
select x, x from generate_series(0,1000) x;
create table patest1() inherits (patest0);
insert into patest1
select x, x from generate_series(0,1000) x;
create table patest2() inherits (patest0);
insert into patest2
select x, x from generate_series(0,1000) x;
create index patest0i on patest0(id);
create index patest1i on patest1(id);
create index patest2i on patest2(id);
analyze patest0;
analyze patest1;
analyze patest2;
-- explain (costs off)
select * from patest0 join (select f1 from int4_tbl limit 1) ss on id = f1;
select * from patest0 join (select f1 from int4_tbl limit 1) ss on id = f1;
drop index patest2i;
-- explain (costs off)
select * from patest0 join (select f1 from int4_tbl limit 1) ss on id = f1;
select * from patest0 join (select f1 from int4_tbl limit 1) ss on id = f1;
drop table patest0 cascade;
--
-- Test merge-append plans for inheritance trees
--
create table matest0 (id serial primary key, name text);
create table matest1 (id integer primary key) inherits (matest0);
create table matest2 (id integer primary key) inherits (matest0);
create table matest3 (id integer primary key) inherits (matest0);
create index matest0i on matest0 ((1-id));
create index matest1i on matest1 ((1-id));
-- create index matest2i on matest2 ((1-id)); -- intentionally missing
create index matest3i on matest3 ((1-id));
insert into matest1 (name) values ('Test 1');
insert into matest1 (name) values ('Test 2');
insert into matest2 (name) values ('Test 3');
insert into matest2 (name) values ('Test 4');
insert into matest3 (name) values ('Test 5');
insert into matest3 (name) values ('Test 6');
set enable_indexscan = off; -- force use of seqscan/sort, so no merge
-- explain (verbose, costs off) select * from matest0 order by 1-id;
select * from matest0 order by 1-id;
-- explain (verbose, costs off) select min(1-id) from matest0;
select min(1-id) from matest0;
reset enable_indexscan;
set enable_seqscan = off; -- plan with fewest seqscans should be merge
set enable_parallel_append = off; -- Don't let parallel-append interfere
-- explain (verbose, costs off) select * from matest0 order by 1-id;
select * from matest0 order by 1-id;
select count(*) from matest0;
-- explain (verbose, costs off) select min(1-id) from matest0;
select min(1-id) from matest0;
reset enable_seqscan;
reset enable_parallel_append;
drop table matest0 cascade;
--
-- Check that use of an index with an extraneous column doesn't produce
-- a plan with extraneous sorting
--
create table matest0 (a int, b int, c int, d int);
create table matest1 () inherits(matest0);
create index matest0i on matest0 (b, c);
create index matest1i on matest1 (b, c);
set enable_nestloop = off; -- we want a plan with two MergeAppends
-- explain (costs off)
select t1.* from matest0 t1, matest0 t2
where t1.b = t2.b and t2.c = t2.d
order by t1.b limit 10;
reset enable_nestloop;
drop table matest0 cascade;
--
-- Test merge-append for UNION ALL append relations
--
set enable_seqscan = off;
set enable_indexscan = on;
set enable_bitmapscan = off;
-- Check handling of duplicated, constant, or volatile targetlist items
-- explain (costs off)
SELECT thousand, tenthous FROM tenk1
UNION ALL
SELECT thousand, thousand FROM tenk1
ORDER BY thousand, tenthous;
-- explain (costs off)
SELECT thousand, tenthous, thousand+tenthous AS x FROM tenk1
UNION ALL
SELECT 42, 42, hundred FROM tenk1
ORDER BY thousand, tenthous;
-- explain (costs off)
SELECT thousand, tenthous FROM tenk1
-- UNION ALL
-- SELECT thousand, random()::integer FROM tenk1
ORDER BY thousand, tenthous;
-- Check min/max aggregate optimization
-- explain (costs off)
SELECT min(x) FROM
(SELECT unique1 AS x FROM tenk1 a
UNION ALL
SELECT unique2 AS x FROM tenk1 b) s;
-- explain (costs off)
SELECT min(y) FROM
(SELECT unique1 AS x, unique1 AS y FROM tenk1 a
UNION ALL
SELECT unique2 AS x, unique2 AS y FROM tenk1 b) s;
-- XXX planner doesn't recognize that index on unique2 is sufficiently sorted
-- explain (costs off)
SELECT x, y FROM
(SELECT thousand AS x, tenthous AS y FROM tenk1 a
UNION ALL
SELECT unique2 AS x, unique2 AS y FROM tenk1 b) s
ORDER BY x, y;
-- exercise rescan code path via a repeatedly-evaluated subquery
-- explain (costs off)
SELECT
ARRAY(SELECT f.i FROM (
(SELECT d + g.i FROM generate_series(4, 30, 3) d ORDER BY 1)
UNION ALL
(SELECT d + g.i FROM generate_series(0, 30, 5) d ORDER BY 1)
) f(i)
ORDER BY f.i LIMIT 10)
FROM generate_series(1, 3) g(i);
SELECT
ARRAY(SELECT f.i FROM (
(SELECT d + g.i FROM generate_series(4, 30, 3) d ORDER BY 1)
UNION ALL
(SELECT d + g.i FROM generate_series(0, 30, 5) d ORDER BY 1)
) f(i)
ORDER BY f.i LIMIT 10)
FROM generate_series(1, 3) g(i);
reset enable_seqscan;
reset enable_indexscan;
reset enable_bitmapscan;
--
-- Check handling of a constant-null CHECK constraint
--
create table cnullparent (f1 int);
create table cnullchild (check (f1 = 1 or f1 = null)) inherits(cnullparent);
insert into cnullchild values(1);
insert into cnullchild values(2);
insert into cnullchild values(null);
select * from cnullparent;
select * from cnullparent where f1 = 2;
drop table cnullparent cascade;
--
-- Check that constraint exclusion works correctly with partitions using
-- implicit constraints generated from the partition bound information.
--
create table list_parted (
a varchar
) partition by list (a);
create table part_ab_cd partition of list_parted for values in ('ab', 'cd');
create table part_ef_gh partition of list_parted for values in ('ef', 'gh');
create table part_null_xy partition of list_parted for values in (null, 'xy');
-- explain (costs off) select * from list_parted;
-- explain (costs off) select * from list_parted where a is null;
-- explain (costs off) select * from list_parted where a is not null;
-- explain (costs off) select * from list_parted where a in ('ab', 'cd', 'ef');
-- explain (costs off) select * from list_parted where a = 'ab' or a in (null, 'cd');
-- explain (costs off) select * from list_parted where a = 'ab';
create table range_list_parted (
a int,
b char(2)
) partition by range (a);
create table part_1_10 partition of range_list_parted for values from (1) to (10) partition by list (b);
create table part_1_10_ab partition of part_1_10 for values in ('ab');
create table part_1_10_cd partition of part_1_10 for values in ('cd');
create table part_10_20 partition of range_list_parted for values from (10) to (20) partition by list (b);
create table part_10_20_ab partition of part_10_20 for values in ('ab');
create table part_10_20_cd partition of part_10_20 for values in ('cd');
create table part_21_30 partition of range_list_parted for values from (21) to (30) partition by list (b);
create table part_21_30_ab partition of part_21_30 for values in ('ab');
create table part_21_30_cd partition of part_21_30 for values in ('cd');
create table part_40_inf partition of range_list_parted for values from (40) to (maxvalue) partition by list (b);
create table part_40_inf_ab partition of part_40_inf for values in ('ab');
create table part_40_inf_cd partition of part_40_inf for values in ('cd');
create table part_40_inf_null partition of part_40_inf for values in (null);
-- explain (costs off) select * from range_list_parted;
-- explain (costs off) select * from range_list_parted where a = 5;
-- explain (costs off) select * from range_list_parted where b = 'ab';
-- explain (costs off) select * from range_list_parted where a between 3 and 23 and b in ('ab');
/* Should select no rows because range partition key cannot be null */
-- explain (costs off) select * from range_list_parted where a is null;
/* Should only select rows from the null-accepting partition */
-- explain (costs off) select * from range_list_parted where b is null;
-- explain (costs off) select * from range_list_parted where a is not null and a < 67;
-- explain (costs off) select * from range_list_parted where a >= 30;
drop table list_parted;
drop table range_list_parted;
-- check that constraint exclusion is able to cope with the partition
-- constraint emitted for multi-column range partitioned tables
create table mcrparted (a int, b int, c int) partition by range (a, abs(b), c);
create table mcrparted_def partition of mcrparted default;
create table mcrparted0 partition of mcrparted for values from (minvalue, minvalue, minvalue) to (1, 1, 1);
create table mcrparted1 partition of mcrparted for values from (1, 1, 1) to (10, 5, 10);
create table mcrparted2 partition of mcrparted for values from (10, 5, 10) to (10, 10, 10);
create table mcrparted3 partition of mcrparted for values from (11, 1, 1) to (20, 10, 10);
create table mcrparted4 partition of mcrparted for values from (20, 10, 10) to (20, 20, 20);
create table mcrparted5 partition of mcrparted for values from (20, 20, 20) to (maxvalue, maxvalue, maxvalue);
-- explain (costs off) select * from mcrparted where a = 0; -- scans mcrparted0, mcrparted_def
-- explain (costs off) select * from mcrparted where a = 10 and abs(b) < 5; -- scans mcrparted1, mcrparted_def
-- explain (costs off) select * from mcrparted where a = 10 and abs(b) = 5; -- scans mcrparted1, mcrparted2, mcrparted_def
-- explain (costs off) select * from mcrparted where abs(b) = 5; -- scans all partitions
-- explain (costs off) select * from mcrparted where a > -1; -- scans all partitions
-- explain (costs off) select * from mcrparted where a = 20 and abs(b) = 10 and c > 10; -- scans mcrparted4
-- explain (costs off) select * from mcrparted where a = 20 and c > 20; -- scans mcrparted3, mcrparte4, mcrparte5, mcrparted_def
drop table mcrparted;
-- check that partitioned table Appends cope with being referenced in
-- subplans
create table parted_minmax (a int, b varchar(16)) partition by range (a);
create table parted_minmax1 partition of parted_minmax for values from (1) to (10);
create index parted_minmax1i on parted_minmax1 (a, b);
insert into parted_minmax values (1,'12345');
-- explain (costs off) select min(a), max(a) from parted_minmax where b = '12345';
select min(a), max(a) from parted_minmax where b = '12345';
drop table parted_minmax; | the_stack |
-- 2017-12-20T07:40:34.674
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_EntityType (AD_Client_ID,AD_EntityType_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,IsDisplayed,ModelPackage,Name,Processing,Updated,UpdatedBy) VALUES (0,540219,0,TO_TIMESTAMP('2017-12-20 07:40:34','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.material.cockpit','Y','Y','de.metas.material.dispo.cockpit','de.metas.material.cockpit','N',TO_TIMESTAMP('2017-12-20 07:40:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-20T07:40:48.162
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:40:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=540863
;
-- 2017-12-20T07:41:06.901
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557948
;
-- 2017-12-20T07:41:08.390
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557947
;
-- 2017-12-20T07:41:09.378
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558315
;
-- 2017-12-20T07:41:10.288
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558283
;
-- 2017-12-20T07:41:11.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558286
;
-- 2017-12-20T07:41:11.790
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558312
;
-- 2017-12-20T07:41:12.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558284
;
-- 2017-12-20T07:41:13.425
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558314
;
-- 2017-12-20T07:41:14.194
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558313
;
-- 2017-12-20T07:41:15.020
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558316
;
-- 2017-12-20T07:41:15.802
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558317
;
-- 2017-12-20T07:41:16.525
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558318
;
-- 2017-12-20T07:41:17.374
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558285
;
-- 2017-12-20T07:41:18.126
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558287
;
-- 2017-12-20T07:41:18.834
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557950
;
-- 2017-12-20T07:41:19.568
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558319
;
-- 2017-12-20T07:41:20.244
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit', IsUpdateable='N',Updated=TO_TIMESTAMP('2017-12-20 07:41:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557949
;
-- 2017-12-20T07:41:20.972
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557946
;
-- 2017-12-20T07:41:21.670
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558282
;
-- 2017-12-20T07:41:22.671
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557945
;
-- 2017-12-20T07:41:24.673
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557944
;
-- 2017-12-20T07:41:24.778
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558281
;
-- 2017-12-20T07:41:26.230
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557943
;
-- 2017-12-20T07:41:28.200
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557942
;
-- 2017-12-20T07:41:52.031
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:41:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543667
;
-- 2017-12-20T07:43:41.162
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=540376, Name='Materialcockpit',Updated=TO_TIMESTAMP('2017-12-20 07:43:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=540863
;
-- 2017-12-20T07:43:49.556
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:43:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=540376
;
-- 2017-12-20T07:44:17.298
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET EntityType='de.metas.material.cockpit', Name='Materialcockpit', PrintName='Materialcockpit',Updated=TO_TIMESTAMP('2017-12-20 07:44:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543488
;
-- 2017-12-20T07:44:17.300
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='MD_Cockpit_ID', Name='Materialcockpit', Description=NULL, Help=NULL WHERE AD_Element_ID=543488
;
-- 2017-12-20T07:44:17.311
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='MD_Cockpit_ID', Name='Materialcockpit', Description=NULL, Help=NULL, AD_Element_ID=543488 WHERE UPPER(ColumnName)='MD_COCKPIT_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2017-12-20T07:44:17.313
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='MD_Cockpit_ID', Name='Materialcockpit', Description=NULL, Help=NULL WHERE AD_Element_ID=543488 AND IsCentrallyMaintained='Y'
;
-- 2017-12-20T07:44:17.314
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Materialcockpit', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=543488) AND IsCentrallyMaintained='Y'
;
-- 2017-12-20T07:44:17.327
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Materialcockpit', Name='Materialcockpit' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=543488)
;
-- 2017-12-20T07:44:43.217
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:44:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543678
;
-- 2017-12-20T07:44:53.060
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:44:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543682
;
-- 2017-12-20T07:45:02.861
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:45:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543683
;
-- 2017-12-20T07:45:15.141
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:45:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543680
;
-- 2017-12-20T07:45:30.107
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET EntityType='de.metas.material.cockpit',Updated=TO_TIMESTAMP('2017-12-20 07:45:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543679
; | the_stack |
-- 2017-09-13T15:28:46.436
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Process_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy,WEBUI_NameBrowse) VALUES ('R',0,540957,0,540710,TO_TIMESTAMP('2017-09-13 15:28:46','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','_Verkaufsstatistik','Y','N','N','Y','N','Verkaufsstatistik',TO_TIMESTAMP('2017-09-13 15:28:46','YYYY-MM-DD HH24:MI:SS'),100,'Verkaufsstatistik')
;
-- 2017-09-13T15:28:46.441
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=540957 AND NOT EXISTS (SELECT 1 FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 2017-09-13T15:28:46.443
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 540957, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=540957)
;
-- 2017-09-13T15:28:47.023
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540928 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.034
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540930 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.035
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540933 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.035
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540926 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.035
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=540927 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.036
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=540738 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.036
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540925 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.036
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540923 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.037
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=540922 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.037
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=540931 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.037
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540947 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.038
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540932 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.038
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=540924 AND AD_Tree_ID=10
;
-- 2017-09-13T15:28:47.038
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000048, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=540957 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:49.523
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Process_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy,WEBUI_NameBrowse) VALUES ('R',0,540958,0,540711,TO_TIMESTAMP('2017-09-13 15:29:49','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','_Einkaufsstatistik','Y','N','N','N','N','Einkaufsstatistik',TO_TIMESTAMP('2017-09-13 15:29:49','YYYY-MM-DD HH24:MI:SS'),100,'Einkaufsstatistik')
;
-- 2017-09-13T15:29:49.529
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=540958 AND NOT EXISTS (SELECT 1 FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 2017-09-13T15:29:49.533
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 540958, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=540958)
;
-- 2017-09-13T15:29:50.130
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540614 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.132
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540750 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.133
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540616 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.134
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540681 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.134
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=540617 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.135
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=540742 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.136
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540618 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.137
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540619 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.138
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=540632 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.139
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=540635 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.139
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540698 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.140
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540637 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.140
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=540638 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.141
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=540648 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.141
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=540674 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.141
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=540709 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.142
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=540708 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.142
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=540679 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.142
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=540678 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.143
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=19, Updated=now(), UpdatedBy=100 WHERE Node_ID=540684 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.143
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=20, Updated=now(), UpdatedBy=100 WHERE Node_ID=540686 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.143
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=21, Updated=now(), UpdatedBy=100 WHERE Node_ID=540706 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.144
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=22, Updated=now(), UpdatedBy=100 WHERE Node_ID=540701 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.145
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=23, Updated=now(), UpdatedBy=100 WHERE Node_ID=540712 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.145
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=24, Updated=now(), UpdatedBy=100 WHERE Node_ID=540722 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=25, Updated=now(), UpdatedBy=100 WHERE Node_ID=540723 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.147
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=26, Updated=now(), UpdatedBy=100 WHERE Node_ID=540725 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.147
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=27, Updated=now(), UpdatedBy=100 WHERE Node_ID=540739 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.147
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=28, Updated=now(), UpdatedBy=100 WHERE Node_ID=540740 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.148
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=29, Updated=now(), UpdatedBy=100 WHERE Node_ID=540741 AND AD_Tree_ID=10
;
-- 2017-09-13T15:29:50.148
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=30, Updated=now(), UpdatedBy=100 WHERE Node_ID=540958 AND AD_Tree_ID=10
;
-- 2017-09-13T15:30:13.221
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000049, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540934 AND AD_Tree_ID=10
;
-- 2017-09-13T15:30:13.222
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000049, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540935 AND AD_Tree_ID=10
;
-- 2017-09-13T15:30:13.222
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000049, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540958 AND AD_Tree_ID=10
;
-- 2017-09-13T15:30:13.223
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000049, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540936 AND AD_Tree_ID=10
;
-- 2017-09-13T15:30:14.689
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000049, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540934 AND AD_Tree_ID=10
;
-- 2017-09-13T15:30:14.690
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000049, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540935 AND AD_Tree_ID=10
;
-- 2017-09-13T15:30:14.691
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000049, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540936 AND AD_Tree_ID=10
;
-- 2017-09-13T15:30:14.692
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000049, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540958 AND AD_Tree_ID=10
;
-- 2017-09-13T15:31:33.672
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-09-13 15:31:33','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Purchase Trace',WEBUI_NameBrowse='Purchase Trace' WHERE AD_Menu_ID=540958 AND AD_Language='en_US'
;
-- 2017-09-13T15:31:51.078
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-09-13 15:31:51','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Sales Trace',WEBUI_NameBrowse='Sales Trace' WHERE AD_Menu_ID=540957 AND AD_Language='en_US'
;
-- 2017-09-13T15:32:29.612
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Process_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy,WEBUI_NameBrowse) VALUES ('R',0,540959,0,540636,TO_TIMESTAMP('2017-09-13 15:32:29','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','_Kostenstellenwechsel','Y','N','N','N','N','Kostenstellenwechsel',TO_TIMESTAMP('2017-09-13 15:32:29','YYYY-MM-DD HH24:MI:SS'),100,'Kostenstellenwechsel')
;
-- 2017-09-13T15:32:29.616
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=540959 AND NOT EXISTS (SELECT 1 FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 2017-09-13T15:32:29.620
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 540959, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=540959)
;
-- 2017-09-13T15:32:29.689
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000064, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540944 AND AD_Tree_ID=10
;
-- 2017-09-13T15:32:29.690
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000064, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540945 AND AD_Tree_ID=10
;
-- 2017-09-13T15:32:29.691
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000064, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540937 AND AD_Tree_ID=10
;
-- 2017-09-13T15:32:29.691
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000064, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540939 AND AD_Tree_ID=10
;
-- 2017-09-13T15:32:29.691
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000064, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=540940 AND AD_Tree_ID=10
;
-- 2017-09-13T15:32:29.692
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000064, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=540941 AND AD_Tree_ID=10
;
-- 2017-09-13T15:32:29.692
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000064, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540946 AND AD_Tree_ID=10
;
-- 2017-09-13T15:32:29.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000064, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540942 AND AD_Tree_ID=10
;
-- 2017-09-13T15:32:29.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000064, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=540938 AND AD_Tree_ID=10
;
-- 2017-09-13T15:32:29.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000064, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=540948 AND AD_Tree_ID=10
;
-- 2017-09-13T15:32:29.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000064, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540959 AND AD_Tree_ID=10
;
-- 2017-09-13T15:33:39.354
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000065, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540936 AND AD_Tree_ID=10
;
-- 2017-09-13T15:33:39.355
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000065, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540943 AND AD_Tree_ID=10
; | the_stack |
-- Generated by CompileSchemaScripts.pl from:
-- 20140310-dates.sql
-- 20140212-ordering-columns.sql
-- 20140208-drop-script_language.sql
-- 20140407-link-cardinality.sql
-- 20140311-remove-area-sortnames.sql
-- 20140313-remove-label-sortnames.sql
-- 20140214-add-instruments.sql
-- 20140215-add-instruments-documentation.sql
-- 20140318-series.sql
-- 20140418-series-instrument-functions.sql
-- 20140429-area-view.sql
\set ON_ERROR_STOP 1
BEGIN;
--------------------------------------------------------------------------------
SELECT '20140310-dates.sql';
-----------------------
-- CREATE NEW COLUMN --
-----------------------
ALTER TABLE link_type ADD COLUMN has_dates BOOLEAN NOT NULL DEFAULT TRUE;
--------------------------------------------------------------------------------
SELECT '20140212-ordering-columns.sql';
ALTER TABLE area_alias_type ADD COLUMN parent INTEGER;
ALTER TABLE area_alias_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE area_alias_type ADD COLUMN description TEXT;
ALTER TABLE area_type ADD COLUMN parent INTEGER;
ALTER TABLE area_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE area_type ADD COLUMN description TEXT;
ALTER TABLE artist_type ADD COLUMN parent INTEGER;
ALTER TABLE artist_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE artist_type ADD COLUMN description TEXT;
ALTER TABLE artist_alias_type ADD COLUMN parent INTEGER;
ALTER TABLE artist_alias_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE artist_alias_type ADD COLUMN description TEXT;
ALTER TABLE gender ADD COLUMN parent INTEGER;
ALTER TABLE gender ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE gender ADD COLUMN description TEXT;
ALTER TABLE label_type ADD COLUMN parent INTEGER;
ALTER TABLE label_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE label_type ADD COLUMN description TEXT;
ALTER TABLE label_alias_type ADD COLUMN parent INTEGER;
ALTER TABLE label_alias_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE label_alias_type ADD COLUMN description TEXT;
ALTER TABLE medium_format ADD COLUMN description TEXT;
ALTER TABLE place_type ADD COLUMN parent INTEGER;
ALTER TABLE place_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE place_type ADD COLUMN description TEXT;
ALTER TABLE place_alias_type ADD COLUMN parent INTEGER;
ALTER TABLE place_alias_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE place_alias_type ADD COLUMN description TEXT;
ALTER TABLE release_group_primary_type ADD COLUMN parent INTEGER;
ALTER TABLE release_group_primary_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE release_group_primary_type ADD COLUMN description TEXT;
ALTER TABLE release_group_secondary_type ADD COLUMN parent INTEGER;
ALTER TABLE release_group_secondary_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE release_group_secondary_type ADD COLUMN description TEXT;
ALTER TABLE release_packaging ADD COLUMN parent INTEGER;
ALTER TABLE release_packaging ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE release_packaging ADD COLUMN description TEXT;
ALTER TABLE release_status ADD COLUMN parent INTEGER;
ALTER TABLE release_status ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE release_status ADD COLUMN description TEXT;
ALTER TABLE work_alias_type ADD COLUMN parent INTEGER;
ALTER TABLE work_alias_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE work_alias_type ADD COLUMN description TEXT;
ALTER TABLE work_attribute_type ADD COLUMN parent INTEGER;
ALTER TABLE work_attribute_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE work_attribute_type ADD COLUMN description TEXT;
ALTER TABLE work_attribute_type_allowed_value ADD COLUMN parent INTEGER;
ALTER TABLE work_attribute_type_allowed_value ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE work_attribute_type_allowed_value ADD COLUMN description TEXT;
ALTER TABLE work_type ADD COLUMN parent INTEGER;
ALTER TABLE work_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE work_type ADD COLUMN description TEXT;
ALTER TABLE cover_art_archive.art_type ADD COLUMN parent INTEGER;
ALTER TABLE cover_art_archive.art_type ADD COLUMN child_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE cover_art_archive.art_type ADD COLUMN description TEXT;
-- set Original Production, Bootleg Production and Reissue Production as children of Production, like pre-NGS (MBS-2410)
UPDATE label_type SET parent = 3 WHERE id IN (4, 5, 6);
-- put Other second to last and None last (MBS-6709)
UPDATE release_packaging SET child_order = 1 WHERE id = 5;
UPDATE release_packaging SET child_order = 2 WHERE id = 7;
-- put Other last
UPDATE cover_art_archive.art_type SET child_order = 1 WHERE id = 8;
--------------------------------------------------------------------------------
SELECT '20140208-drop-script_language.sql';
DROP TABLE script_language;
--------------------------------------------------------------------------------
SELECT '20140407-link-cardinality.sql';
ALTER TABLE link_type ADD COLUMN entity0_cardinality integer,
ADD COLUMN entity1_cardinality integer;
-- Type pairs where the info is central to entity1, but many-valued to entity0
-- e.g. artist-recording (performer, mastering, etc.)
UPDATE link_type SET entity0_cardinality = 1, entity1_cardinality = 0
WHERE (entity_type0 = 'artist' AND entity_type1 IN ('recording', 'release', 'release_group', 'work'))
OR (entity_type0 = 'label' AND entity_type1 IN ('recording', 'release', 'work'));
-- Type pairs where the info is central to entity0, but many-valued to entity1
-- e.g. recording-work (performance, medley, etc.)
UPDATE link_type SET entity0_cardinality = 0, entity1_cardinality = 1
WHERE (entity_type0 = 'artist' AND entity_type1 = 'label')
OR (entity_type0 = 'recording' AND entity_type1 IN ('release', 'work'));
-- Type pairs where the info is central to both entities. Default.
UPDATE link_type SET entity0_cardinality = 0, entity1_cardinality = 0 WHERE entity0_cardinality IS NULL AND entity1_cardinality IS NULL;
ALTER TABLE link_type ALTER COLUMN entity0_cardinality SET NOT NULL,
ALTER COLUMN entity0_cardinality SET DEFAULT 0,
ALTER COLUMN entity1_cardinality SET NOT NULL,
ALTER COLUMN entity1_cardinality SET DEFAULT 0;
--------------------------------------------------------------------------------
SELECT '20140311-remove-area-sortnames.sql';
ALTER TABLE area DROP COLUMN sort_name;
--------------------------------------------------------------------------------
SELECT '20140313-remove-label-sortnames.sql';
SELECT setval('label_alias_id_seq', (SELECT MAX(id) FROM label_alias));
-- Migrate existing sortnames
-- If the name contains non-Latin scripts, we currently have a weird mixture of non-Latin name and Latin sortname.
-- The guidelines for alias sortnames say not to do that, so for those we'll reuse the sortname as the alias name.
INSERT INTO label_alias (label, name, sort_name)
SELECT l.id, l.sort_name, l.sort_name
FROM label l
WHERE l.name != l.sort_name
AND l.name ~ '[\u0370-\u1DFF\u2E80-\u9FFF\uAC00-\uD7FF]'
AND l.sort_name NOT IN (SELECT sort_name FROM label_alias WHERE label = l.id) -- If there's already an alias with this sortname, we're not losing anything by dropping it
ORDER BY l.name;
-- If the name doesn't contain non-Latin scripts, we can just create an alias with the current name and sortname.
INSERT INTO label_alias (label, name, sort_name)
SELECT l.id, l.name, l.sort_name
FROM label l
WHERE l.name != l.sort_name
AND l.name !~ '[\u0370-\u1DFF\u2E80-\u9FFF\uAC00-\uD7FF]'
AND l.id NOT IN (SELECT label FROM label_alias WHERE name = l.name AND sort_name = l.sort_name)
ORDER BY l.name;
-- Drop the column
ALTER TABLE label DROP COLUMN sort_name;
--------------------------------------------------------------------------------
SELECT '20140214-add-instruments.sql';
CREATE TABLE instrument_type (
id SERIAL, -- PK
name VARCHAR(255) NOT NULL,
parent INTEGER, -- references instrument_type.id
child_order INTEGER NOT NULL DEFAULT 0,
description TEXT
);
CREATE TABLE instrument (
id SERIAL, -- PK
gid uuid NOT NULL,
name VARCHAR NOT NULL,
type INTEGER, -- references instrument_type.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >=0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
comment VARCHAR(255) NOT NULL DEFAULT '',
description TEXT NOT NULL DEFAULT ''
);
CREATE TABLE instrument_gid_redirect
(
gid UUID NOT NULL, -- PK
new_id INTEGER NOT NULL, -- references instrument.id
created TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
CREATE TABLE instrument_alias_type (
id SERIAL, -- PK,
name TEXT NOT NULL,
parent INTEGER, -- references instrument_alias_type.id
child_order INTEGER NOT NULL DEFAULT 0,
description TEXT
);
CREATE TABLE instrument_alias (
id SERIAL, --PK
instrument INTEGER NOT NULL, -- references instrument.id
name VARCHAR NOT NULL,
locale TEXT,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >=0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
type INTEGER, -- references instrument_alias_type.id
sort_name VARCHAR NOT NULL,
begin_date_year SMALLINT,
begin_date_month SMALLINT,
begin_date_day SMALLINT,
end_date_year SMALLINT,
end_date_month SMALLINT,
end_date_day SMALLINT,
primary_for_locale BOOLEAN NOT NULL DEFAULT false,
ended BOOLEAN NOT NULL DEFAULT FALSE
CHECK (
(
-- If any end date fields are not null, then ended must be true
(end_date_year IS NOT NULL OR
end_date_month IS NOT NULL OR
end_date_day IS NOT NULL) AND
ended = TRUE
) OR (
-- Otherwise, all end date fields must be null
(end_date_year IS NULL AND
end_date_month IS NULL AND
end_date_day IS NULL)
)
),
CONSTRAINT primary_check CHECK ((locale IS NULL AND primary_for_locale IS FALSE) OR (locale IS NOT NULL)),
CONSTRAINT search_hints_are_empty
CHECK (
(type <> 2) OR (
type = 2 AND sort_name = name AND
begin_date_year IS NULL AND begin_date_month IS NULL AND begin_date_day IS NULL AND
end_date_year IS NULL AND end_date_month IS NULL AND end_date_day IS NULL AND
primary_for_locale IS FALSE AND locale IS NULL
)
)
);
CREATE TABLE instrument_annotation (
instrument INTEGER NOT NULL, -- PK, references instrument.id
annotation INTEGER NOT NULL -- PK, references annotation.id
);
CREATE TABLE edit_instrument
(
edit INTEGER NOT NULL, -- PK, references edit.id
instrument INTEGER NOT NULL -- PK, references instrument.id CASCADE
);
CREATE TABLE l_area_instrument
(
id SERIAL,
link INTEGER NOT NULL, -- references link.id
entity0 INTEGER NOT NULL, -- references area.id
entity1 INTEGER NOT NULL, -- references instrument.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_artist_instrument
(
id SERIAL,
link INTEGER NOT NULL, -- references link.id
entity0 INTEGER NOT NULL, -- references artist.id
entity1 INTEGER NOT NULL, -- references instrument.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_instrument_label
(
id SERIAL,
link INTEGER NOT NULL, -- references link.id
entity0 INTEGER NOT NULL, -- references instrument.id
entity1 INTEGER NOT NULL, -- references label.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_instrument_instrument
(
id SERIAL,
link INTEGER NOT NULL, -- references link.id
entity0 INTEGER NOT NULL, -- references instrument.id
entity1 INTEGER NOT NULL, -- references instrument.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_instrument_place
(
id SERIAL,
link INTEGER NOT NULL, -- references link.id
entity0 INTEGER NOT NULL, -- references instrument.id
entity1 INTEGER NOT NULL, -- references recording.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_instrument_recording
(
id SERIAL,
link INTEGER NOT NULL, -- references link.id
entity0 INTEGER NOT NULL, -- references instrument.id
entity1 INTEGER NOT NULL, -- references recording.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_instrument_release
(
id SERIAL,
link INTEGER NOT NULL, -- references link.id
entity0 INTEGER NOT NULL, -- references instrument.id
entity1 INTEGER NOT NULL, -- references release.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_instrument_release_group
(
id SERIAL,
link INTEGER NOT NULL, -- references link.id
entity0 INTEGER NOT NULL, -- references instrument.id
entity1 INTEGER NOT NULL, -- references release_group.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_instrument_url
(
id SERIAL,
link INTEGER NOT NULL, -- references link.id
entity0 INTEGER NOT NULL, -- references instrument.id
entity1 INTEGER NOT NULL, -- references url.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_instrument_work
(
id SERIAL,
link INTEGER NOT NULL, -- references link.id
entity0 INTEGER NOT NULL, -- references instrument.id
entity1 INTEGER NOT NULL, -- references work.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
SELECT setval('link_id_seq', (SELECT MAX(id) FROM link));
SELECT setval('link_type_id_seq', (SELECT MAX(id) FROM link_type));
SELECT setval('url_id_seq', (SELECT MAX(id) FROM url));
INSERT INTO instrument_type (name) VALUES ('Wind instrument'), ('String instrument'), ('Percussion instrument'), ('Electronic instrument'), ('Other instrument');
INSERT INTO instrument_alias_type (name) VALUES ('Instrument name'), ('Search hint');
INSERT INTO instrument (gid, name, description) SELECT gid, name, COALESCE(description, '') FROM link_attribute_type WHERE parent IS NOT NULL AND root = 14 ORDER BY id;
INSERT INTO link_type (gid, entity_type0, entity_type1, name, description, link_phrase, reverse_link_phrase, long_link_phrase, priority) VALUES
(generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', 'http://musicbrainz.org/linktype/instrument/url/wikipedia'), 'instrument', 'url', 'wikipedia', 'wikipedia', 'Wikipedia', 'Wikipedia', 'Wikipedia', 0),
(generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', 'http://musicbrainz.org/linktype/instrument/url/image'), 'instrument', 'url', 'image', 'image', 'image', 'image', 'image', 0),
(generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', 'http://musicbrainz.org/linktype/instrument/url/wikidata'), 'instrument', 'url', 'wikidata', 'wikidata', 'Wikidata', 'Wikidata', 'Wikidata', 0),
(generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', 'http://musicbrainz.org/linktype/instrument/url/information page'), 'instrument', 'url', 'information page', 'information page', 'information page', 'information page', 'information page', 0),
(generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', 'http://musicbrainz.org/linktype/instrument/instrument/child'), 'instrument', 'instrument', 'child', '', 'child of', 'children', 'is a child of', 0),
(generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', 'http://musicbrainz.org/linktype/instrument/instrument/type of'), 'instrument', 'instrument', 'type of', 'type of', 'type of', 'subtypes', 'is a type of', 0),
(generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', 'http://musicbrainz.org/linktype/instrument/instrument/derived from'), 'instrument', 'instrument', 'derived from', 'derived from', 'derived from', 'derivations', 'is derived from', 0),
(generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', 'http://musicbrainz.org/linktype/instrument/instrument/related to'), 'instrument', 'instrument', 'related to', 'related to', 'related to', 'related instruments', 'is related to', 0),
(generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', 'http://musicbrainz.org/linktype/instrument/instrument/parts'), 'instrument', 'instrument', 'parts', 'parts', 'consists of', 'part of', 'has parts', 0);
INSERT INTO link (link_type) SELECT id FROM link_type WHERE entity_type0 = 'instrument' ORDER BY id;
-- Remove descriptions which are just the same as the name
UPDATE instrument SET description = '' WHERE description = name;
UPDATE link_attribute_type SET description = '' WHERE description = name AND root = 14;
-- Migrate URLs from instrument descriptions to URL relationships
-- 1. Insert the URLs into the url table
WITH urls AS (
SELECT DISTINCT regexp_replace(description, '.*\(<a href="(https?://[a-z]+.wikipedia.org/wiki/[^#"]+)">Wikipedia</a>\)$', E'\\1') as url
FROM link_attribute_type
WHERE root = 14
AND description ~ '.*\(<a href="(https?://[a-z]+.wikipedia.org/wiki/[^#"]+)">Wikipedia</a>\)$'
)
INSERT INTO url (gid, url)
SELECT generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', url), url
FROM urls
WHERE url NOT IN (SELECT url FROM url WHERE url = urls.url)
ORDER BY url;
-- 2. Insert relationships into l_instrument_url
INSERT INTO l_instrument_url (link, entity0, entity1)
SELECT link.id, i.id, url.id
FROM (
SELECT l.id
FROM link_type lt
JOIN link l ON l.link_type = lt.id
WHERE lt.name = 'wikipedia'
AND lt.entity_type0 = 'instrument'
) AS link, instrument i
JOIN url ON regexp_replace(description, '.*\(<a href="(https?://[a-z]+.wikipedia.org/wiki/[^#"]+)">Wikipedia</a>\)$', E'\\1') = url
WHERE i.description ~ '.*\(<a href="(https?://[a-z]+.wikipedia.org/wiki/[^#"]+)">Wikipedia</a>\)$'
ORDER BY link.id, i.id, url.id;
-- 3. Remove the URLs from the instrument descriptions
UPDATE instrument
SET description = regexp_replace(description, ' *\(<a href="(https?://[a-z]+.wikipedia.org/wiki/[^#"]+)">Wikipedia</a>\)$', '')
WHERE description ~ '.*\(<a href="(https?://[a-z]+.wikipedia.org/wiki/[^#"]+)">Wikipedia</a>\)$';
UPDATE link_attribute_type
SET description = regexp_replace(description, ' *\(<a href="(https?://[a-z]+.wikipedia.org/wiki/[^#"]+)">Wikipedia</a>\)$', '')
WHERE description ~ '.*\(<a href="(https?://[a-z]+.wikipedia.org/wiki/[^#"]+)">Wikipedia</a>\)$'
AND root = 14;
-- Migrate aliases from instrument descriptions to instrument aliases
-- 1. Insert the aliases into instrument_alias
WITH rows AS (
SELECT id, unnest(regexp_split_to_array(regexp_replace(description, '.*Other names(?: include)?:? (.*?)\.? *$', E'\\1'), ', +| +and +')) AS name
FROM instrument
WHERE description ~ 'Other name'
)
INSERT INTO instrument_alias (instrument, name, sort_name) SELECT id, name, name FROM rows ORDER BY id, name;
-- 2. Remove the aliases from the instrument descriptions
UPDATE instrument
SET description = regexp_replace(description, ' ?Other names(?: include)?:? (.*?)\.? *$', '')
WHERE description ~ '.*Other names(?: include)?:? (.*?)\.? *$';
UPDATE link_attribute_type
SET description = regexp_replace(description, ' ?Other names(?: include)?:? (.*?)\.? *$', '')
WHERE description ~ '.*Other names(?: include)?:? (.*?)\.? *$'
AND root = 14;
-- Turn instrument tree into relationships
INSERT INTO l_instrument_instrument (link, entity0, entity1)
SELECT link.id, i_parent.id, i_child.id
FROM (
SELECT l.id
FROM link_type lt
JOIN link l ON l.link_type = lt.id
WHERE lt.name = 'child'
AND lt.entity_type0 = 'instrument'
) AS link,
link_attribute_type a_child
JOIN link_attribute_type a_parent ON a_parent.id = a_child.parent
JOIN instrument i_parent ON i_parent.gid = a_parent.gid
JOIN instrument i_child ON i_child.gid = a_child.gid
WHERE a_child.root = 14
AND a_child.parent != 14
ORDER BY link.id, i_parent.id, i_child.id;
-- Flatten the instrument tree
UPDATE link_attribute_type SET child_order = 0, parent = 14 WHERE root = 14 AND id != 14;
SELECT setval('instrument_type_id_seq', (SELECT MAX(id) FROM instrument_type));
SELECT setval('instrument_id_seq', (SELECT MAX(id) FROM instrument));
SELECT setval('instrument_alias_type_id_seq', (SELECT MAX(id) FROM instrument_alias_type));
SELECT setval('instrument_alias_id_seq', (SELECT MAX(id) FROM instrument_alias));
SELECT setval('l_instrument_instrument_id_seq', (SELECT MAX(id) FROM l_instrument_instrument));
SELECT setval('l_instrument_url_id_seq', (SELECT MAX(id) FROM l_instrument_url));
SELECT setval('link_id_seq', (SELECT MAX(id) FROM link));
SELECT setval('link_type_id_seq', (SELECT MAX(id) FROM link_type));
SELECT setval('url_id_seq', (SELECT MAX(id) FROM url));
ALTER TABLE edit_instrument ADD CONSTRAINT edit_instrument_pkey PRIMARY KEY (edit, instrument);
ALTER TABLE instrument ADD CONSTRAINT instrument_pkey PRIMARY KEY (id);
ALTER TABLE instrument_alias ADD CONSTRAINT instrument_alias_pkey PRIMARY KEY (id);
ALTER TABLE instrument_alias_type ADD CONSTRAINT instrument_alias_type_pkey PRIMARY KEY (id);
ALTER TABLE instrument_annotation ADD CONSTRAINT instrument_annotation_pkey PRIMARY KEY (instrument, annotation);
ALTER TABLE instrument_gid_redirect ADD CONSTRAINT instrument_gid_redirect_pkey PRIMARY KEY (gid);
ALTER TABLE instrument_type ADD CONSTRAINT instrument_type_pkey PRIMARY KEY (id);
ALTER TABLE l_area_instrument ADD CONSTRAINT l_area_instrument_pkey PRIMARY KEY (id);
ALTER TABLE l_artist_instrument ADD CONSTRAINT l_artist_instrument_pkey PRIMARY KEY (id);
ALTER TABLE l_instrument_instrument ADD CONSTRAINT l_instrument_instrument_pkey PRIMARY KEY (id);
ALTER TABLE l_instrument_label ADD CONSTRAINT l_instrument_label_pkey PRIMARY KEY (id);
ALTER TABLE l_instrument_place ADD CONSTRAINT l_instrument_place_pkey PRIMARY KEY (id);
ALTER TABLE l_instrument_recording ADD CONSTRAINT l_instrument_recording_pkey PRIMARY KEY (id);
ALTER TABLE l_instrument_release ADD CONSTRAINT l_instrument_release_pkey PRIMARY KEY (id);
ALTER TABLE l_instrument_release_group ADD CONSTRAINT l_instrument_release_group_pkey PRIMARY KEY (id);
ALTER TABLE l_instrument_url ADD CONSTRAINT l_instrument_url_pkey PRIMARY KEY (id);
ALTER TABLE l_instrument_work ADD CONSTRAINT l_instrument_work_pkey PRIMARY KEY (id);
CREATE INDEX edit_instrument_idx ON edit_label (label);
CREATE UNIQUE INDEX instrument_idx_gid ON instrument (gid);
CREATE INDEX instrument_idx_name ON instrument (name);
CREATE INDEX instrument_alias_idx_instrument ON instrument_alias (instrument);
CREATE UNIQUE INDEX instrument_alias_idx_primary ON instrument_alias (instrument, locale) WHERE primary_for_locale = TRUE AND locale IS NOT NULL;
CREATE UNIQUE INDEX l_area_instrument_idx_uniq ON l_area_label (entity0, entity1, link);
CREATE UNIQUE INDEX l_artist_instrument_idx_uniq ON l_artist_label (entity0, entity1, link);
CREATE UNIQUE INDEX l_instrument_instrument_idx_uniq ON l_instrument_instrument (entity0, entity1, link);
CREATE UNIQUE INDEX l_instrument_label_idx_uniq ON l_instrument_label (entity0, entity1, link);
CREATE UNIQUE INDEX l_instrument_place_idx_uniq ON l_instrument_place (entity0, entity1, link);
CREATE UNIQUE INDEX l_instrument_recording_idx_uniq ON l_instrument_recording (entity0, entity1, link);
CREATE UNIQUE INDEX l_instrument_release_idx_uniq ON l_instrument_release (entity0, entity1, link);
CREATE UNIQUE INDEX l_instrument_release_group_idx_uniq ON l_instrument_release_group (entity0, entity1, link);
CREATE UNIQUE INDEX l_instrument_url_idx_uniq ON l_instrument_url (entity0, entity1, link);
CREATE UNIQUE INDEX l_instrument_work_idx_uniq ON l_instrument_work (entity0, entity1, link);
CREATE INDEX l_area_instrument_idx_entity1 ON l_area_label (entity1);
CREATE INDEX l_artist_instrument_idx_entity1 ON l_artist_label (entity1);
CREATE INDEX l_instrument_instrument_idx_entity1 ON l_instrument_instrument (entity1);
CREATE INDEX l_instrument_label_idx_entity1 ON l_instrument_label (entity1);
CREATE INDEX l_instrument_place_idx_entity1 ON l_instrument_place (entity1);
CREATE INDEX l_instrument_recording_idx_entity1 ON l_instrument_recording (entity1);
CREATE INDEX l_instrument_release_idx_entity1 ON l_instrument_release (entity1);
CREATE INDEX l_instrument_release_group_idx_entity1 ON l_instrument_release_group (entity1);
CREATE INDEX l_instrument_url_idx_entity1 ON l_instrument_url (entity1);
CREATE INDEX l_instrument_work_idx_entity1 ON l_instrument_work (entity1);
CREATE INDEX instrument_idx_txt ON instrument USING gin(to_tsvector('mb_simple', name));
--------------------------------------------------------------------------------
SELECT '20140215-add-instruments-documentation.sql';
CREATE TABLE documentation.l_area_instrument_example (
id INTEGER NOT NULL, -- PK, references musicbrainz.l_area_instrument.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_artist_instrument_example (
id INTEGER NOT NULL, -- PK, references musicbrainz.l_artist_instrument.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_instrument_instrument_example (
id INTEGER NOT NULL, -- PK, references musicbrainz.l_instrument_instrument.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_instrument_label_example (
id INTEGER NOT NULL, -- PK, references musicbrainz.l_instrument_label.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_instrument_place_example (
id INTEGER NOT NULL, -- PK, references musicbrainz.l_instrument_place.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_instrument_recording_example (
id INTEGER NOT NULL, -- PK, references musicbrainz.l_instrument_recording.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_instrument_release_example (
id INTEGER NOT NULL, -- PK, references musicbrainz.l_instrument_release.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_instrument_release_group_example (
id INTEGER NOT NULL, -- PK, references musicbrainz.l_instrument_release_group.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_instrument_url_example (
id INTEGER NOT NULL, -- PK, references musicbrainz.l_instrument_url.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_instrument_work_example (
id INTEGER NOT NULL, -- PK, references musicbrainz.l_instrument_work.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
ALTER TABLE documentation.l_area_instrument_example ADD CONSTRAINT l_area_instrument_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_artist_instrument_example ADD CONSTRAINT l_artist_instrument_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_instrument_instrument_example ADD CONSTRAINT l_instrument_instrument_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_instrument_label_example ADD CONSTRAINT l_instrument_label_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_instrument_place_example ADD CONSTRAINT l_instrument_place_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_instrument_recording_example ADD CONSTRAINT l_instrument_recording_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_instrument_release_example ADD CONSTRAINT l_instrument_release_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_instrument_release_group_example ADD CONSTRAINT l_instrument_release_group_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_instrument_url_example ADD CONSTRAINT l_instrument_url_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_instrument_work_example ADD CONSTRAINT l_instrument_work_example_pkey PRIMARY KEY (id);
--------------------------------------------------------------------------------
SELECT '20140318-series.sql';
-----------------------
-- CREATE NEW TABLES --
-----------------------
CREATE TABLE series
(
id SERIAL,
gid UUID NOT NULL,
name VARCHAR NOT NULL,
comment VARCHAR(255) NOT NULL DEFAULT '',
type INTEGER NOT NULL, -- references series_type.id
ordering_attribute INTEGER NOT NULL, -- references link_text_attribute_type.attribute_type
ordering_type INTEGER NOT NULL, -- references series_ordering_type.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
CREATE TABLE series_type
(
id SERIAL,
name VARCHAR(255) NOT NULL,
entity_type VARCHAR(50) NOT NULL,
parent INTEGER, -- references series_type.id
child_order INTEGER NOT NULL DEFAULT 0,
description TEXT
);
CREATE TABLE series_ordering_type
(
id SERIAL,
name VARCHAR(255) NOT NULL,
parent INTEGER, -- references series_ordering_type.id
child_order INTEGER NOT NULL DEFAULT 0,
description TEXT
);
CREATE TABLE series_deletion
(
gid UUID NOT NULL, -- PK
last_known_name VARCHAR NOT NULL,
last_known_comment TEXT NOT NULL,
deleted_at timestamptz NOT NULL DEFAULT now()
);
CREATE TABLE series_gid_redirect
(
gid UUID NOT NULL, -- PK
new_id INTEGER NOT NULL,
created TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
CREATE TABLE series_alias_type
(
id SERIAL, -- PK
name TEXT NOT NULL,
parent INTEGER, -- references series_alias_type.id
child_order INTEGER NOT NULL DEFAULT 0,
description TEXT
);
CREATE TABLE series_alias
(
id SERIAL,
series INTEGER NOT NULL, -- references series.id
name VARCHAR NOT NULL,
locale TEXT,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
type INTEGER, -- references series_alias_type.id
sort_name VARCHAR NOT NULL,
begin_date_year SMALLINT,
begin_date_month SMALLINT,
begin_date_day SMALLINT,
end_date_year SMALLINT,
end_date_month SMALLINT,
end_date_day SMALLINT,
primary_for_locale BOOLEAN NOT NULL DEFAULT FALSE,
ended BOOLEAN NOT NULL DEFAULT FALSE
CHECK (
(
-- If any end date fields are not null, then ended must be true
(end_date_year IS NOT NULL OR
end_date_month IS NOT NULL OR
end_date_day IS NOT NULL) AND
ended = TRUE
) OR (
-- Otherwise, all end date fields must be null
(end_date_year IS NULL AND
end_date_month IS NULL AND
end_date_day IS NULL)
)
),
CONSTRAINT primary_check CHECK ((locale IS NULL AND primary_for_locale IS FALSE) OR (locale IS NOT NULL)),
CONSTRAINT search_hints_are_empty
CHECK (
(type <> 2) OR (
type = 2 AND sort_name = name AND
begin_date_year IS NULL AND begin_date_month IS NULL AND begin_date_day IS NULL AND
end_date_year IS NULL AND end_date_month IS NULL AND end_date_day IS NULL AND
primary_for_locale IS FALSE AND locale IS NULL
)
)
);
CREATE TABLE series_annotation (
series INTEGER NOT NULL, -- PK, references series.id
annotation INTEGER NOT NULL -- PK, references annotation.id
);
CREATE TABLE documentation.l_area_series_example
(
id INTEGER NOT NULL, -- PK, references musicbrainz.l_area_series.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_artist_series_example
(
id INTEGER NOT NULL, -- PK, references musicbrainz.l_artist_series.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_instrument_series_example
(
id INTEGER NOT NULL, -- PK, references musicbrainz.l_instrument_series.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_label_series_example
(
id INTEGER NOT NULL, -- PK, references musicbrainz.l_label_series.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_place_series_example
(
id INTEGER NOT NULL, -- PK, references musicbrainz.l_place_series.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_recording_series_example
(
id INTEGER NOT NULL, -- PK, references musicbrainz.l_recording_series.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_release_series_example
(
id INTEGER NOT NULL, -- PK, references musicbrainz.l_release_series.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_release_group_series_example
(
id INTEGER NOT NULL, -- PK, references musicbrainz.l_release_group_series.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_series_series_example
(
id INTEGER NOT NULL, -- PK, references musicbrainz.l_series_series.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_series_url_example
(
id INTEGER NOT NULL, -- PK, references musicbrainz.l_series_url.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE documentation.l_series_work_example
(
id INTEGER NOT NULL, -- PK, references musicbrainz.l_series_work.id
published BOOLEAN NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE edit_series
(
edit INTEGER NOT NULL, -- PK, references edit.id
series INTEGER NOT NULL -- PK, references series.id CASCADE
);
CREATE TABLE editor_subscribe_series
(
id SERIAL,
editor INTEGER NOT NULL, -- references editor.id
series INTEGER NOT NULL, -- references series.id
last_edit_sent INTEGER NOT NULL -- references edit.id
);
CREATE TABLE editor_subscribe_series_deleted
(
editor INTEGER NOT NULL, -- PK, references editor.id
gid UUID NOT NULL, -- PK, references series_deletion.gid
deleted_by INTEGER NOT NULL -- references edit.id
);
CREATE TABLE l_area_series
(
id SERIAL,
link INTEGER NOT NULL,
entity0 INTEGER NOT NULL,
entity1 INTEGER NOT NULL,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_artist_series
(
id SERIAL,
link INTEGER NOT NULL,
entity0 INTEGER NOT NULL,
entity1 INTEGER NOT NULL,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_instrument_series
(
id SERIAL,
link INTEGER NOT NULL,
entity0 INTEGER NOT NULL,
entity1 INTEGER NOT NULL,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_label_series
(
id SERIAL,
link INTEGER NOT NULL,
entity0 INTEGER NOT NULL,
entity1 INTEGER NOT NULL,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_place_series
(
id SERIAL,
link INTEGER NOT NULL,
entity0 INTEGER NOT NULL,
entity1 INTEGER NOT NULL,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_recording_series
(
id SERIAL,
link INTEGER NOT NULL,
entity0 INTEGER NOT NULL,
entity1 INTEGER NOT NULL,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_release_series
(
id SERIAL,
link INTEGER NOT NULL,
entity0 INTEGER NOT NULL,
entity1 INTEGER NOT NULL,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_release_group_series
(
id SERIAL,
link INTEGER NOT NULL,
entity0 INTEGER NOT NULL,
entity1 INTEGER NOT NULL,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_series_series
(
id SERIAL,
link INTEGER NOT NULL,
entity0 INTEGER NOT NULL,
entity1 INTEGER NOT NULL,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_series_url
(
id SERIAL,
link INTEGER NOT NULL,
entity0 INTEGER NOT NULL,
entity1 INTEGER NOT NULL,
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE l_series_work
(
id SERIAL,
link INTEGER NOT NULL, -- references link.id
entity0 INTEGER NOT NULL, -- references series.id
entity1 INTEGER NOT NULL, -- references work.id
edits_pending INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
last_updated TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0)
);
CREATE TABLE link_text_attribute_type (
attribute_type INT NOT NULL -- PK, references link_attribute_type.id CASCADE
);
CREATE TABLE link_attribute_text_value (
link INT NOT NULL, -- PK, references link.id
attribute_type INT NOT NULL, -- PK, references link_text_attribute_type.attribute_type
text_value TEXT NOT NULL
);
CREATE TABLE orderable_link_type (
link_type INTEGER NOT NULL, -- PK
direction SMALLINT NOT NULL DEFAULT 1 CHECK (direction = 1 OR direction = 2)
);
-----------------------
-- CREATE NEW VIEWS --
-----------------------
CREATE OR REPLACE VIEW recording_series AS
SELECT entity0 AS recording,
entity1 AS series,
lrs.id AS relationship,
link_order,
lrs.link,
COALESCE(text_value, '') AS text_value
FROM l_recording_series lrs
JOIN series s ON s.id = lrs.entity1
JOIN link l ON l.id = lrs.link
JOIN link_type lt ON (lt.id = l.link_type AND lt.gid = 'ea6f0698-6782-30d6-b16d-293081b66774')
LEFT OUTER JOIN link_attribute_text_value latv ON (latv.attribute_type = s.ordering_attribute AND latv.link = l.id)
ORDER BY series, link_order;
CREATE OR REPLACE VIEW release_series AS
SELECT entity0 AS release,
entity1 AS series,
lrs.id AS relationship,
link_order,
lrs.link,
COALESCE(text_value, '') AS text_value
FROM l_release_series lrs
JOIN series s ON s.id = lrs.entity1
JOIN link l ON l.id = lrs.link
JOIN link_type lt ON (lt.id = l.link_type AND lt.gid = '3fa29f01-8e13-3e49-9b0a-ad212aa2f81d')
LEFT OUTER JOIN link_attribute_text_value latv ON (latv.attribute_type = s.ordering_attribute AND latv.link = l.id)
ORDER BY series, link_order;
CREATE OR REPLACE VIEW release_group_series AS
SELECT entity0 AS release_group,
entity1 AS series,
lrgs.id AS relationship,
link_order,
lrgs.link,
COALESCE(text_value, '') AS text_value
FROM l_release_group_series lrgs
JOIN series s ON s.id = lrgs.entity1
JOIN link l ON l.id = lrgs.link
JOIN link_type lt ON (lt.id = l.link_type AND lt.gid = '01018437-91d8-36b9-bf89-3f885d53b5bd')
LEFT OUTER JOIN link_attribute_text_value latv ON (latv.attribute_type = s.ordering_attribute AND latv.link = l.id)
ORDER BY series, link_order;
CREATE OR REPLACE VIEW work_series AS
SELECT entity1 AS work,
entity0 AS series,
lsw.id AS relationship,
link_order,
lsw.link,
COALESCE(text_value, '') AS text_value
FROM l_series_work lsw
JOIN series s ON s.id = lsw.entity0
JOIN link l ON l.id = lsw.link
JOIN link_type lt ON (lt.id = l.link_type AND lt.gid = 'b0d44366-cdf0-3acb-bee6-0f65a77a6ef0')
LEFT OUTER JOIN link_attribute_text_value latv ON (latv.attribute_type = s.ordering_attribute AND latv.link = l.id)
ORDER BY series, link_order;
-------------------------
-- INSERT INITIAL DATA --
-------------------------
-- new relationship types
SELECT setval('link_type_id_seq', (SELECT MAX(id) FROM link_type));
SELECT setval('link_attribute_type_id_seq', (SELECT MAX(id) FROM link_attribute_type));
\set RECORDING_PART_OF_SERIES_GID 'generate_uuid_v3(''6ba7b8119dad11d180b400c04fd430c8'', ''http://musicbrainz.org/linktype/recording/series/part_of'')'
\set RELEASE_PART_OF_SERIES_GID 'generate_uuid_v3(''6ba7b8119dad11d180b400c04fd430c8'', ''http://musicbrainz.org/linktype/release/series/part_of'')'
\set RELEASE_GROUP_PART_OF_SERIES_GID 'generate_uuid_v3(''6ba7b8119dad11d180b400c04fd430c8'', ''http://musicbrainz.org/linktype/release_group/series/part_of'')'
\set WORK_PART_OF_SERIES_GID 'generate_uuid_v3(''6ba7b8119dad11d180b400c04fd430c8'', ''http://musicbrainz.org/linktype/series/work/part_of'')'
\set SERIES_WIKIPEDIA_URL_GID 'generate_uuid_v3(''6ba7b8119dad11d180b400c04fd430c8'', ''http://musicbrainz.org/linktype/series/url/wikipedia'')'
\set ORDERING_ATTRIBUTE_GID 'generate_uuid_v3(''6ba7b8119dad11d180b400c04fd430c8'', ''http://musicbrainz.org/linkattributetype/ordering'')'
INSERT INTO link_type (gid, entity_type0, entity_type1, entity0_cardinality,
entity1_cardinality, name, description, link_phrase,
reverse_link_phrase, long_link_phrase) VALUES
(
:RECORDING_PART_OF_SERIES_GID,
'recording', 'series', 0, 0, 'part of',
'Indicates that the recording is part of a series.',
'part of', 'has parts', 'is a part of'
),
(
:RELEASE_PART_OF_SERIES_GID,
'release', 'series', 0, 0, 'part of',
'Indicates that the release is part of a series.',
'part of', 'has parts', 'is a part of'
),
(
:RELEASE_GROUP_PART_OF_SERIES_GID,
'release_group', 'series', 0, 0, 'part of',
'Indicates that the release group is part of a series.',
'part of', 'has parts', 'is a part of'
),
(
:WORK_PART_OF_SERIES_GID,
'series', 'work', 0, 0, 'part of',
'Indicates that the work is part of a series.',
'has parts', 'part of', 'has part'
),
(
:SERIES_WIKIPEDIA_URL_GID,
'series', 'url', 0, 0, 'wikipedia',
'Points to the Wikipedia page for this series.',
'Wikipedia', 'Wikipedia page for', 'has a Wikipedia page at'
)
RETURNING id, gid, entity_type0, entity_type1, name, long_link_phrase;
INSERT INTO orderable_link_type (link_type, direction) VALUES
((SELECT id FROM link_type WHERE gid = :RECORDING_PART_OF_SERIES_GID), 2),
((SELECT id FROM link_type WHERE gid = :RELEASE_PART_OF_SERIES_GID), 2),
((SELECT id FROM link_type WHERE gid = :RELEASE_GROUP_PART_OF_SERIES_GID), 2),
((SELECT id FROM link_type WHERE gid = :WORK_PART_OF_SERIES_GID), 1);
INSERT INTO series_type (name, entity_type, parent, child_order, description) VALUES
('Release group', 'release_group', NULL, 0, 'Indicates that the series is of release groups.'),
('Release', 'release', NULL, 1, 'Indicates that the series is of releases.'),
('Recording', 'recording', NULL, 2, 'Indicates that the series is of recordings.'),
('Work', 'work', NULL, 3, 'Indicates that the series is of works.'),
('Catalog', 'work', 4, 0, 'Indicates that the series is a works catalog.');
INSERT INTO series_ordering_type (name, parent, child_order, description) VALUES
('Automatic', NULL, 0,
'Sorts the items in the series automatically by their number attributes, using a natural sort order.'
),
('Manual', NULL, 1,
'Allows for manually setting the position of each item in the series.'
);
INSERT INTO series_alias_type (name) VALUES ('Series name'), ('Search hint');
INSERT INTO link_attribute_type (root, child_order, gid, name, description) VALUES
(1, 0, :ORDERING_ATTRIBUTE_GID, 'number',
'This attribute indicates the number of a work in a series.'
);
UPDATE link_attribute_type SET root = id WHERE gid = :ORDERING_ATTRIBUTE_GID;
INSERT INTO link_text_attribute_type (
SELECT id FROM link_attribute_type WHERE gid = :ORDERING_ATTRIBUTE_GID
);
INSERT INTO link_type_attribute_type (link_type, attribute_type, min, max) VALUES
((SELECT id FROM link_type WHERE gid = :RECORDING_PART_OF_SERIES_GID),
(SELECT id FROM link_attribute_type WHERE gid = :ORDERING_ATTRIBUTE_GID),
0, 1
),
((SELECT id FROM link_type WHERE gid = :RELEASE_PART_OF_SERIES_GID),
(SELECT id FROM link_attribute_type WHERE gid = :ORDERING_ATTRIBUTE_GID),
0, 1
),
((SELECT id FROM link_type WHERE gid = :RELEASE_GROUP_PART_OF_SERIES_GID),
(SELECT id FROM link_attribute_type WHERE gid = :ORDERING_ATTRIBUTE_GID),
0, 1
),
((SELECT id FROM link_type WHERE gid = :WORK_PART_OF_SERIES_GID),
(SELECT id FROM link_attribute_type WHERE gid = :ORDERING_ATTRIBUTE_GID),
0, 1
);
\unset RECORDING_PART_OF_SERIES_GID
\unset RELEASE_PART_OF_SERIES_GID
\unset RELEASE_GROUP_PART_OF_SERIES_GID
\unset WORK_PART_OF_SERIES_GID
\unset SERIES_WIKIPEDIA_URL_GID
\unset ORDERING_ATTRIBUTE_GID
-----------------------------
-- MIGRATE EXISTING TABLES --
-----------------------------
ALTER TABLE l_area_area ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_area_artist ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_area_label ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_area_place ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_area_recording ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_area_release ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_area_release_group ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_area_url ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_area_work ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_artist_artist ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_artist_label ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_artist_place ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_artist_recording ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_artist_release ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_artist_release_group ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_artist_url ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_artist_work ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_label_label ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_label_place ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_label_recording ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_label_release ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_label_release_group ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_label_url ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_label_work ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_place_place ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_place_recording ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_place_release ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_place_release_group ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_place_url ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_place_work ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_recording_recording ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_recording_release ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_recording_release_group ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_recording_url ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_recording_work ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_release_release ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_release_release_group ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_release_url ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_release_work ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_release_group_release_group ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_release_group_url ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_release_group_work ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_url_url ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_url_work ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
ALTER TABLE l_work_work ADD COLUMN link_order INTEGER NOT NULL DEFAULT 0 CHECK (link_order >= 0);
--------------------
-- CREATE INDEXES --
--------------------
ALTER TABLE documentation.l_area_series_example ADD CONSTRAINT l_area_series_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_artist_series_example ADD CONSTRAINT l_artist_series_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_instrument_series_example ADD CONSTRAINT l_instrument_series_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_label_series_example ADD CONSTRAINT l_label_series_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_place_series_example ADD CONSTRAINT l_place_series_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_recording_series_example ADD CONSTRAINT l_recording_series_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_release_group_series_example ADD CONSTRAINT l_release_group_series_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_release_series_example ADD CONSTRAINT l_release_series_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_series_series_example ADD CONSTRAINT l_series_series_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_series_url_example ADD CONSTRAINT l_series_url_example_pkey PRIMARY KEY (id);
ALTER TABLE documentation.l_series_work_example ADD CONSTRAINT l_series_work_example_pkey PRIMARY KEY (id);
ALTER TABLE editor_subscribe_series ADD CONSTRAINT editor_subscribe_series_pkey PRIMARY KEY (id);
ALTER TABLE editor_subscribe_series_deleted ADD CONSTRAINT editor_subscribe_series_deleted_pkey PRIMARY KEY (editor, gid);
ALTER TABLE l_area_series ADD CONSTRAINT l_area_series_pkey PRIMARY KEY (id);
ALTER TABLE l_artist_series ADD CONSTRAINT l_artist_series_pkey PRIMARY KEY (id);
ALTER TABLE l_instrument_series ADD CONSTRAINT l_instrument_series_pkey PRIMARY KEY (id);
ALTER TABLE l_label_series ADD CONSTRAINT l_label_series_pkey PRIMARY KEY (id);
ALTER TABLE l_place_series ADD CONSTRAINT l_place_series_pkey PRIMARY KEY (id);
ALTER TABLE l_recording_series ADD CONSTRAINT l_recording_series_pkey PRIMARY KEY (id);
ALTER TABLE l_release_group_series ADD CONSTRAINT l_release_group_series_pkey PRIMARY KEY (id);
ALTER TABLE l_release_series ADD CONSTRAINT l_release_series_pkey PRIMARY KEY (id);
ALTER TABLE l_series_series ADD CONSTRAINT l_series_series_pkey PRIMARY KEY (id);
ALTER TABLE l_series_url ADD CONSTRAINT l_series_url_pkey PRIMARY KEY (id);
ALTER TABLE l_series_work ADD CONSTRAINT l_series_work_pkey PRIMARY KEY (id);
ALTER TABLE link_attribute_text_value ADD CONSTRAINT link_attribute_text_value_pkey PRIMARY KEY (link, attribute_type);
ALTER TABLE link_text_attribute_type ADD CONSTRAINT link_text_attribute_type_pkey PRIMARY KEY (attribute_type);
ALTER TABLE edit_series ADD CONSTRAINT edit_series_pkey PRIMARY KEY (edit, series);
ALTER TABLE series ADD CONSTRAINT series_pkey PRIMARY KEY (id);
ALTER TABLE series_alias ADD CONSTRAINT series_alias_pkey PRIMARY KEY (id);
ALTER TABLE series_alias_type ADD CONSTRAINT series_alias_type_pkey PRIMARY KEY (id);
ALTER TABLE series_annotation ADD CONSTRAINT series_annotation_pkey PRIMARY KEY (series, annotation);
ALTER TABLE series_deletion ADD CONSTRAINT series_deletion_pkey PRIMARY KEY (gid);
ALTER TABLE series_gid_redirect ADD CONSTRAINT series_gid_redirect_pkey PRIMARY KEY (gid);
ALTER TABLE series_ordering_type ADD CONSTRAINT series_ordering_type_pkey PRIMARY KEY (id);
ALTER TABLE series_type ADD CONSTRAINT series_type_pkey PRIMARY KEY (id);
DROP INDEX IF EXISTS l_area_area_idx_uniq;
DROP INDEX IF EXISTS l_area_artist_idx_uniq;
DROP INDEX IF EXISTS l_area_instrument_idx_uniq;
DROP INDEX IF EXISTS l_area_label_idx_uniq;
DROP INDEX IF EXISTS l_area_place_idx_uniq;
DROP INDEX IF EXISTS l_area_recording_idx_uniq;
DROP INDEX IF EXISTS l_area_release_idx_uniq;
DROP INDEX IF EXISTS l_area_release_group_idx_uniq;
DROP INDEX IF EXISTS l_area_series_idx_uniq;
DROP INDEX IF EXISTS l_area_url_idx_uniq;
DROP INDEX IF EXISTS l_area_work_idx_uniq;
DROP INDEX IF EXISTS l_artist_artist_idx_uniq;
DROP INDEX IF EXISTS l_artist_instrument_idx_uniq;
DROP INDEX IF EXISTS l_artist_label_idx_uniq;
DROP INDEX IF EXISTS l_artist_place_idx_uniq;
DROP INDEX IF EXISTS l_artist_recording_idx_uniq;
DROP INDEX IF EXISTS l_artist_release_idx_uniq;
DROP INDEX IF EXISTS l_artist_release_group_idx_uniq;
DROP INDEX IF EXISTS l_artist_series_idx_uniq;
DROP INDEX IF EXISTS l_artist_url_idx_uniq;
DROP INDEX IF EXISTS l_artist_work_idx_uniq;
DROP INDEX IF EXISTS l_instrument_instrument_idx_uniq;
DROP INDEX IF EXISTS l_instrument_label_idx_uniq;
DROP INDEX IF EXISTS l_instrument_place_idx_uniq;
DROP INDEX IF EXISTS l_instrument_recording_idx_uniq;
DROP INDEX IF EXISTS l_instrument_release_idx_uniq;
DROP INDEX IF EXISTS l_instrument_release_group_idx_uniq;
DROP INDEX IF EXISTS l_instrument_series_idx_uniq;
DROP INDEX IF EXISTS l_instrument_url_idx_uniq;
DROP INDEX IF EXISTS l_instrument_work_idx_uniq;
DROP INDEX IF EXISTS l_label_label_idx_uniq;
DROP INDEX IF EXISTS l_label_place_idx_uniq;
DROP INDEX IF EXISTS l_label_recording_idx_uniq;
DROP INDEX IF EXISTS l_label_release_idx_uniq;
DROP INDEX IF EXISTS l_label_release_group_idx_uniq;
DROP INDEX IF EXISTS l_label_series_idx_uniq;
DROP INDEX IF EXISTS l_label_url_idx_uniq;
DROP INDEX IF EXISTS l_label_work_idx_uniq;
DROP INDEX IF EXISTS l_place_place_idx_uniq;
DROP INDEX IF EXISTS l_place_recording_idx_uniq;
DROP INDEX IF EXISTS l_place_release_idx_uniq;
DROP INDEX IF EXISTS l_place_release_group_idx_uniq;
DROP INDEX IF EXISTS l_place_series_idx_uniq;
DROP INDEX IF EXISTS l_place_url_idx_uniq;
DROP INDEX IF EXISTS l_place_work_idx_uniq;
DROP INDEX IF EXISTS l_recording_recording_idx_uniq;
DROP INDEX IF EXISTS l_recording_release_idx_uniq;
DROP INDEX IF EXISTS l_recording_release_group_idx_uniq;
DROP INDEX IF EXISTS l_recording_series_idx_uniq;
DROP INDEX IF EXISTS l_recording_url_idx_uniq;
DROP INDEX IF EXISTS l_recording_work_idx_uniq;
DROP INDEX IF EXISTS l_release_release_idx_uniq;
DROP INDEX IF EXISTS l_release_release_group_idx_uniq;
DROP INDEX IF EXISTS l_release_series_idx_uniq;
DROP INDEX IF EXISTS l_release_url_idx_uniq;
DROP INDEX IF EXISTS l_release_work_idx_uniq;
DROP INDEX IF EXISTS l_release_group_release_group_idx_uniq;
DROP INDEX IF EXISTS l_release_group_series_idx_uniq;
DROP INDEX IF EXISTS l_release_group_url_idx_uniq;
DROP INDEX IF EXISTS l_release_group_work_idx_uniq;
DROP INDEX IF EXISTS l_series_series_idx_uniq;
DROP INDEX IF EXISTS l_series_url_idx_uniq;
DROP INDEX IF EXISTS l_series_work_idx_uniq;
DROP INDEX IF EXISTS l_url_url_idx_uniq;
DROP INDEX IF EXISTS l_url_work_idx_uniq;
DROP INDEX IF EXISTS l_work_work_idx_uniq;
CREATE UNIQUE INDEX l_area_area_idx_uniq ON l_area_area (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_area_artist_idx_uniq ON l_area_artist (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_area_instrument_idx_uniq ON l_area_label (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_area_label_idx_uniq ON l_area_label (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_area_place_idx_uniq ON l_area_place (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_area_recording_idx_uniq ON l_area_recording (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_area_release_idx_uniq ON l_area_release (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_area_release_group_idx_uniq ON l_area_release_group (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_area_series_idx_uniq ON l_area_series (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_area_url_idx_uniq ON l_area_url (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_area_work_idx_uniq ON l_area_work (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_artist_artist_idx_uniq ON l_artist_artist (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_artist_instrument_idx_uniq ON l_artist_label (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_artist_label_idx_uniq ON l_artist_label (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_artist_place_idx_uniq ON l_artist_place (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_artist_recording_idx_uniq ON l_artist_recording (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_artist_release_idx_uniq ON l_artist_release (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_artist_release_group_idx_uniq ON l_artist_release_group (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_artist_series_idx_uniq ON l_artist_series (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_artist_url_idx_uniq ON l_artist_url (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_artist_work_idx_uniq ON l_artist_work (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_instrument_instrument_idx_uniq ON l_instrument_instrument (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_instrument_label_idx_uniq ON l_instrument_label (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_instrument_place_idx_uniq ON l_instrument_place (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_instrument_recording_idx_uniq ON l_instrument_recording (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_instrument_release_idx_uniq ON l_instrument_release (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_instrument_release_group_idx_uniq ON l_instrument_release_group (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_instrument_series_idx_uniq ON l_instrument_series (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_instrument_url_idx_uniq ON l_instrument_url (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_instrument_work_idx_uniq ON l_instrument_work (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_label_label_idx_uniq ON l_label_label (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_label_place_idx_uniq ON l_label_place (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_label_recording_idx_uniq ON l_label_recording (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_label_release_idx_uniq ON l_label_release (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_label_release_group_idx_uniq ON l_label_release_group (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_label_series_idx_uniq ON l_label_series (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_label_url_idx_uniq ON l_label_url (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_label_work_idx_uniq ON l_label_work (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_place_place_idx_uniq ON l_place_place (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_place_recording_idx_uniq ON l_place_recording (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_place_release_idx_uniq ON l_place_release (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_place_release_group_idx_uniq ON l_place_release_group (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_place_series_idx_uniq ON l_place_series (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_place_url_idx_uniq ON l_place_url (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_place_work_idx_uniq ON l_place_work (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_recording_recording_idx_uniq ON l_recording_recording (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_recording_release_idx_uniq ON l_recording_release (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_recording_release_group_idx_uniq ON l_recording_release_group (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_recording_series_idx_uniq ON l_recording_series (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_recording_url_idx_uniq ON l_recording_url (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_recording_work_idx_uniq ON l_recording_work (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_release_release_idx_uniq ON l_release_release (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_release_release_group_idx_uniq ON l_release_release_group (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_release_series_idx_uniq ON l_release_series (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_release_url_idx_uniq ON l_release_url (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_release_work_idx_uniq ON l_release_work (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_release_group_release_group_idx_uniq ON l_release_group_release_group (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_release_group_series_idx_uniq ON l_release_group_series (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_release_group_url_idx_uniq ON l_release_group_url (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_release_group_work_idx_uniq ON l_release_group_work (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_series_series_idx_uniq ON l_series_series (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_series_url_idx_uniq ON l_series_url (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_series_work_idx_uniq ON l_series_work (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_url_url_idx_uniq ON l_url_url (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_url_work_idx_uniq ON l_url_work (entity0, entity1, link, link_order);
CREATE UNIQUE INDEX l_work_work_idx_uniq ON l_work_work (entity0, entity1, link, link_order);
CREATE INDEX l_area_series_idx_entity1 ON l_area_series (entity1);
CREATE INDEX l_artist_series_idx_entity1 ON l_artist_series (entity1);
CREATE INDEX l_instrument_series_idx_entity1 ON l_instrument_series (entity1);
CREATE INDEX l_label_series_idx_entity1 ON l_label_series (entity1);
CREATE INDEX l_place_series_idx_entity1 ON l_place_series (entity1);
CREATE INDEX l_recording_series_idx_entity1 ON l_recording_series (entity1);
CREATE INDEX l_release_series_idx_entity1 ON l_release_series (entity1);
CREATE INDEX l_release_group_series_idx_entity1 ON l_release_group_series (entity1);
CREATE INDEX l_series_series_idx_entity1 ON l_series_series (entity1);
CREATE INDEX l_series_url_idx_entity1 ON l_series_url (entity1);
CREATE INDEX l_series_work_idx_entity1 ON l_series_work (entity1);
CREATE UNIQUE INDEX series_idx_gid ON series (gid);
CREATE INDEX series_idx_name ON series (name);
CREATE INDEX series_alias_idx_series ON series_alias (series);
CREATE UNIQUE INDEX series_alias_idx_primary ON series_alias (series, locale) WHERE primary_for_locale = TRUE AND locale IS NOT NULL;
CREATE INDEX series_idx_txt ON series USING gin(to_tsvector('mb_simple', name));
CREATE INDEX series_alias_idx_txt ON series_alias USING gin(to_tsvector('mb_simple', name));
CREATE INDEX series_alias_idx_txt_sort ON series_alias USING gin(to_tsvector('mb_simple', sort_name));
CREATE INDEX edit_series_idx ON edit_series (series);
CREATE INDEX editor_subscribe_series_idx_uniq ON editor_subscribe_series (editor, series);
CREATE INDEX editor_subscribe_series_idx_series ON editor_subscribe_series (series);
--------------------------------------------------------------------------------
SELECT '20140418-series-instrument-functions.sql';
CREATE OR REPLACE FUNCTION empty_artists() RETURNS SETOF int AS
$BODY$
SELECT id FROM artist
WHERE
id > 2 AND
edits_pending = 0 AND
(
last_updated < now() - '1 day'::interval OR last_updated is NULL
)
EXCEPT
SELECT artist FROM edit_artist WHERE edit_artist.status = 1
EXCEPT
SELECT artist FROM artist_credit_name
EXCEPT
SELECT entity1 FROM l_area_artist
EXCEPT
SELECT entity0 FROM l_artist_artist
EXCEPT
SELECT entity1 FROM l_artist_artist
EXCEPT
SELECT entity0 FROM l_artist_instrument
EXCEPT
SELECT entity0 FROM l_artist_label
EXCEPT
SELECT entity0 FROM l_artist_place
EXCEPT
SELECT entity0 FROM l_artist_recording
EXCEPT
SELECT entity0 FROM l_artist_release
EXCEPT
SELECT entity0 FROM l_artist_release_group
EXCEPT
SELECT entity0 FROM l_artist_series
EXCEPT
SELECT entity0 FROM l_artist_url
EXCEPT
SELECT entity0 FROM l_artist_work;
$BODY$
LANGUAGE 'sql';
CREATE OR REPLACE FUNCTION empty_labels() RETURNS SETOF int AS
$BODY$
SELECT id FROM label
WHERE
id > 1 AND
edits_pending = 0 AND
(
last_updated < now() - '1 day'::interval OR last_updated is NULL
)
EXCEPT
SELECT label FROM edit_label WHERE edit_label.status = 1
EXCEPT
SELECT label FROM release_label
EXCEPT
SELECT entity1 FROM l_area_label
EXCEPT
SELECT entity1 FROM l_artist_label
EXCEPT
SELECT entity1 FROM l_instrument_label
EXCEPT
SELECT entity1 FROM l_label_label
EXCEPT
SELECT entity0 FROM l_label_label
EXCEPT
SELECT entity0 FROM l_label_place
EXCEPT
SELECT entity0 FROM l_label_recording
EXCEPT
SELECT entity0 FROM l_label_release
EXCEPT
SELECT entity0 FROM l_label_release_group
EXCEPT
SELECT entity0 FROM l_label_series
EXCEPT
SELECT entity0 FROM l_label_url
EXCEPT
SELECT entity0 FROM l_label_work;
$BODY$
LANGUAGE 'sql';
CREATE OR REPLACE FUNCTION empty_release_groups() RETURNS SETOF int AS
$BODY$
SELECT id FROM release_group
WHERE
edits_pending = 0 AND
(
last_updated < now() - '1 day'::interval OR last_updated is NULL
)
EXCEPT
SELECT release_group
FROM edit_release_group
JOIN edit ON (edit.id = edit_release_group.edit)
WHERE edit.status = 1
EXCEPT
SELECT release_group FROM release
EXCEPT
SELECT entity1 FROM l_area_release_group
EXCEPT
SELECT entity1 FROM l_artist_release_group
EXCEPT
SELECT entity1 FROM l_instrument_release_group
EXCEPT
SELECT entity1 FROM l_label_release_group
EXCEPT
SELECT entity1 FROM l_place_release_group
EXCEPT
SELECT entity1 FROM l_recording_release_group
EXCEPT
SELECT entity1 FROM l_release_release_group
EXCEPT
SELECT entity1 FROM l_release_group_release_group
EXCEPT
SELECT entity0 FROM l_release_group_release_group
EXCEPT
SELECT entity0 FROM l_release_group_series
EXCEPT
SELECT entity0 FROM l_release_group_url
EXCEPT
SELECT entity0 FROM l_release_group_work;
$BODY$
LANGUAGE 'sql';
CREATE OR REPLACE FUNCTION empty_works() RETURNS SETOF int AS
$BODY$
SELECT id FROM work
WHERE
edits_pending = 0 AND
(
last_updated < now() - '1 day'::interval OR last_updated is NULL
)
EXCEPT
SELECT work
FROM edit_work
JOIN edit ON (edit.id = edit_work.edit)
WHERE edit.status = 1
EXCEPT
SELECT entity1 FROM l_area_work
EXCEPT
SELECT entity1 FROM l_artist_work
EXCEPT
SELECT entity1 FROM l_instrument_work
EXCEPT
SELECT entity1 FROM l_label_work
EXCEPT
SELECT entity1 FROM l_place_work
EXCEPT
SELECT entity1 FROM l_recording_work
EXCEPT
SELECT entity1 FROM l_release_work
EXCEPT
SELECT entity1 FROM l_release_group_work
EXCEPT
SELECT entity1 FROM l_series_work
EXCEPT
SELECT entity1 FROM l_url_work
EXCEPT
SELECT entity1 FROM l_work_work
EXCEPT
SELECT entity0 FROM l_work_work;
$BODY$
LANGUAGE 'sql';
CREATE OR REPLACE FUNCTION empty_places() RETURNS SETOF int AS
$BODY$
SELECT id FROM place
WHERE
edits_pending = 0 AND
(
last_updated < now() - '1 day'::interval OR last_updated is NULL
)
EXCEPT
SELECT place
FROM edit_place
JOIN edit ON (edit.id = edit_place.edit)
WHERE edit.status = 1
EXCEPT
SELECT entity1 FROM l_area_place
EXCEPT
SELECT entity1 FROM l_artist_place
EXCEPT
SELECT entity1 FROM l_instrument_place
EXCEPT
SELECT entity1 FROM l_label_place
EXCEPT
SELECT entity1 FROM l_place_place
EXCEPT
SELECT entity0 FROM l_place_place
EXCEPT
SELECT entity0 FROM l_place_recording
EXCEPT
SELECT entity0 FROM l_place_release
EXCEPT
SELECT entity0 FROM l_place_release_group
EXCEPT
SELECT entity0 FROM l_place_series
EXCEPT
SELECT entity0 FROM l_place_url
EXCEPT
SELECT entity0 FROM l_place_work;
$BODY$
LANGUAGE 'sql';
CREATE OR REPLACE FUNCTION empty_series() RETURNS SETOF int AS
$BODY$
SELECT id FROM series
WHERE
edits_pending = 0 AND
(
last_updated < now() - '1 day'::interval OR last_updated is NULL
)
EXCEPT
SELECT series
FROM edit_series
JOIN edit ON (edit.id = edit_series.edit)
WHERE edit.status = 1
EXCEPT
SELECT entity1 FROM l_area_series
EXCEPT
SELECT entity1 FROM l_artist_series
EXCEPT
SELECT entity1 FROM l_instrument_series
EXCEPT
SELECT entity1 FROM l_label_series
EXCEPT
SELECT entity1 FROM l_place_series
EXCEPT
SELECT entity1 FROM l_recording_series
EXCEPT
SELECT entity1 FROM l_release_series
EXCEPT
SELECT entity1 FROM l_release_group_series
EXCEPT
SELECT entity0 FROM l_series_series
EXCEPT
SELECT entity1 FROM l_series_series
EXCEPT
SELECT entity0 FROM l_series_url
EXCEPT
SELECT entity0 FROM l_series_work;
$BODY$
LANGUAGE 'sql';
CREATE OR REPLACE FUNCTION delete_unused_url(ids INTEGER[])
RETURNS VOID AS $$
DECLARE
clear_up INTEGER[];
BEGIN
SELECT ARRAY(
SELECT id FROM url url_row WHERE id = any(ids)
AND NOT (
EXISTS (
SELECT TRUE FROM l_area_url
WHERE entity1 = url_row.id
LIMIT 1
) OR
EXISTS (
SELECT TRUE FROM l_artist_url
WHERE entity1 = url_row.id
LIMIT 1
) OR
EXISTS (
SELECT TRUE FROM l_instrument_url
WHERE entity1 = url_row.id
LIMIT 1
) OR
EXISTS (
SELECT TRUE FROM l_label_url
WHERE entity1 = url_row.id
LIMIT 1
) OR
EXISTS (
SELECT TRUE FROM l_place_url
WHERE entity1 = url_row.id
LIMIT 1
) OR
EXISTS (
SELECT TRUE FROM l_recording_url
WHERE entity1 = url_row.id
LIMIT 1
) OR
EXISTS (
SELECT TRUE FROM l_release_url
WHERE entity1 = url_row.id
LIMIT 1
) OR
EXISTS (
SELECT TRUE FROM l_release_group_url
WHERE entity1 = url_row.id
LIMIT 1
) OR
EXISTS (
SELECT TRUE FROM l_series_url
WHERE entity1 = url_row.id
LIMIT 1
) OR
EXISTS (
SELECT TRUE FROM l_url_url
WHERE entity0 = url_row.id OR entity1 = url_row.id
LIMIT 1
) OR
EXISTS (
SELECT TRUE FROM l_url_work
WHERE entity0 = url_row.id
LIMIT 1
)
)
) INTO clear_up;
DELETE FROM url_gid_redirect WHERE new_id = any(clear_up);
DELETE FROM url WHERE id = any(clear_up);
END;
$$ LANGUAGE 'plpgsql';
CREATE OR REPLACE FUNCTION delete_orphaned_recordings()
RETURNS TRIGGER
AS $$
BEGIN
PERFORM TRUE
FROM recording outer_r
WHERE id = OLD.recording
AND edits_pending = 0
AND NOT EXISTS (
SELECT TRUE
FROM edit JOIN edit_recording er ON edit.id = er.edit
WHERE er.recording = outer_r.id
AND type IN (71, 207, 218)
LIMIT 1
) AND NOT EXISTS (
SELECT TRUE FROM track WHERE track.recording = outer_r.id LIMIT 1
) AND NOT EXISTS (
SELECT TRUE FROM l_area_recording WHERE entity1 = outer_r.id
UNION ALL
SELECT TRUE FROM l_artist_recording WHERE entity1 = outer_r.id
UNION ALL
SELECT TRUE FROM l_instrument_recording WHERE entity1 = outer_r.id
UNION ALL
SELECT TRUE FROM l_label_recording WHERE entity1 = outer_r.id
UNION ALL
SELECT TRUE FROM l_place_recording WHERE entity1 = outer_r.id
UNION ALL
SELECT TRUE FROM l_recording_recording WHERE entity1 = outer_r.id OR entity0 = outer_r.id
UNION ALL
SELECT TRUE FROM l_recording_release WHERE entity0 = outer_r.id
UNION ALL
SELECT TRUE FROM l_recording_release_group WHERE entity0 = outer_r.id
UNION ALL
SELECT TRUE FROM l_recording_series WHERE entity0 = outer_r.id
UNION ALL
SELECT TRUE FROM l_recording_work WHERE entity0 = outer_r.id
UNION ALL
SELECT TRUE FROM l_recording_url WHERE entity0 = outer_r.id
);
IF FOUND THEN
-- Remove references from tables that don't change whether or not this recording
-- is orphaned.
DELETE FROM isrc WHERE recording = OLD.recording;
DELETE FROM recording_annotation WHERE recording = OLD.recording;
DELETE FROM recording_gid_redirect WHERE new_id = OLD.recording;
DELETE FROM recording_rating_raw WHERE recording = OLD.recording;
DELETE FROM recording_tag WHERE recording = OLD.recording;
DELETE FROM recording_tag_raw WHERE recording = OLD.recording;
DELETE FROM recording WHERE id = OLD.recording;
END IF;
RETURN NULL;
END;
$$ LANGUAGE 'plpgsql';
CREATE OR REPLACE FUNCTION remove_unused_links() RETURNS TRIGGER AS $$
DECLARE
other_ars_exist BOOLEAN;
BEGIN
EXECUTE 'SELECT EXISTS (SELECT TRUE FROM ' || quote_ident(TG_TABLE_NAME) ||
' WHERE link = $1)'
INTO other_ars_exist
USING OLD.link;
IF NOT other_ars_exist THEN
DELETE FROM link_attribute WHERE link = OLD.link;
DELETE FROM link_attribute_credit WHERE link = OLD.link;
DELETE FROM link_attribute_text_value WHERE link = OLD.link;
DELETE FROM link WHERE id = OLD.link;
END IF;
RETURN NULL;
END;
$$ LANGUAGE 'plpgsql';
--------------------------------------------------------------------------------
SELECT '20140429-area-view.sql';
-- First, construct a table (recursively) of parent -> descendant connections
-- for areas, including an array of the path (the 'descendants' array).
-- Then, find the shortest path to each type of parent by joining to area,
-- distinct on descendant, type, and order by the length of the array of descendants.
CREATE OR REPLACE VIEW area_containment AS
WITH RECURSIVE area_descendants AS (
SELECT entity0 AS parent, entity1 AS descendant, ARRAY[entity1] AS descendants
FROM l_area_area laa
JOIN link ON laa.link = link.id
JOIN link_type ON link.link_type = link_type.id
WHERE link_type.gid = 'de7cc874-8b1b-3a05-8272-f3834c968fb7'
UNION ALL
SELECT entity0 AS parent, descendant, descendants || entity1
FROM l_area_area laa
JOIN link ON laa.link=link.id
JOIN link_type ON link.link_type = link_type.id
JOIN area_descendants ON area_descendants.parent = laa.entity1
WHERE link_type.gid = 'de7cc874-8b1b-3a05-8272-f3834c968fb7'
AND NOT entity0 = ANY(descendants))
SELECT DISTINCT ON (descendant, type) descendant, area_descendants.parent, area.type, area_type.name AS type_name, descendants || area_descendants.parent AS descendant_hierarchy
FROM area_descendants
JOIN area ON area_descendants.parent = area.id
JOIN area_type ON area.type = area_type.id
WHERE area.type IN (1, 2, 3)
ORDER BY descendant, type, array_length(descendants, 1) ASC;
COMMIT; | the_stack |
DROP FUNCTION IF EXISTS getBPOpenAmtToDate(numeric, numeric, date, numeric, numeric, text, text);
CREATE OR REPLACE FUNCTION getBPOpenAmtToDate(p_AD_Client_ID numeric,
p_AD_Org_ID numeric,
p_Date date,
p_C_BPartner_id numeric,
p_C_Currency_ID numeric,
p_UseDateAcct text = 'Y',
p_IsSOTrx text = 'Y')
RETURNS numeric
AS
$$
DECLARE
v_sum numeric;
v_orgNotSet boolean;
v_dateType text;
BEGIN
v_orgNotSet := COALESCE(p_AD_Org_ID, 0) <= 0;
v_dateType := CASE
WHEN p_UseDateAcct = 'Y' THEN 'A'
ELSE 'T'
END;
WITH t AS
(SELECT i.C_Invoice_ID,
ips.C_InvoicePaySchedule_ID
FROM C_Invoice i
LEFT OUTER JOIN C_InvoicePaySchedule ips
ON i.C_Invoice_ID = ips.C_Invoice_ID
AND ips.isvalid = 'Y'
AND ips.isActive = 'Y'
WHERE TRUE
AND i.IsSOTrx = p_IsSOTrx
AND (CASE
WHEN p_UseDateAcct = 'Y' THEN i.dateacct
ELSE i.dateinvoiced
END) <= p_Date
AND i.DocStatus IN ('CO', 'CL')
AND i.c_bpartner_id = p_c_bpartner_id
AND i.AD_CLient_ID = p_AD_Client_ID
AND (v_orgNotSet OR i.AD_Org_ID = p_AD_Org_ID))
SELECT INTO v_sum sum(
(SELECT openamt
FROM invoiceOpenToDate(
p_C_Invoice_ID := t.C_Invoice_ID,
p_c_invoicepayschedule_id := COALESCE(t.C_InvoicePaySchedule_ID, 0::numeric),
p_DateType := v_dateType,
p_Date := p_Date,
p_Result_Currency_ID := p_C_Currency_ID
)
)
)
FROM t;
RETURN coalesce(v_sum, 0);
END ;
$$
LANGUAGE plpgsql VOLATILE;
COMMENT ON FUNCTION getBPOpenAmtToDate(numeric, numeric, date, numeric, numeric, text, text) IS
' TEST
SELECT value,
C_Bpartner_ID,
getBPOpenAmtToDate(1000000,
1000000,
''9999-01-01'' :: date,
C_BPartner_ID,
318,
''Y'',
''Y'')
FROM C_Bpartner ; ';
/* TEST:
SELECT value,
C_Bpartner_ID,
getBPOpenAmtToDate(1000000,
1000000,
'9999-01-01' :: date,
C_BPartner_ID,
318,
'Y',
'Y')
FROM C_Bpartner ;
*/
DROP FUNCTION IF EXISTS getCustomerRevenue(numeric, numeric, numeric, date, date);
CREATE OR REPLACE FUNCTION getCustomerRevenue(p_C_BPartner_ID numeric,
p_AD_Client_ID numeric,
p_AD_Org_ID numeric,
p_DateFrom date,
p_DateTo date)
RETURNS numeric
AS
$$
WITH t AS (
SELECT i.DateInvoiced,
i.C_Currency_ID,
i.C_ConversionType_ID,
CASE
WHEN dt.DocBaseType IN ('ARC', 'APC') -- subtract credit memos
THEN -1
ELSE
1
END
AS multiplier,
CASE
WHEN i.IsTaxIncluded = 'Y' THEN il.LineNetAmt - il.TaxAmtInfo
ELSE il.LineNetAmt
END AS amt
FROM C_InvoiceLine il
JOIN C_Invoice i ON il.C_Invoice_ID = i.C_Invoice_ID
JOIN C_DocTYpe dt ON i.C_DocType_ID = dt.C_DocType_ID
WHERE p_C_BPartner_ID = i.C_Bpartner_ID
AND il.IsActive = 'Y'
AND i.IsActive = 'Y'
AND i.isSOTrx = 'Y'
AND i.DocStatus IN ('CO', 'CL')
AND i.AD_Client_ID = p_AD_Client_ID
AND i.AD_Org_ID = p_AD_Org_ID
AND (p_DateFrom IS NULL OR i.DateInvoiced >= p_dateFrom)
AND (p_DateTo IS NULL OR i.DateInvoiced <= p_dateTo)),
accounting AS (
SELECT C.c_currency_id
FROM C_Currency C
JOIN C_AcctSchema acc
ON C.c_currency_id = acc.c_currency_id
JOIN AD_ClientInfo ci ON ci.C_AcctSchema1_ID = acc.C_AcctSchema_ID
WHERE ci.AD_Client_ID = p_AD_Client_ID
)
SELECT sum(
t.multiplier *
currencyconvert(
p_amount := t.amt,
p_curfrom_id := t.C_Currency_ID,
p_curto_ID := accounting.c_currency_id,
p_convdate := t.DateInvoiced,
p_conversiontype_id := t.c_conversiontype_id,
p_client_id := p_AD_Client_ID,
p_org_id := p_AD_Org_ID)
) AS Revenue
FROM t,
accounting;
$$
LANGUAGE SQL STABLE;
COMMENT ON FUNCTION getCustomerRevenue(numeric, numeric, numeric, date, date) IS
' TEST :
SELECT C_BPartner_ID,
getCustomerRevenue(C_BPartner_ID,
1000000,
1000000,
NULL,
NULL)
FROM C_BPartner; ';
/* TEST:
SELECT C_BPartner_ID,
getCustomerRevenue(C_BPartner_ID,
1000000,
1000000,
NULL,
NULL)
FROM C_BPartner ;
*/
DROP FUNCTION IF EXISTS getTotalRevenue(numeric, numeric, numeric, date, date);
DROP FUNCTION IF EXISTS getTotalRevenue(numeric, numeric, date, date);
CREATE OR REPLACE FUNCTION getTotalRevenue (p_AD_Client_ID numeric,
p_AD_Org_ID numeric,
p_DateFrom date,
p_DateTo date)
RETURNS numeric
AS
$$
WITH t AS (
SELECT il.M_Product_ID,
i.DateInvoiced,
i.C_Currency_ID,
i.C_ConversionType_ID,
CASE
WHEN dt.DocBaseType IN ('ARC', 'APC') -- subtract credit memos
THEN -1
ELSE
1
END
AS multiplier,
CASE
WHEN i.IsTaxIncluded = 'Y' THEN il.LineNetAmt - il.TaxAmtInfo
ELSE il.LineNetAmt
END AS amt
FROM C_InvoiceLine il
JOIN C_Invoice i ON il.C_Invoice_ID = i.C_Invoice_ID
JOIN C_DocType dt ON i.C_DocType_ID = dt.C_DocType_ID
WHERE i.isSOTrx = 'Y'
AND il.IsActive = 'Y'
AND i.IsActive = 'Y'
AND i.DocStatus IN ('CO', 'CL')
AND i.AD_Client_ID = p_AD_Client_ID
AND i.AD_Org_ID = p_AD_Org_ID
AND (p_DateFrom IS NULL OR i.DateInvoiced >= p_dateFrom)
AND (p_DateTo IS NULL OR i.DateInvoiced <= p_dateTo))
,
accounting AS (
SELECT C.c_currency_id
FROM C_Currency C
JOIN C_AcctSchema acc
ON C.c_currency_id = acc.c_currency_id
JOIN AD_ClientInfo ci ON ci.C_AcctSchema1_ID = acc.C_AcctSchema_ID
WHERE ci.AD_Client_ID = p_AD_Client_ID
)
SELECT sum(
t.multiplier *
currencyconvert(
p_amount := t.amt,
p_curfrom_id := t.C_Currency_ID,
p_curto_ID := accounting.c_currency_id,
p_convdate := t.DateInvoiced,
p_conversiontype_id := t.c_conversiontype_id,
p_client_id := p_AD_Client_ID,
p_org_id := p_AD_Org_ID))
FROM t,
accounting;
$$
LANGUAGE SQL STABLE;
COMMENT ON FUNCTION
getTotalRevenue
(NUMERIC, NUMERIC, date, date)
IS
' TEST :
SELECT *
FROM getTotalRevenue(1000000 :: numeric,
1000000 ::numeric,
NULL :: date,
NULL :: date) ; ';
/* TEST:
SELECT *
FROM getTotalRevenue(1000000 :: numeric,
1000000 ::numeric,
NULL :: date,
NULL :: date) ;
*/
DROP FUNCTION IF EXISTS CustomersTopRevenue(NUMERIC, NUMERIC, DATE, DATE, INTEGER);
CREATE OR REPLACE FUNCTION CustomersTopRevenue(p_AD_Client_ID NUMERIC,
p_AD_Org_ID NUMERIC,
p_DateFrom DATE,
p_DateTo DATE,
p_Limit INTEGER)
RETURNS TABLE
(
Rang INTEGER,
BPValue CHARACTER VARYING,
Name CHARACTER VARYING,
Revenue NUMERIC,
OpenAmt NUMERIC,
ISO_Code CHARACTER(3),
SalesPercentOfTotal NUMERIC
)
AS
$$
WITH totals AS
(
SELECT COALESCE(getTotalRevenue(p_AD_Client_ID, p_AD_Org_ID, p_DateFrom, p_DateTo), 0) AS totalRevenueAmt
),
accounting AS (
SELECT C.c_currency_id, C.ISO_Code
FROM C_Currency C
JOIN C_AcctSchema acc
ON C.c_currency_id = acc.c_currency_id
JOIN AD_ClientInfo ci ON ci.C_AcctSchema1_ID = acc.C_AcctSchema_ID
WHERE ci.AD_Client_ID = p_AD_Client_ID
),
t AS
(
SELECT bp.value AS BPValue,
bp.Name AS NAME,
getCustomerRevenue(bp.C_BPartner_ID, p_AD_Client_ID, p_AD_Org_ID, p_DateFrom, p_DateTo)
AS Revenue,
getBPOpenAmtToDate(p_AD_Client_ID := p_AD_Client_ID,
p_AD_Org_ID := p_AD_Org_ID,
p_Date := p_DateTo,
p_C_BPartner_id := bp.C_BPartner_ID,
p_C_Currency_ID := accounting.c_currency_id,
p_UseDateAcct := 'Y',
p_IsSOTrx := 'Y')
AS OpenAmt
FROM C_BPartner bp,
accounting
WHERE bp.isCustomer = 'Y'
)
SELECT ROW_NUMBER() OVER (ORDER BY t.Revenue DESC NULLS LAST, t.BPValue) :: INTEGER AS Rang,
t.BPValue,
t.Name,
t.Revenue,
t.OpenAmt,
accounting.ISO_Code,
round(
(CASE
WHEN totals.totalRevenueAmt != 0 THEN (t.Revenue * 100) / totals.totalRevenueAmt
ELSE 0
END)
, 2) AS SalesPercentOfTotal
FROM t,
totals,
accounting
ORDER BY Rang
LIMIT (CASE
WHEN p_Limit > 0 THEN p_Limit
ELSE 999999999999999
END);
$$
LANGUAGE SQL VOLATILE;
COMMENT ON FUNCTION CustomersTopRevenue(NUMERIC, NUMERIC, DATE, DATE, INTEGER) IS
' TEST
SELECT *
FROM CustomersTopRevenue
(p_AD_Client_ID := 1000000,
p_AD_Org_ID := 1000000,
p_DateFrom := ''2020-01-01'',
p_DateTo := ''2020-05-05'',
p_Limit := -1); ';
/* TEST:
SELECT *
FROM CustomersTopRevenue
(p_AD_Client_ID := 1000000,
p_AD_Org_ID := 1000000,
p_DateFrom := '2020-01-01',
p_DateTo := '2020-05-05',
p_Limit := -1);
*/ | the_stack |
DROP PROCEDURE "AddIssue792Record"; COMMIT;
DROP PROCEDURE "Person_SelectByKey"; COMMIT;
DROP PROCEDURE "Person_SelectAll"; COMMIT;
DROP PROCEDURE "Person_SelectByName"; COMMIT;
DROP PROCEDURE "Person_Insert"; COMMIT;
DROP PROCEDURE "Person_Insert_OutputParameter"; COMMIT;
DROP PROCEDURE "Person_Update"; COMMIT;
DROP PROCEDURE "Person_Delete"; COMMIT;
DROP PROCEDURE "Patient_SelectAll"; COMMIT;
DROP PROCEDURE "Patient_SelectByName"; COMMIT;
DROP PROCEDURE "OutRefTest"; COMMIT;
DROP PROCEDURE "OutRefEnumTest"; COMMIT;
DROP PROCEDURE "Scalar_DataReader"; COMMIT;
DROP PROCEDURE "Scalar_OutputParameter"; COMMIT;
DROP PROCEDURE "Scalar_ReturnParameter"; COMMIT;
-- SKIP Firebird BEGIN
-- SKIP Firebird3 BEGIN
DROP PROCEDURE test_v4_types;
-- SKIP Firebird END
-- SKIP Firebird3 END
-- SKIP Firebird4 BEGIN
SELECT 1 FROM rdb$database
-- SKIP Firebird4 END
COMMIT;
DROP VIEW "PersonView"; COMMIT;
DROP TRIGGER "CREATE_PersonID"; COMMIT;
DROP TRIGGER "CREATE_DataTypeTest"; COMMIT;
DROP TABLE "Dual"; COMMIT;
DROP TABLE "DataTypeTest"; COMMIT;
DROP TABLE "Doctor"; COMMIT;
DROP TABLE "Patient"; COMMIT;
DROP TABLE "Person"; COMMIT;
DROP GENERATOR "DataTypeID"; COMMIT;
DROP GENERATOR "PersonID"; COMMIT;
DROP EXTERNAL FUNCTION RTRIM; COMMIT;
DROP EXTERNAL FUNCTION LTRIM; COMMIT;
DECLARE EXTERNAL FUNCTION LTRIM
CSTRING(255) NULL
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_ltrim' MODULE_NAME 'ib_udf';
COMMIT;
DECLARE EXTERNAL FUNCTION RTRIM
CSTRING(255) NULL
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_rtrim' MODULE_NAME 'ib_udf';
COMMIT;
/*
Dual table FOR supporting queryies LIKE:
SELECT 1 AS id => SELECT 1 AS "id" *FROM Dual*
*/
CREATE TABLE "Dual" ("Dummy" VARCHAR(10));
COMMIT;
INSERT INTO "Dual" ("Dummy") VALUES ('X');
COMMIT;
DROP TABLE "InheritanceParent";
COMMIT;
CREATE TABLE "InheritanceParent"
(
"InheritanceParentId" INTEGER NOT NULL PRIMARY KEY,
"TypeDiscriminator" INTEGER,
"Name" VARCHAR(50)
);
COMMIT;
DROP TABLE "InheritanceChild";
COMMIT;
CREATE TABLE "InheritanceChild"
(
"InheritanceChildId" INTEGER NOT NULL PRIMARY KEY,
"InheritanceParentId" INTEGER NOT NULL,
"TypeDiscriminator" INTEGER,
"Name" VARCHAR(50)
);
COMMIT;
-- Person Table
CREATE TABLE "Person"
(
"PersonID" INTEGER NOT NULL PRIMARY KEY,
"FirstName" VARCHAR(50) CHARACTER SET UNICODE_FSS NOT NULL,
"LastName" VARCHAR(50) CHARACTER SET UNICODE_FSS NOT NULL,
"MiddleName" VARCHAR(50) CHARACTER SET UNICODE_FSS,
"Gender" CHAR(1) NOT NULL CHECK ("Gender" in ('M', 'F', 'U', 'O'))
);
COMMIT;
CREATE GENERATOR "PersonID";
COMMIT;
CREATE TRIGGER "CREATE_PersonID" FOR "Person"
BEFORE INSERT POSITION 0
AS BEGIN
NEW."PersonID" = GEN_ID("PersonID", 1);
END;
COMMIT;
INSERT INTO "Person" ("FirstName", "LastName", "Gender") VALUES ('John', 'Pupkin', 'M');
COMMIT;
INSERT INTO "Person" ("FirstName", "LastName", "Gender") VALUES ('Tester', 'Testerson', 'M');
COMMIT;
INSERT INTO "Person" ("FirstName", "LastName", "Gender") VALUES ('Jane', 'Doe', 'F');
COMMIT;
-- INSERT INTO "Person" ("FirstName", "LastName", "Gender") VALUES ('Jürgen', 'König', 'M');
INSERT INTO "Person" ("FirstName", "LastName", "MiddleName", "Gender") VALUES (_utf8 x'4AC3BC7267656E', _utf8 x'4BC3B66E6967', 'Ko', 'M');
COMMIT;
-- Doctor Table Extension
CREATE TABLE "Doctor"
(
"PersonID" INTEGER NOT NULL PRIMARY KEY,
"Taxonomy" VARCHAR(50) NOT NULL,
CONSTRAINT "FK_Doctor_Person" FOREIGN KEY ("PersonID") REFERENCES "Person" ("PersonID")
ON DELETE CASCADE
);
COMMIT;
INSERT INTO "Doctor" ("PersonID", "Taxonomy") VALUES (1, 'Psychiatry');
COMMIT;
-- Patient Table Extension
CREATE TABLE "Patient"
(
"PersonID" int NOT NULL PRIMARY KEY,
"Diagnosis" VARCHAR(256) NOT NULL,
FOREIGN KEY ("PersonID") REFERENCES "Person" ("PersonID")
ON DELETE CASCADE
);
COMMIT;
INSERT INTO "Patient" ("PersonID", "Diagnosis") VALUES (2, 'Hallucination with Paranoid Bugs'' Delirium of Persecution');
COMMIT;
-- Data Types test
/*
Data definitions according to:
http://www.firebirdsql.org/manual/migration-mssql-data-types.html
BUT! BLOB is ised for BINARY data! not CHAR
*/
CREATE TABLE "DataTypeTest"
(
"DataTypeID" INTEGER NOT NULL PRIMARY KEY,
"Binary_" BLOB,
"Boolean_" CHAR(1),
"Byte_" SMALLINT,
"Bytes_" BLOB,
CHAR_ CHAR(1),
"DateTime_" TIMESTAMP,
"Decimal_" DECIMAL(10, 2),
"Double_" DOUBLE PRECISION,
"Guid_" CHAR(38),
"Int16_" SMALLINT,
"Int32_" INTEGER,
"Int64_" NUMERIC(11),
"Money_" DECIMAL(18, 4),
"SByte_" SMALLINT,
"Single_" FLOAT,
"Stream_" BLOB,
"String_" VARCHAR(50) CHARACTER SET UNICODE_FSS,
"UInt16_" SMALLINT,
"UInt32_" INTEGER,
"UInt64_" NUMERIC(11),
"Xml_" CHAR(1000)
);
COMMIT;
CREATE GENERATOR "DataTypeID";
COMMIT;
CREATE TRIGGER "CREATE_DataTypeTest" FOR "DataTypeTest"
BEFORE INSERT POSITION 0
AS BEGIN
NEW."DataTypeID" = GEN_ID("DataTypeID", 1);
END;
COMMIT;
INSERT INTO "DataTypeTest"
("Binary_", "Boolean_", "Byte_", "Bytes_", CHAR_, "DateTime_", "Decimal_",
"Double_", "Guid_", "Int16_", "Int32_", "Int64_", "Money_", "SByte_",
"Single_", "Stream_", "String_", "UInt16_", "UInt32_", "UInt64_", "Xml_")
VALUES
( NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL);
COMMIT;
INSERT INTO "DataTypeTest"
("Binary_", "Boolean_", "Byte_", "Bytes_", CHAR_, "DateTime_", "Decimal_",
"Double_", "Guid_", "Int16_", "Int32_", "Int64_", "Money_", "SByte_",
"Single_", "Stream_", "String_", "UInt16_", "UInt32_", "UInt64_",
"Xml_")
VALUES
('dddddddddddddddd', 1, 255,'dddddddddddddddd', 'B', 'NOW', 12345.67,
1234.567, 'dddddddddddddddddddddddddddddddd', 32767, 32768, 1000000, 12.3456, 127,
1234.123, 'dddddddddddddddd', 'string', 32767, 32768, 200000000,
'<root><element strattr="strvalue" intattr="12345"/></root>');
COMMIT;
DROP TABLE "Parent"; COMMIT;
DROP TABLE "Child"; COMMIT;
DROP TABLE "GrandChild"; COMMIT;
CREATE TABLE "Parent" ("ParentID" int, "Value1" int); COMMIT;
CREATE TABLE "Child" ("ParentID" int, "ChildID" int); COMMIT;
CREATE TABLE "GrandChild" ("ParentID" int, "ChildID" int, "GrandChildID" int); COMMIT;
DROP TABLE "LinqDataTypes"; COMMIT;
CREATE TABLE "LinqDataTypes"
(
ID int,
"MoneyValue" decimal(10,4),
"DateTimeValue" timestamp,
"DateTimeValue2" timestamp,
"BoolValue" char(1),
"GuidValue" char(38),
"BinaryValue" blob,
"SmallIntValue" smallint,
"IntValue" int,
"BigIntValue" bigint,
"StringValue" VARCHAR(50)
);
COMMIT;
DROP GENERATOR "SequenceTestSeq"; COMMIT;
CREATE GENERATOR "SequenceTestSeq";
COMMIT;
DROP TABLE "SequenceTest"; COMMIT;
CREATE TABLE "SequenceTest"
(
ID int NOT NULL PRIMARY KEY,
"Value_" VARCHAR(50) NOT NULL
);
COMMIT;
DROP TRIGGER CREATE_ID;
COMMIT;
DROP GENERATOR "TestIdentityID";
COMMIT;
DROP TABLE "TestIdentity";
COMMIT;
CREATE TABLE "TestIdentity" (
ID INTEGER NOT NULL PRIMARY KEY
);
COMMIT;
CREATE GENERATOR "TestIdentityID";
COMMIT;
CREATE TRIGGER CREATE_ID FOR "TestIdentity"
BEFORE INSERT POSITION 0
AS BEGIN
NEW.ID = GEN_ID("TestIdentityID", 1);
END;
COMMIT;
DROP TRIGGER "AllTypes_ID";
COMMIT;
DROP GENERATOR "AllTypesID";
COMMIT;
DROP TABLE "AllTypes";
COMMIT;
CREATE TABLE "AllTypes"
(
ID integer NOT NULL PRIMARY KEY,
"bigintDataType" bigint,
"smallintDataType" smallint,
"decimalDataType" decimal(18),
"intDataType" int,
"floatDataType" float,
"realDataType" real,
"doubleDataType" double precision,
"timestampDataType" timestamp,
"charDataType" char(1),
"char20DataType" char(20),
"varcharDataType" varchar(20),
"textDataType" blob sub_type TEXT,
"ncharDataType" char(20) character set UNICODE_FSS,
"nvarcharDataType" varchar(20) character set UNICODE_FSS,
-- SKIP Firebird BEGIN
-- SKIP Firebird3 BEGIN
"timestampTZDataType" timestamp with time zone,
"timeTZDataType" time with time zone,
"decfloat16DataType" decfloat(16),
"decfloat34DataType" decfloat,
"int128DataType" int128,
-- SKIP Firebird3 END
-- SKIP Firebird END
"blobDataType" blob
);
COMMIT;
CREATE GENERATOR "AllTypesID";
COMMIT;
CREATE TRIGGER "AllTypes_ID" FOR "AllTypes"
BEFORE INSERT POSITION 0
AS BEGIN
NEW.ID = GEN_ID("AllTypesID", 1);
END;
COMMIT;
INSERT INTO "AllTypes"
VALUES
(
1,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
-- SKIP Firebird BEGIN
-- SKIP Firebird3 BEGIN
NULL,
NULL,
NULL,
NULL,
NULL,
-- SKIP Firebird3 END
-- SKIP Firebird END
NULL
);
COMMIT;
INSERT INTO "AllTypes"
VALUES
(
2,
1000000,
25555,
2222222,
7777777,
20.31,
16,
16.17,
Cast('2012-12-12 12:12:12' as timestamp),
'1',
'1',
'234',
'567',
'23233',
'3323',
-- SKIP Firebird BEGIN
-- SKIP Firebird3 BEGIN
'2020-12-12 12:24:35 Europe/Andorra',
'12:13 Australia/Hobart',
1234567890.123456,
123456789012345678901234567890.1234,
170141183460469231731687303715884105727,
-- SKIP Firebird3 END
-- SKIP Firebird END
'12345'
);
COMMIT;
CREATE VIEW "PersonView"
AS
SELECT * FROM "Person";
COMMIT;
-- Person_SelectByKey
CREATE PROCEDURE "Person_SelectByKey"(id INTEGER)
RETURNS (
PersonID INTEGER,
FirstName VARCHAR(50) CHARACTER SET UNICODE_FSS,
LastName VARCHAR(50) CHARACTER SET UNICODE_FSS,
MiddleName VARCHAR(50) CHARACTER SET UNICODE_FSS,
Gender CHAR(1)
)
AS
BEGIN
SELECT "PersonID", "FirstName", "LastName", "MiddleName", "Gender" FROM "Person"
WHERE "PersonID" = :id
INTO
:PersonID,
:FirstName,
:LastName,
:MiddleName,
:Gender;
SUSPEND;
END;
COMMIT;
-- Person_SelectAll
CREATE PROCEDURE "Person_SelectAll"
RETURNS (
PersonID INTEGER,
FirstName VARCHAR(50) CHARACTER SET UNICODE_FSS,
LastName VARCHAR(50) CHARACTER SET UNICODE_FSS,
MiddleName VARCHAR(50) CHARACTER SET UNICODE_FSS,
Gender CHAR(1)
)
AS
BEGIN
FOR
SELECT "PersonID", "FirstName", "LastName", "MiddleName", "Gender" FROM "Person"
INTO
:PersonID,
:FirstName,
:LastName,
:MiddleName,
:Gender
DO SUSPEND;
END;
COMMIT;
-- Person_SelectByName
CREATE PROCEDURE "Person_SelectByName"
(
in_FirstName VARCHAR(50) CHARACTER SET UNICODE_FSS,
in_LastName VARCHAR(50) CHARACTER SET UNICODE_FSS
)
RETURNS
(
PersonID int,
FirstName VARCHAR(50) CHARACTER SET UNICODE_FSS,
LastName VARCHAR(50) CHARACTER SET UNICODE_FSS,
MiddleName VARCHAR(50) CHARACTER SET UNICODE_FSS,
Gender CHAR(1)
)
AS
BEGIN
FOR SELECT "PersonID", "FirstName", "LastName", "MiddleName", "Gender" FROM "Person"
WHERE "FirstName" LIKE :in_FirstName and "LastName" LIKE :in_LastName
INTO
:PersonID,
:FirstName,
:LastName,
:MiddleName,
:Gender
DO SUSPEND;
END;
COMMIT;
-- Person_Insert
CREATE PROCEDURE "Person_Insert"
(
FirstName VARCHAR(50) CHARACTER SET UNICODE_FSS,
LastName VARCHAR(50) CHARACTER SET UNICODE_FSS,
MiddleName VARCHAR(50) CHARACTER SET UNICODE_FSS,
Gender CHAR(1)
)
RETURNS (PersonID INTEGER)
AS
BEGIN
INSERT INTO "Person"
( "LastName", "FirstName", "MiddleName", "Gender")
VALUES
(:LastName, :FirstName, :MiddleName, :Gender);
SELECT MAX("PersonID") FROM "Person"
INTO :PersonID;
SUSPEND;
END;
COMMIT;
-- Person_Insert_OutputParameter
CREATE PROCEDURE "Person_Insert_OutputParameter"
(
FirstName VARCHAR(50) CHARACTER SET UNICODE_FSS,
LastName VARCHAR(50) CHARACTER SET UNICODE_FSS,
MiddleName VARCHAR(50) CHARACTER SET UNICODE_FSS,
Gender CHAR(1)
)
RETURNS (PersonID INTEGER)
AS
BEGIN
INSERT INTO "Person"
( "LastName", "FirstName", "MiddleName", "Gender")
VALUES
(:LastName, :FirstName, :MiddleName, :Gender);
SELECT max("PersonID") FROM "Person"
INTO :PersonID;
SUSPEND;
END;
COMMIT;
-- Person_Update
CREATE PROCEDURE "Person_Update"(
PersonID INTEGER,
FirstName VARCHAR(50) CHARACTER SET UNICODE_FSS,
LastName VARCHAR(50) CHARACTER SET UNICODE_FSS,
MiddleName VARCHAR(50) CHARACTER SET UNICODE_FSS,
Gender CHAR(1)
)
AS
BEGIN
UPDATE
"Person"
SET
"LastName" = :LastName,
"FirstName" = :FirstName,
"MiddleName" = :MiddleName,
"Gender" = :Gender
WHERE
"PersonID" = :PersonID;
END;
COMMIT;
-- Person_Delete
CREATE PROCEDURE "Person_Delete"(
PersonID INTEGER
)
AS
BEGIN
DELETE FROM "Person" WHERE "PersonID" = :PersonID;
END;
COMMIT;
-- Patient_SelectAll
CREATE PROCEDURE "Patient_SelectAll"
RETURNS (
PersonID int,
FirstName VARCHAR(50) CHARACTER SET UNICODE_FSS,
LastName VARCHAR(50) CHARACTER SET UNICODE_FSS,
MiddleName VARCHAR(50) CHARACTER SET UNICODE_FSS,
Gender CHAR(1),
Diagnosis VARCHAR(256)
)
AS
BEGIN
FOR
SELECT
"Person"."PersonID",
"FirstName",
"LastName",
"MiddleName",
"Gender",
"Patient"."Diagnosis"
FROM
"Patient", "Person"
WHERE
"Patient"."PersonID" = "Person"."PersonID"
INTO
:PersonID,
:FirstName,
:LastName,
:MiddleName,
:Gender,
:Diagnosis
DO SUSPEND;
END;
COMMIT;
-- Patient_SelectByName
CREATE PROCEDURE "Patient_SelectByName"(
FirstName VARCHAR(50) CHARACTER SET UNICODE_FSS,
LastName VARCHAR(50) CHARACTER SET UNICODE_FSS
)
RETURNS (
PersonID int,
MiddleName VARCHAR(50) CHARACTER SET UNICODE_FSS,
Gender CHAR(1),
Diagnosis VARCHAR(256)
)
AS
BEGIN
FOR
SELECT
"Person"."PersonID",
"MiddleName",
"Gender",
"Patient"."Diagnosis"
FROM
"Patient", "Person"
WHERE
"Patient"."PersonID" = "Person"."PersonID"
and "FirstName" = :FirstName and "LastName" = :LastName
INTO
:PersonID,
:MiddleName,
:Gender,
:Diagnosis
DO SUSPEND;
END;
COMMIT;
-- OutRefTest
/*
Fake input parameters are used to "emulate" input/output parameters.
Each inout parameter should be defined in RETURNS(...) section
and allso have a "mirror" in input section, mirror name shoul be:
FdpDataProvider.InOutInputParameterPrefix + [parameter name]
ex:
in_inputOutputID is input mirror FOR inout parameter inputOutputID
*/
CREATE PROCEDURE "OutRefTest"(
ID INTEGER,
in_inputOutputID INTEGER,
str VARCHAR(50),
in_inputOutputStr VARCHAR(50)
)
RETURNS(
inputOutputID INTEGER,
inputOutputStr VARCHAR(50),
outputID INTEGER,
outputStr VARCHAR(50)
)
AS
BEGIN
outputID = ID;
inputOutputID = ID + in_inputOutputID;
outputStr = str;
inputOutputStr = str || in_inputOutputStr;
SUSPEND;
END;
COMMIT;
-- OutRefEnumTest
CREATE PROCEDURE "OutRefEnumTest"(
str VARCHAR(50),
in_inputOutputStr VARCHAR(50)
)
RETURNS (
inputOutputStr VARCHAR(50),
outputStr VARCHAR(50)
)
AS
BEGIN
outputStr = str;
inputOutputStr = str || in_inputOutputStr;
SUSPEND;
END;
COMMIT;
-- ExecuteScalarTest
CREATE PROCEDURE "Scalar_DataReader"
RETURNS(
intField INTEGER,
stringField VARCHAR(50)
)
AS
BEGIN
intField = 12345;
stringField = '54321';
SUSPEND;
END;
COMMIT;
CREATE PROCEDURE "Scalar_OutputParameter"
RETURNS (
outputInt INTEGER,
outputString VARCHAR(50)
)
AS
BEGIN
outputInt = 12345;
outputString = '54321';
SUSPEND;
END;
COMMIT;
/*
"Return_Value" is the name for ReturnValue "emulating"
may be changed: FdpDataProvider.ReturnParameterName
*/
CREATE PROCEDURE "Scalar_ReturnParameter"
RETURNS (Return_Value INTEGER)
AS
BEGIN
Return_Value = 12345;
SUSPEND;
END;
COMMIT;
DROP TABLE "CamelCaseName";
COMMIT;
CREATE TABLE "CamelCaseName"
(
"Id" INTEGER NOT NULL PRIMARY KEY,
Name1 VARCHAR(20),
"Name2" VARCHAR(20),
"NAME3" VARCHAR(20),
"_NAME4" VARCHAR(20),
"NAME 5" VARCHAR(20)
);
COMMIT;
DROP TABLE "TestMerge1"; COMMIT;
DROP TABLE "TestMerge2"; COMMIT;
CREATE TABLE "TestMerge1"
(
"Id" INTEGER NOT NULL PRIMARY KEY,
"Field1" INTEGER,
"Field2" INTEGER,
"Field3" INTEGER,
"Field4" INTEGER,
"Field5" INTEGER,
"FieldInt64" BIGINT,
"FieldBoolean" CHAR(1),
"FieldString" VARCHAR(20),
"FieldNString" VARCHAR(20) CHARACTER SET UNICODE_FSS,
"FieldChar" CHAR(1),
"FieldNChar" CHAR(1) CHARACTER SET UNICODE_FSS,
"FieldFloat" FLOAT,
"FieldDouble" DOUBLE PRECISION,
"FieldDateTime" TIMESTAMP,
"FieldBinary" BLOB(20),
"FieldGuid" CHAR(38),
"FieldDecimal" DECIMAL(18, 10),
"FieldDate" DATE,
"FieldTime" TIMESTAMP,
"FieldEnumString" VARCHAR(20),
"FieldEnumNumber" INT
);
COMMIT;
CREATE TABLE "TestMerge2"
(
"Id" INTEGER NOT NULL PRIMARY KEY,
"Field1" INTEGER,
"Field2" INTEGER,
"Field3" INTEGER,
"Field4" INTEGER,
"Field5" INTEGER,
"FieldInt64" BIGINT,
"FieldBoolean" CHAR(1),
"FieldString" VARCHAR(20),
"FieldNString" VARCHAR(20) CHARACTER SET UNICODE_FSS,
"FieldChar" CHAR(1),
"FieldNChar" CHAR(1) CHARACTER SET UNICODE_FSS,
"FieldFloat" FLOAT,
"FieldDouble" DOUBLE PRECISION,
"FieldDateTime" TIMESTAMP,
"FieldBinary" BLOB(20),
"FieldGuid" CHAR(38),
"FieldDecimal" DECIMAL(18, 10),
"FieldDate" DATE,
"FieldTime" TIMESTAMP,
"FieldEnumString" VARCHAR(20),
"FieldEnumNumber" INT
);
COMMIT;
CREATE PROCEDURE "AddIssue792Record"
AS
BEGIN
INSERT INTO "AllTypes"("char20DataType") VALUES('issue792');
END;
COMMIT;
-- SKIP Firebird4 BEGIN
SELECT 1 FROM rdb$database
-- SKIP Firebird4 END
-- SKIP Firebird BEGIN
-- SKIP Firebird3 BEGIN
CREATE PROCEDURE test_v4_types
(
tstz timestamp with time zone,
ttz time with time zone,
decfloat16 decfloat(16),
decfloat34 decfloat,
int_128 int128
)
RETURNS
(
col_tstz timestamp with time zone,
col_ttz time with time zone,
col_decfloat16 decfloat(16),
col_decfloat34 decfloat,
col_int_128 int128
)
AS
BEGIN
FOR SELECT FIRST 1 :tstz, :ttz, :decfloat16, :decfloat34, :int_128 FROM rdb$database
INTO
:col_tstz,
:col_ttz,
:col_decfloat16,
:col_decfloat34,
:col_int_128
DO SUSPEND;
END;
-- SKIP Firebird3 END
-- SKIP Firebird END
COMMIT;
DROP TABLE "CollatedTable"
COMMIT;
CREATE TABLE "CollatedTable"
(
"Id" INT NOT NULL,
"CaseSensitive" VARCHAR(20) CHARACTER SET UTF8 COLLATE UNICODE,
"CaseInsensitive" VARCHAR(20) CHARACTER SET UTF8 COLLATE UNICODE_CI
)
COMMIT; | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for job_info
-- ----------------------------
DROP TABLE IF EXISTS `job_info`;
CREATE TABLE `job_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`job_name` varchar(50) DEFAULT NULL COMMENT '任务名称',
`job_group` varchar(50) DEFAULT NULL COMMENT '任务分组',
`job_description` varchar(50) DEFAULT NULL COMMENT '任务描述',
`job_env` varchar(10) DEFAULT 'all' COMMENT '配置在某种语言环境才可启动任务 all为全部 zh_CN en_US id_ID等',
`start_withrun` smallint(2) DEFAULT '0' COMMENT '是否随着程序启动自动启动任务 0否 1是',
`job_status` smallint(2) DEFAULT '1' COMMENT '1正在运行 0已经停止',
`cron_expression` varchar(20) DEFAULT NULL COMMENT 'cron表达式',
`bean_class` varchar(150) DEFAULT NULL COMMENT '任务执行时调用哪个类的方法 包名+类名',
`spring_id` varchar(20) DEFAULT NULL COMMENT 'Spring bean 名',
`method_name` varchar(128) DEFAULT NULL,
`param_json` varchar(255) DEFAULT NULL COMMENT '方法执行需要的参数,配置为json',
`is_concurrent` smallint(2) DEFAULT NULL COMMENT '任务是否可以并发(一个还没完就执行下一个) 1可以 0不可以',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of job_info
-- ----------------------------
-- ----------------------------
-- Table structure for notice
-- ----------------------------
DROP TABLE IF EXISTS `notice`;
CREATE TABLE `notice` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`nid` varchar(30) DEFAULT '',
`receive_user` varchar(11) DEFAULT NULL COMMENT '接收用户',
`status` tinyint(1) DEFAULT '0' COMMENT '状态,0:发送失败;1:发送成功',
`use_status` tinyint(1) DEFAULT '0' COMMENT '是否已使用 0未使用 1已使用',
`title` varchar(50) DEFAULT '' COMMENT '标题',
`content` text COMMENT '发送内容',
`result` varchar(1000) DEFAULT '' COMMENT '发送结果信息',
`add_time` datetime DEFAULT NULL COMMENT '添加时间',
`code` varchar(6) DEFAULT NULL COMMENT '验证码',
PRIMARY KEY (`id`),
KEY `index_add_time` (`add_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='短信记录表';
-- ----------------------------
-- Records of notice
-- ----------------------------
-- ----------------------------
-- Table structure for notice_type
-- ----------------------------
DROP TABLE IF EXISTS `notice_type`;
CREATE TABLE `notice_type` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`nid` varchar(30) NOT NULL DEFAULT '' COMMENT '编码,与notice_type组合起来唯一',
`name` varchar(30) DEFAULT '' COMMENT '名称',
`send` tinyint(1) DEFAULT '0' COMMENT '是否发送:0-不发送,1-发送',
`title_templet` varchar(250) DEFAULT '' COMMENT '标题的freemarker模板',
`templet` varchar(1024) DEFAULT '' COMMENT '内容的freemarker模板',
`remark` varchar(250) DEFAULT '' COMMENT '备注',
`add_time` datetime DEFAULT NULL COMMENT '添加时间',
`add_ip` varchar(15) DEFAULT '' COMMENT '添加IP',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='短信模版表';
-- ----------------------------
-- Records of notice_type
-- ----------------------------
-- ----------------------------
-- Table structure for sys_config
-- ----------------------------
DROP TABLE IF EXISTS `sys_config`;
CREATE TABLE `sys_config` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(30) DEFAULT '' COMMENT '名称',
`nid` varchar(50) DEFAULT '' COMMENT '标识',
`value` varchar(2058) DEFAULT '' COMMENT '名称对应的值',
`type` tinyint(4) DEFAULT NULL COMMENT '类型 1:系统底层配置信息, 2:各种费率配置信息, 3:邮件/短信配置信息, 4:附加增值功能配置信息, 5:第三方资金托管相关的配置, 6.网站汇付天下相关配置信息, 7:短信模板替换参数配置信息',
`status` tinyint(1) DEFAULT '0' COMMENT '状态 0:不启用 1:启用',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统参数表';
-- ----------------------------
-- Records of sys_config
-- ----------------------------
-- ----------------------------
-- Table structure for sys_dict
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict`;
CREATE TABLE `sys_dict` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(50) DEFAULT NULL COMMENT '名称',
`i18n_nid` varchar(50) DEFAULT NULL COMMENT '中文对应的国际化标识NID',
`nid` varchar(100) DEFAULT NULL COMMENT '唯一标识',
`pid` int(11) DEFAULT NULL COMMENT '父级id',
`value` varchar(50) DEFAULT NULL COMMENT '值',
`type` int(2) DEFAULT NULL COMMENT '类型 (详情见dict表basics_dict_type) ',
`code` varchar(50) DEFAULT NULL COMMENT '代码',
`java_type` varchar(50) DEFAULT NULL COMMENT 'java类型 (详情见dict表basics_java_type)',
`sort` int(3) DEFAULT '1' COMMENT '排序',
`status` int(2) DEFAULT '1' COMMENT '状态,(详情见dict表basics_use_status) ',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`add_time` datetime DEFAULT CURRENT_TIMESTAMP,
`update_time` datetime DEFAULT CURRENT_TIMESTAMP,
`relate_id` varchar(100) DEFAULT '' COMMENT '关联字典id',
PRIMARY KEY (`id`),
KEY `nid` (`nid`),
KEY `pid` (`pid`),
KEY `value` (`value`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='字典表';
-- ----------------------------
-- Table structure for sys_event_hook
-- ----------------------------
DROP TABLE IF EXISTS `sys_event_hook`;
CREATE TABLE `sys_event_hook` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`name` varchar(32) DEFAULT NULL COMMENT '名称',
`service_bean` varchar(32) DEFAULT NULL COMMENT '源事件对象bean',
`service_method` varchar(32) DEFAULT NULL COMMENT '源事件方法',
`status` varchar(8) DEFAULT NULL COMMENT '状态:1启动 0禁止 字典代码:basis_status',
`execute_type` varchar(8) DEFAULT NULL COMMENT '执行类型 java代表执行代码 sql代表执行',
`execute_sql` varchar(255) DEFAULT NULL COMMENT '执行sql',
`execute_sql_param` varchar(255) DEFAULT NULL COMMENT '执行sql参数',
`execute_bean` varchar(255) DEFAULT NULL COMMENT '执行对象类',
`execute_method` varchar(255) DEFAULT NULL COMMENT '执行对象方法',
`execute_param` varchar(255) DEFAULT NULL COMMENT '执行对象参数',
`add_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='事件hook表';
-- ----------------------------
-- Records of sys_event_hook
-- ----------------------------
-- ----------------------------
-- Table structure for sys_i18n
-- ----------------------------
DROP TABLE IF EXISTS `sys_i18n`;
CREATE TABLE `sys_i18n` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`model` varchar(32) NOT NULL DEFAULT 'market' COMMENT '模块',
`name` varchar(64) NOT NULL COMMENT '名称',
`text` varchar(256) NOT NULL COMMENT '默认内容',
`zh_CN` varchar(256) DEFAULT NULL COMMENT '中文内容',
`en_US` varchar(256) DEFAULT NULL COMMENT '英文内容',
`add_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '插入时间',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `index_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=134 DEFAULT CHARSET=utf8 COMMENT='国际化翻译表';
-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
`id` int(8) NOT NULL AUTO_INCREMENT COMMENT '主键标示',
`name` varchar(128) DEFAULT '' COMMENT '菜单名称',
`i18n_nid` varchar(50) DEFAULT NULL COMMENT '中文对应的国际化标识NID',
`pid` int(8) DEFAULT '0' COMMENT '父级ID',
`level_id` tinyint(2) DEFAULT '0' COMMENT '等级',
`url` varchar(512) DEFAULT '' COMMENT '链接地址',
`icon_cls` varchar(512) DEFAULT '' COMMENT '图标',
`status` tinyint(4) DEFAULT '0' COMMENT '状态',
`sort` tinyint(4) DEFAULT '1' COMMENT '排序',
`code` varchar(128) DEFAULT NULL COMMENT '代码',
`state` varchar(16) DEFAULT NULL COMMENT '是否可展开',
`resource_type` varchar(16) DEFAULT NULL COMMENT '资源类型',
`add_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`add_user` varchar(30) DEFAULT NULL COMMENT '添加用户',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`update_user` varchar(30) DEFAULT NULL COMMENT '修改用户',
`remark` varchar(256) DEFAULT '' COMMENT '备注',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='菜单表';
-- ----------------------------
-- Table structure for sys_operate
-- ----------------------------
DROP TABLE IF EXISTS `sys_operate`;
CREATE TABLE `sys_operate` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_name` varchar(50) DEFAULT NULL COMMENT '用户名',
`real_name` varchar(50) DEFAULT NULL,
`pwd` varchar(255) DEFAULT NULL COMMENT '密码',
`mobile_phone` varchar(50) DEFAULT NULL COMMENT '手机号',
`add_time` datetime DEFAULT NULL COMMENT '添加时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`partner_id` int(11) DEFAULT NULL COMMENT '商户id',
`login_ip` varchar(255) DEFAULT NULL COMMENT '最近登录ip',
`login_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '最近登录时间',
`status` int(11) DEFAULT '1' COMMENT '状态',
PRIMARY KEY (`id`),
KEY `sys_operate_partner` (`partner_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='操作员表';
-- ----------------------------
-- Table structure for sys_operate_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_operate_log`;
CREATE TABLE `sys_operate_log` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`trace_id` varchar(32) NOT NULL COMMENT '追踪日志id',
`class_name` varchar(255) DEFAULT NULL COMMENT '类名',
`request_url` varchar(255) NOT NULL COMMENT '请求的地址',
`request_param` text COMMENT '请求的参数',
`request_method` varchar(100) NOT NULL COMMENT '请求的方法名',
`response_param` text COMMENT '返回参数',
`operate_id` int(11) NOT NULL COMMENT '操作人ID',
`operate_name` varchar(20) DEFAULT NULL COMMENT '操作人姓名',
`add_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='操作员操作记录表';
-- ----------------------------
-- Records of sys_operate_log
-- ----------------------------
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL COMMENT '角色名',
`remark` varchar(255) DEFAULT NULL,
`add_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`status` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='角色表';
-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`role_id` int(11) DEFAULT NULL COMMENT '角色id',
`menu_id` int(11) DEFAULT NULL COMMENT '菜单id',
`add_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='角色菜单表';
-- ----------------------------
-- Table structure for sys_role_operate
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_operate`;
CREATE TABLE `sys_role_operate` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`operate_id` int(11) DEFAULT NULL,
`role_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='操作员与角色关系表'; | the_stack |
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: fill_search_vector_for_location(); Type: FUNCTION; Schema: public; Owner: -
--
CREATE FUNCTION public.fill_search_vector_for_location() RETURNS trigger
LANGUAGE plpgsql
AS $$
declare
location_organization record;
location_services_keywords record;
location_services_description record;
location_services_name record;
service_categories record;
begin
select name into location_organization from organizations where id = new.organization_id;
select string_agg(keywords, ' ') as keywords into location_services_keywords from services where location_id = new.id;
select description into location_services_description from services where location_id = new.id;
select name into location_services_name from services where location_id = new.id;
select string_agg(categories.name, ' ') as name into service_categories from locations
JOIN services ON services.location_id = new.id
JOIN categories_services ON categories_services.service_id = services.id
JOIN categories ON categories.id = categories_services.category_id;
new.tsv_body :=
setweight(to_tsvector('pg_catalog.english', coalesce(new.name, '')), 'B') ||
setweight(to_tsvector('pg_catalog.english', coalesce(new.description, '')), 'A') ||
setweight(to_tsvector('pg_catalog.english', coalesce(location_organization.name, '')), 'B') ||
setweight(to_tsvector('pg_catalog.english', coalesce(location_services_description.description, '')), 'A') ||
setweight(to_tsvector('pg_catalog.english', coalesce(location_services_name.name, '')), 'B') ||
setweight(to_tsvector('pg_catalog.english', coalesce(location_services_keywords.keywords, '')), 'B') ||
setweight(to_tsvector('pg_catalog.english', coalesce(service_categories.name, '')), 'A');
return new;
end
$$;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: addresses; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.addresses (
id integer NOT NULL,
location_id integer,
address_1 text,
city text,
state_province text,
postal_code text,
created_at timestamp without time zone,
updated_at timestamp without time zone,
country character varying(255) NOT NULL,
address_2 character varying(255)
);
--
-- Name: addresses_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.addresses_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: addresses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.addresses_id_seq OWNED BY public.addresses.id;
--
-- Name: admins; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.admins (
id integer NOT NULL,
email character varying(255) DEFAULT ''::character varying NOT NULL,
encrypted_password character varying(255) DEFAULT ''::character varying NOT NULL,
name character varying(255) DEFAULT ''::character varying NOT NULL,
reset_password_token character varying(255),
reset_password_sent_at timestamp without time zone,
remember_created_at timestamp without time zone,
sign_in_count integer DEFAULT 0 NOT NULL,
current_sign_in_at timestamp without time zone,
last_sign_in_at timestamp without time zone,
current_sign_in_ip character varying(255),
last_sign_in_ip character varying(255),
confirmation_token character varying(255),
confirmed_at timestamp without time zone,
confirmation_sent_at timestamp without time zone,
unconfirmed_email character varying(255),
created_at timestamp without time zone,
updated_at timestamp without time zone,
super_admin boolean DEFAULT false
);
--
-- Name: admins_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.admins_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: admins_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.admins_id_seq OWNED BY public.admins.id;
--
-- Name: api_applications; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.api_applications (
id integer NOT NULL,
user_id integer,
name text,
main_url text,
callback_url text,
api_token text,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: api_applications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.api_applications_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: api_applications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.api_applications_id_seq OWNED BY public.api_applications.id;
--
-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.ar_internal_metadata (
key character varying NOT NULL,
value character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: categories; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.categories (
id integer NOT NULL,
name text,
taxonomy_id text,
slug text,
created_at timestamp without time zone,
updated_at timestamp without time zone,
ancestry character varying(255)
);
--
-- Name: categories_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.categories_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: categories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.categories_id_seq OWNED BY public.categories.id;
--
-- Name: categories_services; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.categories_services (
category_id integer NOT NULL,
service_id integer NOT NULL
);
--
-- Name: contacts; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.contacts (
id integer NOT NULL,
location_id integer,
name text,
title text,
email text,
created_at timestamp without time zone,
updated_at timestamp without time zone,
department character varying(255),
organization_id integer,
service_id integer
);
--
-- Name: contacts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.contacts_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: contacts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.contacts_id_seq OWNED BY public.contacts.id;
--
-- Name: friendly_id_slugs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.friendly_id_slugs (
id integer NOT NULL,
slug character varying(255) NOT NULL,
sluggable_id integer NOT NULL,
sluggable_type character varying(40),
created_at timestamp without time zone
);
--
-- Name: friendly_id_slugs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.friendly_id_slugs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: friendly_id_slugs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.friendly_id_slugs_id_seq OWNED BY public.friendly_id_slugs.id;
--
-- Name: holiday_schedules; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.holiday_schedules (
id integer NOT NULL,
location_id integer,
service_id integer,
closed boolean NOT NULL,
start_date date NOT NULL,
end_date date NOT NULL,
opens_at time without time zone,
closes_at time without time zone
);
--
-- Name: holiday_schedules_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.holiday_schedules_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: holiday_schedules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.holiday_schedules_id_seq OWNED BY public.holiday_schedules.id;
--
-- Name: locations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.locations (
id integer NOT NULL,
organization_id integer,
accessibility text,
admin_emails text[] DEFAULT '{}'::text[],
description text,
latitude double precision,
longitude double precision,
languages text[] DEFAULT '{}'::text[],
name text,
short_desc text,
transportation text,
slug text,
created_at timestamp without time zone,
updated_at timestamp without time zone,
tsv_body tsvector,
alternate_name character varying(255),
virtual boolean DEFAULT false,
active boolean DEFAULT true,
website character varying(255),
email character varying(255)
);
--
-- Name: locations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.locations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: locations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.locations_id_seq OWNED BY public.locations.id;
--
-- Name: mail_addresses; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.mail_addresses (
id integer NOT NULL,
location_id integer,
attention text,
address_1 text,
city text,
state_province text,
postal_code text,
created_at timestamp without time zone,
updated_at timestamp without time zone,
country character varying(255) NOT NULL,
address_2 character varying(255)
);
--
-- Name: mail_addresses_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.mail_addresses_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: mail_addresses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.mail_addresses_id_seq OWNED BY public.mail_addresses.id;
--
-- Name: organizations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.organizations (
id integer NOT NULL,
name text,
slug text,
created_at timestamp without time zone,
updated_at timestamp without time zone,
alternate_name character varying(255),
date_incorporated date,
description text NOT NULL,
email character varying(255),
legal_status character varying(255),
tax_id character varying(255),
tax_status character varying(255),
website character varying(255),
funding_sources character varying(255)[] DEFAULT '{}'::character varying[],
accreditations character varying(255)[] DEFAULT '{}'::character varying[],
licenses character varying(255)[] DEFAULT '{}'::character varying[]
);
--
-- Name: organizations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.organizations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: organizations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.organizations_id_seq OWNED BY public.organizations.id;
--
-- Name: phones; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.phones (
id integer NOT NULL,
location_id integer,
number text,
department text,
extension text,
vanity_number text,
created_at timestamp without time zone,
updated_at timestamp without time zone,
number_type character varying(255),
country_prefix character varying(255),
contact_id integer,
organization_id integer,
service_id integer
);
--
-- Name: phones_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.phones_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: phones_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.phones_id_seq OWNED BY public.phones.id;
--
-- Name: programs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.programs (
id integer NOT NULL,
organization_id integer,
name character varying(255),
alternate_name character varying(255),
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: programs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.programs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: programs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.programs_id_seq OWNED BY public.programs.id;
--
-- Name: regular_schedules; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.regular_schedules (
id integer NOT NULL,
weekday integer,
opens_at time without time zone,
closes_at time without time zone,
service_id integer,
location_id integer
);
--
-- Name: regular_schedules_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.regular_schedules_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: regular_schedules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.regular_schedules_id_seq OWNED BY public.regular_schedules.id;
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.schema_migrations (
version character varying(255) NOT NULL
);
--
-- Name: services; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.services (
id integer NOT NULL,
location_id integer,
audience text,
description text NOT NULL,
eligibility text,
fees text,
application_process text,
name text,
wait_time text,
funding_sources text,
service_areas text,
keywords text,
created_at timestamp without time zone,
updated_at timestamp without time zone,
accepted_payments character varying(255)[] DEFAULT '{}'::character varying[],
alternate_name character varying(255),
email character varying(255),
languages character varying(255)[] DEFAULT '{}'::character varying[],
required_documents character varying(255)[] DEFAULT '{}'::character varying[],
status character varying(255) DEFAULT 'active'::character varying NOT NULL,
website character varying(255),
program_id integer,
interpretation_services text
);
--
-- Name: services_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.services_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: services_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.services_id_seq OWNED BY public.services.id;
--
-- Name: users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.users (
id integer NOT NULL,
email character varying(255) DEFAULT ''::character varying NOT NULL,
encrypted_password character varying(255) DEFAULT ''::character varying NOT NULL,
name character varying(255) DEFAULT ''::character varying NOT NULL,
reset_password_token character varying(255),
reset_password_sent_at timestamp without time zone,
remember_created_at timestamp without time zone,
sign_in_count integer DEFAULT 0 NOT NULL,
current_sign_in_at timestamp without time zone,
last_sign_in_at timestamp without time zone,
current_sign_in_ip character varying(255),
last_sign_in_ip character varying(255),
confirmation_token character varying(255),
confirmed_at timestamp without time zone,
confirmation_sent_at timestamp without time zone,
unconfirmed_email character varying(255),
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
--
-- Name: addresses id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.addresses ALTER COLUMN id SET DEFAULT nextval('public.addresses_id_seq'::regclass);
--
-- Name: admins id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.admins ALTER COLUMN id SET DEFAULT nextval('public.admins_id_seq'::regclass);
--
-- Name: api_applications id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.api_applications ALTER COLUMN id SET DEFAULT nextval('public.api_applications_id_seq'::regclass);
--
-- Name: categories id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.categories ALTER COLUMN id SET DEFAULT nextval('public.categories_id_seq'::regclass);
--
-- Name: contacts id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.contacts ALTER COLUMN id SET DEFAULT nextval('public.contacts_id_seq'::regclass);
--
-- Name: friendly_id_slugs id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.friendly_id_slugs ALTER COLUMN id SET DEFAULT nextval('public.friendly_id_slugs_id_seq'::regclass);
--
-- Name: holiday_schedules id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.holiday_schedules ALTER COLUMN id SET DEFAULT nextval('public.holiday_schedules_id_seq'::regclass);
--
-- Name: locations id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.locations ALTER COLUMN id SET DEFAULT nextval('public.locations_id_seq'::regclass);
--
-- Name: mail_addresses id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.mail_addresses ALTER COLUMN id SET DEFAULT nextval('public.mail_addresses_id_seq'::regclass);
--
-- Name: organizations id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organizations ALTER COLUMN id SET DEFAULT nextval('public.organizations_id_seq'::regclass);
--
-- Name: phones id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.phones ALTER COLUMN id SET DEFAULT nextval('public.phones_id_seq'::regclass);
--
-- Name: programs id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.programs ALTER COLUMN id SET DEFAULT nextval('public.programs_id_seq'::regclass);
--
-- Name: regular_schedules id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.regular_schedules ALTER COLUMN id SET DEFAULT nextval('public.regular_schedules_id_seq'::regclass);
--
-- Name: services id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.services ALTER COLUMN id SET DEFAULT nextval('public.services_id_seq'::regclass);
--
-- Name: users id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
--
-- Name: addresses addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.addresses
ADD CONSTRAINT addresses_pkey PRIMARY KEY (id);
--
-- Name: admins admins_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.admins
ADD CONSTRAINT admins_pkey PRIMARY KEY (id);
--
-- Name: api_applications api_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.api_applications
ADD CONSTRAINT api_applications_pkey PRIMARY KEY (id);
--
-- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.ar_internal_metadata
ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
--
-- Name: categories categories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.categories
ADD CONSTRAINT categories_pkey PRIMARY KEY (id);
--
-- Name: contacts contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.contacts
ADD CONSTRAINT contacts_pkey PRIMARY KEY (id);
--
-- Name: friendly_id_slugs friendly_id_slugs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.friendly_id_slugs
ADD CONSTRAINT friendly_id_slugs_pkey PRIMARY KEY (id);
--
-- Name: holiday_schedules holiday_schedules_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.holiday_schedules
ADD CONSTRAINT holiday_schedules_pkey PRIMARY KEY (id);
--
-- Name: locations locations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.locations
ADD CONSTRAINT locations_pkey PRIMARY KEY (id);
--
-- Name: mail_addresses mail_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.mail_addresses
ADD CONSTRAINT mail_addresses_pkey PRIMARY KEY (id);
--
-- Name: organizations organizations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organizations
ADD CONSTRAINT organizations_pkey PRIMARY KEY (id);
--
-- Name: phones phones_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.phones
ADD CONSTRAINT phones_pkey PRIMARY KEY (id);
--
-- Name: programs programs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.programs
ADD CONSTRAINT programs_pkey PRIMARY KEY (id);
--
-- Name: regular_schedules regular_schedules_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.regular_schedules
ADD CONSTRAINT regular_schedules_pkey PRIMARY KEY (id);
--
-- Name: services services_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.services
ADD CONSTRAINT services_pkey PRIMARY KEY (id);
--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: categories_name; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX categories_name ON public.categories USING gin (to_tsvector('english'::regconfig, name));
--
-- Name: index_addresses_on_location_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_addresses_on_location_id ON public.addresses USING btree (location_id);
--
-- Name: index_admins_on_confirmation_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_admins_on_confirmation_token ON public.admins USING btree (confirmation_token);
--
-- Name: index_admins_on_email; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_admins_on_email ON public.admins USING btree (email);
--
-- Name: index_admins_on_reset_password_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_admins_on_reset_password_token ON public.admins USING btree (reset_password_token);
--
-- Name: index_api_applications_on_api_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_api_applications_on_api_token ON public.api_applications USING btree (api_token);
--
-- Name: index_api_applications_on_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_api_applications_on_user_id ON public.api_applications USING btree (user_id);
--
-- Name: index_categories_on_ancestry; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_categories_on_ancestry ON public.categories USING btree (ancestry);
--
-- Name: index_categories_on_slug; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_categories_on_slug ON public.categories USING btree (slug);
--
-- Name: index_categories_services_on_category_id_and_service_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_categories_services_on_category_id_and_service_id ON public.categories_services USING btree (category_id, service_id);
--
-- Name: index_categories_services_on_service_id_and_category_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_categories_services_on_service_id_and_category_id ON public.categories_services USING btree (service_id, category_id);
--
-- Name: index_contacts_on_location_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_contacts_on_location_id ON public.contacts USING btree (location_id);
--
-- Name: index_contacts_on_organization_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_contacts_on_organization_id ON public.contacts USING btree (organization_id);
--
-- Name: index_contacts_on_service_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_contacts_on_service_id ON public.contacts USING btree (service_id);
--
-- Name: index_friendly_id_slugs_on_slug_and_sluggable_type; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_friendly_id_slugs_on_slug_and_sluggable_type ON public.friendly_id_slugs USING btree (slug, sluggable_type);
--
-- Name: index_friendly_id_slugs_on_sluggable_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_friendly_id_slugs_on_sluggable_id ON public.friendly_id_slugs USING btree (sluggable_id);
--
-- Name: index_friendly_id_slugs_on_sluggable_type; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_friendly_id_slugs_on_sluggable_type ON public.friendly_id_slugs USING btree (sluggable_type);
--
-- Name: index_holiday_schedules_on_location_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_holiday_schedules_on_location_id ON public.holiday_schedules USING btree (location_id);
--
-- Name: index_holiday_schedules_on_service_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_holiday_schedules_on_service_id ON public.holiday_schedules USING btree (service_id);
--
-- Name: index_locations_on_active; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_locations_on_active ON public.locations USING btree (active);
--
-- Name: index_locations_on_admin_emails; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_locations_on_admin_emails ON public.locations USING gin (admin_emails);
--
-- Name: index_locations_on_languages; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_locations_on_languages ON public.locations USING gin (languages);
--
-- Name: index_locations_on_latitude_and_longitude; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_locations_on_latitude_and_longitude ON public.locations USING btree (latitude, longitude);
--
-- Name: index_locations_on_organization_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_locations_on_organization_id ON public.locations USING btree (organization_id);
--
-- Name: index_locations_on_slug; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_locations_on_slug ON public.locations USING btree (slug);
--
-- Name: index_locations_on_tsv_body; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_locations_on_tsv_body ON public.locations USING gin (tsv_body);
--
-- Name: index_mail_addresses_on_location_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_mail_addresses_on_location_id ON public.mail_addresses USING btree (location_id);
--
-- Name: index_organizations_on_slug; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_organizations_on_slug ON public.organizations USING btree (slug);
--
-- Name: index_phones_on_contact_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_phones_on_contact_id ON public.phones USING btree (contact_id);
--
-- Name: index_phones_on_location_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_phones_on_location_id ON public.phones USING btree (location_id);
--
-- Name: index_phones_on_organization_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_phones_on_organization_id ON public.phones USING btree (organization_id);
--
-- Name: index_phones_on_service_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_phones_on_service_id ON public.phones USING btree (service_id);
--
-- Name: index_programs_on_organization_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_programs_on_organization_id ON public.programs USING btree (organization_id);
--
-- Name: index_regular_schedules_on_closes_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_regular_schedules_on_closes_at ON public.regular_schedules USING btree (closes_at);
--
-- Name: index_regular_schedules_on_location_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_regular_schedules_on_location_id ON public.regular_schedules USING btree (location_id);
--
-- Name: index_regular_schedules_on_opens_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_regular_schedules_on_opens_at ON public.regular_schedules USING btree (opens_at);
--
-- Name: index_regular_schedules_on_service_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_regular_schedules_on_service_id ON public.regular_schedules USING btree (service_id);
--
-- Name: index_regular_schedules_on_weekday; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_regular_schedules_on_weekday ON public.regular_schedules USING btree (weekday);
--
-- Name: index_services_on_languages; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_services_on_languages ON public.services USING gin (languages);
--
-- Name: index_services_on_location_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_services_on_location_id ON public.services USING btree (location_id);
--
-- Name: index_services_on_program_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_services_on_program_id ON public.services USING btree (program_id);
--
-- Name: index_users_on_confirmation_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_users_on_confirmation_token ON public.users USING btree (confirmation_token);
--
-- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_users_on_email ON public.users USING btree (email);
--
-- Name: index_users_on_reset_password_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_users_on_reset_password_token ON public.users USING btree (reset_password_token);
--
-- Name: locations_description; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX locations_description ON public.locations USING gin (to_tsvector('english'::regconfig, description));
--
-- Name: locations_email_with_varchar_pattern_ops; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX locations_email_with_varchar_pattern_ops ON public.locations USING btree (email varchar_pattern_ops);
--
-- Name: locations_name; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX locations_name ON public.locations USING gin (to_tsvector('english'::regconfig, name));
--
-- Name: locations_website_with_varchar_pattern_ops; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX locations_website_with_varchar_pattern_ops ON public.locations USING btree (website varchar_pattern_ops);
--
-- Name: organizations_name; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX organizations_name ON public.organizations USING gin (to_tsvector('english'::regconfig, name));
--
-- Name: services_service_areas; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX services_service_areas ON public.services USING gin (to_tsvector('english'::regconfig, service_areas));
--
-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version);
--
-- Name: locations locations_search_content_trigger; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER locations_search_content_trigger BEFORE INSERT OR UPDATE ON public.locations FOR EACH ROW EXECUTE FUNCTION public.fill_search_vector_for_location();
--
-- PostgreSQL database dump complete
--
SET search_path TO "$user", public;
INSERT INTO "schema_migrations" (version) VALUES
('20140328034023'),
('20140328034531'),
('20140328034754'),
('20140328035528'),
('20140328041648'),
('20140328041859'),
('20140328042108'),
('20140328042218'),
('20140328042359'),
('20140328043104'),
('20140328044447'),
('20140328052427'),
('20140402222453'),
('20140404220233'),
('20140424182454'),
('20140505011725'),
('20140508030435'),
('20140508030926'),
('20140508031024'),
('20140508194831'),
('20140522153640'),
('20140629181523'),
('20140630171418'),
('20140829154350'),
('20140909031145'),
('20140929221750'),
('20141007144757'),
('20141009185459'),
('20141009204519'),
('20141010031124'),
('20141010155451'),
('20141010171020'),
('20141010171817'),
('20141017154640'),
('20141021195019'),
('20141023040419'),
('20141024022657'),
('20141024025404'),
('20141027154101'),
('20141029170109'),
('20141030012617'),
('20141030204742'),
('20141106215928'),
('20141107161835'),
('20141108042551'),
('20141108183056'),
('20141108194838'),
('20141108214741'),
('20141109021540'),
('20141109022202'),
('20141118132537'),
('20141208165502'),
('20150107163352'),
('20150314204202'),
('20150315202808'),
('20180212023953'); | the_stack |
-- Mar 8, 2016 6:27 PM
-- URL zum Konzept
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Statistic_Count,Statistic_Seconds,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,540668,'Y','de.metas.procurement.base.process.C_FlatrateTerm_Create_ProcurementContract','N',TO_TIMESTAMP('2016-03-08 18:27:54','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.procurement','Y','N','N','N','N','N',0,'Neuen Liefervertrag erstellen','N','Y',0,0,'Java',TO_TIMESTAMP('2016-03-08 18:27:54','YYYY-MM-DD HH24:MI:SS'),100,'C_FlatrateTerm_Create_ProcurementContract')
;
-- Mar 8, 2016 6:27 PM
-- URL zum Konzept
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=540668 AND NOT EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- Mar 8, 2016 6:29 PM
-- URL zum Konzept
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,540323,'C_Flatrate_Conditions.Type_Conditions=''Procuremnt''',TO_TIMESTAMP('2016-03-08 18:29:10','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.procurement','Y','C_Flatrate_Conditions_Procurement','S',TO_TIMESTAMP('2016-03-08 18:29:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Mar 8, 2016 6:29 PM
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,541423,0,540668,540915,19,540323,'C_Flatrate_Conditions_ID',TO_TIMESTAMP('2016-03-08 18:29:26','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.flatrate',0,'Y','N','Y','N','Y','N','Vertragsbedingungen',10,TO_TIMESTAMP('2016-03-08 18:29:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Mar 8, 2016 6:29 PM
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=540915 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- Mar 8, 2016 6:29 PM
-- URL zum Konzept
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy) VALUES (0,0,540668,540320,TO_TIMESTAMP('2016-03-08 18:29:44','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.procurement','Y',TO_TIMESTAMP('2016-03-08 18:29:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Mar 9, 2016 8:10 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,DisplayLogic,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,187,0,540668,540916,30,'C_BPartner_ID',TO_TIMESTAMP('2016-03-09 08:10:16','YYYY-MM-DD HH24:MI:SS'),100,'@C_BPartner_ID@','Bezeichnet einen Geschäftspartner','@C_BPartner_ID@=0','de.metas.procurement',0,'Ein Geschäftspartner ist jemand, mit dem Sie interagieren. Dies kann Lieferanten, Kunden, Mitarbeiter oder Handelsvertreter umfassen.','Y','N','Y','N','Y','N','Geschäftspartner',20,TO_TIMESTAMP('2016-03-09 08:10:16','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Mar 9, 2016 8:10 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=540916 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- Mar 9, 2016 8:11 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,454,0,540668,540917,30,52058,'M_Product_ID',TO_TIMESTAMP('2016-03-09 08:11:14','YYYY-MM-DD HH24:MI:SS'),100,NULL,'de.metas.procurement',0,NULL,'Y','N','N','N','Y','N','Eingekauftes Produkt',30,TO_TIMESTAMP('2016-03-09 08:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Mar 9, 2016 8:11 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=540917 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- Mar 9, 2016 8:12 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,541510,0,540668,540918,30,164,'AD_User_InCharge_ID',TO_TIMESTAMP('2016-03-09 08:12:24','YYYY-MM-DD HH24:MI:SS'),100,'Person, die bei einem fachlichen Problem vom System informiert wird.','de.metas.procurement',0,'Y','N','Y','N','N','N','Betreuer',40,TO_TIMESTAMP('2016-03-09 08:12:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Mar 9, 2016 8:12 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=540918 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- Mar 9, 2016 8:12 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET IsAutocomplete='Y',Updated=TO_TIMESTAMP('2016-03-09 08:12:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540918
;
-- Mar 9, 2016 8:12 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET IsAutocomplete='Y',Updated=TO_TIMESTAMP('2016-03-09 08:12:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540917
;
-- Mar 9, 2016 8:12 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET IsAutocomplete='Y',Updated=TO_TIMESTAMP('2016-03-09 08:12:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540916
;
-- Mar 9, 2016 8:13 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,574,0,540668,540919,15,'StartDate',TO_TIMESTAMP('2016-03-09 08:13:06','YYYY-MM-DD HH24:MI:SS'),100,'@#Date@','First effective day (inclusive)','de.metas.procurement',0,'The Start Date indicates the first or starting date','Y','N','Y','N','Y','N','Anfangsdatum',50,TO_TIMESTAMP('2016-03-09 08:13:06','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Mar 9, 2016 8:13 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=540919 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- Mar 9, 2016 8:13 AM
-- URL zum Konzept
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy) VALUES (0,0,540668,540310,TO_TIMESTAMP('2016-03-09 08:13:50','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.procurement','Y',TO_TIMESTAMP('2016-03-09 08:13:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Mar 9, 2016 8:14 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET DisplayLogic=NULL,Updated=TO_TIMESTAMP('2016-03-09 08:14:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540916
;
-- Mar 9, 2016 9:47 AM
-- URL zum Konzept
UPDATE AD_Process SET Classname='de.metas.procurement.base.process.C_Flatrate_Term_Create_ProcurementContract', Value='C_Flatrate_Term_Create_ProcurementContract',Updated=TO_TIMESTAMP('2016-03-09 09:47:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540668
;
-- Mar 9, 2016 9:50 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,215,0,540668,540920,19,210,'C_UOM_ID',TO_TIMESTAMP('2016-03-09 09:50:19','YYYY-MM-DD HH24:MI:SS'),100,'Maßeinheit','de.metas.procurement',0,'Eine eindeutige (nicht monetäre) Maßeinheit','Y','N','Y','N','Y','N','Maßeinheit',60,TO_TIMESTAMP('2016-03-09 09:50:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Mar 9, 2016 9:50 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=540920 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- Mar 9, 2016 9:50 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET IsActive='Y', SeqNo=40,Updated=TO_TIMESTAMP('2016-03-09 09:50:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540920
;
-- Mar 9, 2016 9:50 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET IsActive='Y', SeqNo=50,Updated=TO_TIMESTAMP('2016-03-09 09:50:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540918
;
-- Mar 9, 2016 9:50 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET IsActive='Y', SeqNo=60,Updated=TO_TIMESTAMP('2016-03-09 09:50:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540919
;
-- Mar 9, 2016 10:06 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET Description=NULL, Help=NULL, IsCentrallyMaintained='N', IsRange='Y', Name='Lieferzeitraum',Updated=TO_TIMESTAMP('2016-03-09 10:06:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540919
;
-- Mar 9, 2016 10:06 AM
-- URL zum Konzept
UPDATE AD_Process_Para_Trl SET IsTranslated='N' WHERE AD_Process_Para_ID=540919
;
-- Mar 9, 2016 10:25 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET AD_Element_ID=NULL, ColumnName='Dates',Updated=TO_TIMESTAMP('2016-03-09 10:25:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540919
;
-- Mar 9, 2016 10:46 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,193,0,540668,540921,19,'C_Currency_ID',TO_TIMESTAMP('2016-03-09 10:46:27','YYYY-MM-DD HH24:MI:SS'),100,'@#C_Currency_ID@','Die Währung für diesen Eintrag','de.metas.procurement',0,'Bezeichnet die auf Dokumenten oder Berichten verwendete Währung','Y','N','Y','N','N','N','Währung',70,TO_TIMESTAMP('2016-03-09 10:46:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Mar 9, 2016 10:46 AM
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=540921 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- Mar 9, 2016 10:48 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2016-03-09 10:48:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540921
;
-- Mar 9, 2016 10:54 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET DefaultValue2='@#Date@',Updated=TO_TIMESTAMP('2016-03-09 10:54:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540919
;
-- Mar 9, 2016 10:58 AM
-- URL zum Konzept
UPDATE AD_Process_Para SET DefaultValue2=NULL,Updated=TO_TIMESTAMP('2016-03-09 10:58:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540919
;
-- Mar 9, 2016 11:35 AM
-- URL zum Konzept
UPDATE AD_Process SET RefreshAllAfterExecution='Y',Updated=TO_TIMESTAMP('2016-03-09 11:35:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540668
; | the_stack |
-- MySQL dump 10.13 Distrib 8.0.18, for osx10.15 (x86_64)
--
-- Host: 127.0.0.1 Database: laravel_starter
-- ------------------------------------------------------
-- Server version 8.0.18
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `admin_menu`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_menu` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` int(11) NOT NULL DEFAULT '0',
`order` int(11) NOT NULL DEFAULT '0',
`title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`uri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`permission` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `admin_menu`
--
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (1,0,1,'Dashboard','fa-bar-chart','/',NULL,NULL,NULL),(2,0,2,'Admin','fa-tasks','',NULL,NULL,NULL),(3,2,3,'Users','fa-users','auth/users',NULL,NULL,NULL),(4,2,4,'Roles','fa-user','auth/roles',NULL,NULL,NULL),(5,2,5,'Permission','fa-ban','auth/permissions',NULL,NULL,NULL),(6,2,6,'Menu','fa-bars','auth/menu',NULL,NULL,NULL),(7,2,7,'Operation log','fa-history','auth/logs',NULL,NULL,NULL);
--
-- Table structure for table `admin_operation_log`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_operation_log` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`input` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `admin_operation_log_user_id_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `admin_operation_log`
--
--
-- Table structure for table `admin_permission`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_permission` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`http_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`http_path` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `admin_permissions_name_unique` (`name`),
UNIQUE KEY `admin_permissions_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `admin_permission`
--
INSERT INTO `admin_permission` (`id`, `name`, `slug`, `http_method`, `http_path`, `created_at`, `updated_at`) VALUES (1,'All permission','*','','*',NULL,NULL),(2,'Dashboard','dashboard','GET','/',NULL,NULL),(3,'Login','auth.login','','/auth/login\r\n/auth/logout',NULL,NULL),(4,'User setting','auth.setting','GET,PUT','/auth/setting',NULL,NULL),(5,'Auth management','auth.management','','/auth/roles\r\n/auth/permissions\r\n/auth/menu\r\n/auth/logs',NULL,NULL);
--
-- Table structure for table `admin_role`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_role` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `admin_roles_name_unique` (`name`),
UNIQUE KEY `admin_roles_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `admin_role`
--
INSERT INTO `admin_role` (`id`, `name`, `slug`, `created_at`, `updated_at`) VALUES (1,'Administrator','administrator','2021-02-07 01:24:47','2021-02-07 01:24:47');
--
-- Table structure for table `admin_role_menu`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_role_menu` (
`role_id` int(11) NOT NULL,
`menu_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
KEY `admin_role_menu_role_id_menu_id_index` (`role_id`,`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `admin_role_menu`
--
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1,2,NULL,NULL),(1,2,NULL,NULL);
--
-- Table structure for table `admin_role_permission`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_role_permission` (
`role_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
KEY `admin_role_permissions_role_id_permission_id_index` (`role_id`,`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `admin_role_permission`
--
INSERT INTO `admin_role_permission` (`role_id`, `permission_id`, `created_at`, `updated_at`) VALUES (1,1,NULL,NULL),(1,1,NULL,NULL);
--
-- Table structure for table `admin_user`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_user` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(190) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `admin_users_username_unique` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `admin_user`
--
INSERT INTO `admin_user` (`id`, `username`, `password`, `name`, `avatar`, `remember_token`, `created_at`, `updated_at`) VALUES (1,'admin','$2y$10$7kMHGQV5jo0qsMEOpOW4M.AmqobLb3ouOU0yjc7i50vFf.tq8QqTi','Administrator',NULL,'vNi31McdRq3iGqTLYuNP9TXBRqfB5HDn3QsyU79lEIaBsbbyBAJOWmXZt8Jm','2021-02-07 01:24:46','2021-02-07 01:24:46');
--
-- Table structure for table `admin_user_permission`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_user_permission` (
`user_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
KEY `admin_user_permissions_user_id_permission_id_index` (`user_id`,`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `admin_user_permission`
--
--
-- Table structure for table `admin_user_role`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_user_role` (
`role_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
KEY `admin_role_users_role_id_user_id_index` (`role_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `admin_user_role`
--
INSERT INTO `admin_user_role` (`role_id`, `user_id`, `created_at`, `updated_at`) VALUES (1,1,NULL,NULL),(1,1,NULL,NULL);
--
-- Table structure for table `password_resets`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `password_resets`
--
--
-- Table structure for table `tz_sms_log`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tz_sms_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL COMMENT '用户id',
`mobile` varchar(255) DEFAULT NULL,
`content` varchar(255) DEFAULT NULL COMMENT '短信内容',
`code` varchar(255) DEFAULT NULL,
`type` int(11) DEFAULT NULL COMMENT '短信类型1注册2验证',
`response` json DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='短信发送表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tz_sms_log`
--
--
-- Table structure for table `tz_upload_file`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tz_upload_file` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`filename` varchar(255) DEFAULT NULL COMMENT '文件名',
`ext` varchar(255) DEFAULT NULL COMMENT '文件后缀',
`url` varchar(255) DEFAULT NULL COMMENT '七牛云url',
`size` varchar(255) DEFAULT NULL COMMENT '文件大小',
`md5` varchar(255) DEFAULT NULL,
`mime_type` varchar(255) DEFAULT NULL COMMENT '文件mime_type',
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='文件附件表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tz_upload_file`
--
--
-- Table structure for table `tz_user`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tz_user` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tz_user`
--
SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2021-02-09 0:32:47 | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for account_data
-- ----------------------------
DROP TABLE IF EXISTS `account_data`;
CREATE TABLE `account_data` (
`id` bigint(20) NOT NULL,
`user_id` bigint(20) DEFAULT NULL,
`mi_regid` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for captcha_record
-- ----------------------------
DROP TABLE IF EXISTS `captcha_record`;
CREATE TABLE `captcha_record` (
`id` bigint(20) DEFAULT NULL,
`mobile` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`captcha` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
`expire_time` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for chat_msg
-- ----------------------------
DROP TABLE IF EXISTS `chat_msg`;
CREATE TABLE `chat_msg` (
`id` bigint(20) DEFAULT NULL,
`sender_id` bigint(20) DEFAULT NULL,
`receiver_id` bigint(20) DEFAULT NULL,
`msg_body` text COLLATE utf8mb4_unicode_ci,
`msg_type` int(11) DEFAULT NULL,
`create_time` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for daily_check_in
-- ----------------------------
DROP TABLE IF EXISTS `daily_check_in`;
CREATE TABLE `daily_check_in` (
`id` bigint(20) NOT NULL,
`user_id` bigint(20) NOT NULL,
`create_time` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for file_resource
-- ----------------------------
DROP TABLE IF EXISTS `file_resource`;
CREATE TABLE `file_resource` (
`file_id` bigint(20) NOT NULL,
`create_date` datetime DEFAULT NULL,
`creater` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`file_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`file_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`states` int(11) NOT NULL,
`url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for fly_shard
-- ----------------------------
DROP TABLE IF EXISTS `fly_shard`;
CREATE TABLE `fly_shard` (
`name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`count` int(11) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for fly_token
-- ----------------------------
DROP TABLE IF EXISTS `fly_token`;
CREATE TABLE `fly_token` (
`user_id` bigint(20) NOT NULL,
`token` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`expire_time` datetime DEFAULT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for fly_user
-- ----------------------------
DROP TABLE IF EXISTS `fly_user`;
CREATE TABLE `fly_user` (
`id` bigint(20) NOT NULL,
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`status` int(3) DEFAULT '0',
`password` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`mobile` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for goods
-- ----------------------------
DROP TABLE IF EXISTS `goods`;
CREATE TABLE `goods` (
`id` bigint(20) NOT NULL,
`version` int(11) DEFAULT '1' COMMENT '乐观锁的版本号',
`stock` int(11) DEFAULT '1' COMMENT '库存量',
`big_img` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`catalog_id` int(20) DEFAULT NULL,
`hot` bit(1) NOT NULL,
`img` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`img_list` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`introduce` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`origin_price` int(11) DEFAULT NULL,
`price` int(11) NOT NULL,
`product_html` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`sort_value` int(11) DEFAULT NULL,
`status` int(11) NOT NULL DEFAULT '1',
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for order_0
-- ----------------------------
DROP TABLE IF EXISTS `order_0`;
CREATE TABLE `order_0` (
`id` bigint(20) DEFAULT NULL,
`user_id` bigint(20) DEFAULT NULL,
`address` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '地址',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp(3) NULL DEFAULT NULL COMMENT '更新时间',
`consignee` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '收货人',
`consignee_moblie` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '收货人电话',
`remark` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
`province` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '省份',
`city` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '城市',
`district` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '区县',
`express_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`deliver_time` datetime DEFAULT NULL COMMENT '发货时间',
`confirm_time` datetime DEFAULT NULL COMMENT '确认时间',
`delivery_way` int(11) DEFAULT NULL COMMENT '配送方式 0 快递 1自提',
`cart_item_list` varchar(3000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '购物车里所有的商品信息(json string)',
`discount_list` varchar(3000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用的所有优惠券(json string)',
`amount` bigint(12) DEFAULT NULL COMMENT '商品总价格(不含运费)',
`postage` bigint(12) DEFAULT NULL COMMENT '邮费',
`should_pay` bigint(12) DEFAULT NULL COMMENT 'shouldPay = 商品总价格 + postage - discountList总金额'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for order_1
-- ----------------------------
DROP TABLE IF EXISTS `order_1`;
CREATE TABLE `order_1` (
`id` bigint(20) DEFAULT NULL,
`user_id` bigint(20) DEFAULT NULL,
`address` varchar(200) CHARACTER SET utf8 DEFAULT NULL COMMENT '地址',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp(3) NULL DEFAULT NULL COMMENT '更新时间',
`consignee` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '收货人',
`consignee_moblie` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '收货人电话',
`remark` varchar(200) CHARACTER SET utf8 DEFAULT NULL COMMENT '备注',
`province` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '省份',
`city` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '城市',
`district` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '区县',
`express_id` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`deliver_time` datetime DEFAULT NULL COMMENT '发货时间',
`confirm_time` datetime DEFAULT NULL COMMENT '确认时间',
`delivery_way` int(11) DEFAULT NULL COMMENT '配送方式 0 快递 1自提',
`cart_item_list` varchar(3000) CHARACTER SET utf8 DEFAULT NULL COMMENT '购物车里所有的商品信息(json string)',
`discount_list` varchar(3000) CHARACTER SET utf8 DEFAULT NULL COMMENT '使用的所有优惠券(json string)',
`amount` bigint(12) DEFAULT NULL COMMENT '商品总价格(不含运费)',
`postage` bigint(12) DEFAULT NULL COMMENT '邮费',
`should_pay` bigint(12) DEFAULT NULL COMMENT 'shouldPay = 商品总价格 + postage - discountList总金额'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for order_2
-- ----------------------------
DROP TABLE IF EXISTS `order_2`;
CREATE TABLE `order_2` (
`id` bigint(20) DEFAULT NULL,
`user_id` bigint(20) DEFAULT NULL,
`address` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '地址',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp(3) NULL DEFAULT NULL COMMENT '更新时间',
`consignee` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '收货人',
`consignee_moblie` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '收货人电话',
`remark` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
`province` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '省份',
`city` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '城市',
`district` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '区县',
`express_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`deliver_time` datetime DEFAULT NULL COMMENT '发货时间',
`confirm_time` datetime DEFAULT NULL COMMENT '确认时间',
`delivery_way` int(11) DEFAULT NULL COMMENT '配送方式 0 快递 1自提',
`cart_item_list` varchar(3000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '购物车里所有的商品信息(json string)',
`discount_list` varchar(3000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用的所有优惠券(json string)',
`amount` bigint(12) DEFAULT NULL COMMENT '商品总价格(不含运费)',
`postage` bigint(12) DEFAULT NULL COMMENT '邮费',
`should_pay` bigint(12) DEFAULT NULL COMMENT 'shouldPay = 商品总价格 + postage - discountList总金额'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for order_3
-- ----------------------------
DROP TABLE IF EXISTS `order_3`;
CREATE TABLE `order_3` (
`id` bigint(20) DEFAULT NULL,
`user_id` bigint(20) DEFAULT NULL,
`address` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '地址',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp(3) NULL DEFAULT NULL COMMENT '更新时间',
`consignee` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '收货人',
`consignee_moblie` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '收货人电话',
`remark` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
`province` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '省份',
`city` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '城市',
`district` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '区县',
`express_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`deliver_time` datetime DEFAULT NULL COMMENT '发货时间',
`confirm_time` datetime DEFAULT NULL COMMENT '确认时间',
`delivery_way` int(11) DEFAULT NULL COMMENT '配送方式 0 快递 1自提',
`cart_item_list` varchar(3000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '购物车里所有的商品信息(json string)',
`discount_list` varchar(3000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用的所有优惠券(json string)',
`amount` bigint(12) DEFAULT NULL COMMENT '商品总价格(不含运费)',
`postage` bigint(12) DEFAULT NULL COMMENT '邮费',
`should_pay` bigint(12) DEFAULT NULL COMMENT 'shouldPay = 商品总价格 + postage - discountList总金额'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for pay_msg
-- ----------------------------
DROP TABLE IF EXISTS `pay_msg`;
CREATE TABLE `pay_msg` (
`msg_id` bigint(20) DEFAULT NULL,
`title` varchar(200) DEFAULT NULL,
`text` varchar(255) DEFAULT NULL,
`create_time` timestamp(3) NULL DEFAULT NULL,
`pay_type` int(3) DEFAULT '0',
`amount` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for star_comment
-- ----------------------------
DROP TABLE IF EXISTS `star_comment`;
CREATE TABLE `star_comment` (
`id` bigint(20) DEFAULT NULL,
`comment_text` text COLLATE utf8mb4_unicode_ci,
`create_time` datetime DEFAULT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`user_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment
-- ----------------------------
DROP TABLE IF EXISTS `star_moment`;
CREATE TABLE `star_moment` (
`id` bigint(20) DEFAULT NULL,
`content` text COLLATE utf8mb4_unicode_ci,
`img` text COLLATE utf8mb4_unicode_ci,
`create_time` datetime DEFAULT NULL,
`like_count` int(11) DEFAULT NULL,
`user_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_0
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_0`;
CREATE TABLE `star_moment_like_0` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_1
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_1`;
CREATE TABLE `star_moment_like_1` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_10
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_10`;
CREATE TABLE `star_moment_like_10` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_11
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_11`;
CREATE TABLE `star_moment_like_11` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_12
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_12`;
CREATE TABLE `star_moment_like_12` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_13
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_13`;
CREATE TABLE `star_moment_like_13` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_14
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_14`;
CREATE TABLE `star_moment_like_14` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_15
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_15`;
CREATE TABLE `star_moment_like_15` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_16
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_16`;
CREATE TABLE `star_moment_like_16` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_17
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_17`;
CREATE TABLE `star_moment_like_17` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_18
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_18`;
CREATE TABLE `star_moment_like_18` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_19
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_19`;
CREATE TABLE `star_moment_like_19` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_2
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_2`;
CREATE TABLE `star_moment_like_2` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_20
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_20`;
CREATE TABLE `star_moment_like_20` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_21
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_21`;
CREATE TABLE `star_moment_like_21` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_22
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_22`;
CREATE TABLE `star_moment_like_22` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_23
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_23`;
CREATE TABLE `star_moment_like_23` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_24
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_24`;
CREATE TABLE `star_moment_like_24` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_25
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_25`;
CREATE TABLE `star_moment_like_25` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_26
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_26`;
CREATE TABLE `star_moment_like_26` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_27
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_27`;
CREATE TABLE `star_moment_like_27` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_28
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_28`;
CREATE TABLE `star_moment_like_28` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_29
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_29`;
CREATE TABLE `star_moment_like_29` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_3
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_3`;
CREATE TABLE `star_moment_like_3` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_30
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_30`;
CREATE TABLE `star_moment_like_30` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_31
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_31`;
CREATE TABLE `star_moment_like_31` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_4
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_4`;
CREATE TABLE `star_moment_like_4` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_5
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_5`;
CREATE TABLE `star_moment_like_5` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_6
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_6`;
CREATE TABLE `star_moment_like_6` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_7
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_7`;
CREATE TABLE `star_moment_like_7` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_8
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_8`;
CREATE TABLE `star_moment_like_8` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_moment_like_9
-- ----------------------------
DROP TABLE IF EXISTS `star_moment_like_9`;
CREATE TABLE `star_moment_like_9` (
`id` bigint(20) NOT NULL,
`moment_id` bigint(20) DEFAULT NULL,
`like_user_id` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for star_topic
-- ----------------------------
DROP TABLE IF EXISTS `star_topic`;
CREATE TABLE `star_topic` (
`topic_id` bigint(20) NOT NULL COMMENT '话题ID',
`title` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '话题标题',
`img` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '话题LOGO图片url',
`introduction` longtext COLLATE utf8mb4_unicode_ci COMMENT '话题引言',
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`content` longtext COLLATE utf8mb4_unicode_ci,
`status` int(11) DEFAULT '0' COMMENT 'status=0:未上线;status=1:已上线',
`serial` int(11) DEFAULT '100' COMMENT '排序号,数值小的排前面,最小为0',
PRIMARY KEY (`topic_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for user_profile
-- ----------------------------
DROP TABLE IF EXISTS `user_profile`;
CREATE TABLE `user_profile` (
`user_id` bigint(20) NOT NULL,
`mobile` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`sex` int(11) DEFAULT NULL,
`star_sign` int(11) DEFAULT NULL,
`age` int(11) DEFAULT NULL,
`nickname` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '昵称',
`head_img` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`head_version` bigint(20) DEFAULT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for user_score
-- ----------------------------
DROP TABLE IF EXISTS `user_score`;
CREATE TABLE `user_score` (
`user_id` bigint(20) NOT NULL,
`check_in_count` int(11) NOT NULL DEFAULT '0' COMMENT '签到次数',
`score` int(11) NOT NULL DEFAULT '0' COMMENT '积分',
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; | the_stack |
-- 2019-02-28T11:36:37.408
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat SET IsActive='Y',Updated=TO_TIMESTAMP('2019-02-28 11:36:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_ID=102
;
-- 2019-02-28T11:37:38.849
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat (AD_Client_ID,AD_ImpFormat_ID,AD_Org_ID,AD_Table_ID,Created,CreatedBy,Description,FormatType,IsActive,IsMultiLine,Name,Processing,Updated,UpdatedBy) VALUES (0,540028,0,534,TO_TIMESTAMP('2019-02-28 11:37:38','YYYY-MM-DD HH24:MI:SS'),100,'','S','Y','N','Import Accounts','N',TO_TIMESTAMP('2019-02-28 11:37:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:37:45.148
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat SET IsActive='N',Updated=TO_TIMESTAMP('2019-02-28 11:37:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_ID=102
;
-- 2019-02-28T11:37:48.662
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat SET IsActive='Y',Updated=TO_TIMESTAMP('2019-02-28 11:37:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_ID=102
;
-- 2019-02-28T11:38:02.346
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,EndNo,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,7929,540028,541030,0,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N',0,'Y','A - Key',10,1,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:38:02.410
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,EndNo,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,7913,540028,541031,0,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N',0,'Y','B - Name',20,2,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:38:02.473
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,EndNo,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,7933,540028,541032,0,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N',0,'Y','C - Description',30,3,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:38:02.540
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,EndNo,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,7919,540028,541033,0,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N',0,'Y','D - Account Type (Asset, ..)',40,4,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:38:02.610
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,EndNo,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,7925,540028,541034,0,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N',0,'Y','E - Account Sign',50,5,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:38:02.682
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,EndNo,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,7927,540028,541035,0,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N',0,'Y','F - Document Controlled',60,6,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:38:02.745
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,EndNo,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,7969,540028,541036,0,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N',0,'Y','G - Summary Account',70,7,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:38:02.814
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,EndNo,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,7918,540028,541037,0,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N',0,'Y','H - Account Assignment for default account',80,8,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:38:02.886
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,EndNo,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,7970,540028,541038,0,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N',0,'Y','I - Parent (Summary) Account',90,9,TO_TIMESTAMP('2019-02-28 11:38:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:38:07.173
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat SET IsActive='N',Updated=TO_TIMESTAMP('2019-02-28 11:38:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_ID=102
;
-- 2019-02-28T11:48:20.006
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=7931, Name='ElementName',Updated=TO_TIMESTAMP('2019-02-28 11:48:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541030
;
-- 2019-02-28T11:48:29.862
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=7929, Name='Value',Updated=TO_TIMESTAMP('2019-02-28 11:48:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541031
;
-- 2019-02-28T11:48:37.761
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=7913, Name='Name',Updated=TO_TIMESTAMP('2019-02-28 11:48:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541032
;
-- 2019-02-28T11:48:52.421
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=7970, Name='ParentValue',Updated=TO_TIMESTAMP('2019-02-28 11:48:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541033
;
-- 2019-02-28T11:49:11.028
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=7919, Name='Account Type',Updated=TO_TIMESTAMP('2019-02-28 11:49:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541034
;
-- 2019-02-28T11:49:27.193
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=7925, Name='Account Sign',Updated=TO_TIMESTAMP('2019-02-28 11:49:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541035
;
-- 2019-02-28T11:49:41.246
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET Name='Summary',Updated=TO_TIMESTAMP('2019-02-28 11:49:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541036
;
-- 2019-02-28T11:50:02.433
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=7923, Name='PostActual',Updated=TO_TIMESTAMP('2019-02-28 11:50:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541037
;
-- 2019-02-28T11:50:12.454
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=7916, Name='PostBudget',Updated=TO_TIMESTAMP('2019-02-28 11:50:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541038
;
-- 2019-02-28T11:50:33.534
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,EndNo,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,7915,540028,541039,0,TO_TIMESTAMP('2019-02-28 11:50:33','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N',0,'Y','PostStatistical',100,9,TO_TIMESTAMP('2019-02-28 11:50:33','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:50:39.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=10,Updated=TO_TIMESTAMP('2019-02-28 11:50:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541039
;
-- 2019-02-28T11:50:56.746
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,EndNo,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,7915,540028,541040,0,TO_TIMESTAMP('2019-02-28 11:50:56','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N',0,'Y','PostStatistical',110,11,TO_TIMESTAMP('2019-02-28 11:50:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-02-28T11:51:07.166
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=7927, Name='IsDocControlled',Updated=TO_TIMESTAMP('2019-02-28 11:51:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541040
;
-- add the import format in Importer
INSERT INTO public.c_dataimport (ad_client_id, ad_impformat_id, ad_org_id, c_dataimport_id, created, createdby, isactive, updated, updatedby) VALUES (1000000, 540028, 1000000, 540001, '2019-02-26 15:55:19.000000', 100, 'Y', '2019-02-26 15:55:19.000000', 100); | the_stack |
-- #100 FRESH-435 EDI wrong handover location in Picking Terminal
DROP SCHEMA IF EXISTS FRESH_435;
CREATE SCHEMA FRESH_435;
COMMENT ON SCHEMA FRESH_435 IS 'Issue #100 FRESH-435: contains SQL workarounds to fix C_Orders, M_ShipmentSchedules and EDI_Desadvs, until the code fix is in place';
SET search_path TO FRESH_435,public;
---------------
-- Handover-Location
---------------
DROP VIEW IF EXISTS de_metas_ordercandidate.diag_handover CASCADE;
CREATE OR REPLACE VIEW de_metas_ordercandidate.diag_handover AS
SELECT
olc.C_OLCand_ID AS olc_C_OLCand_ID,
olc.POReference AS olc_POReference,
ol.C_OrderLine_ID AS ol_C_OrderLine_ID,
o.Created AS o_Created,
o.Updated AS o_Updated,
o.C_Order_ID AS o_C_Order_ID,
o.POReference AS o_POReference,
o.C_BPartner_ID AS o_C_BPartner_ID,
o_bp.Value, o_bp.Name,
o.HandOver_Partner_ID AS o_HandOver_Partner_ID,
COALESCE(olc.HandOver_Partner_Override_ID, olc.HandOver_Partner_ID) AS olc_HandOver_Partner_Eff_ID,
CASE WHEN COALESCE(olc.HandOver_Partner_Override_ID, olc.HandOver_Partner_ID, 0) = COALESCE(o.HandOver_Partner_ID, 0) THEN 'Y' ELSE 'N' END AS o_HandOver_Partner_ID_correct,
o.C_BPartner_Location_ID AS o_C_BPartner_Location_ID,
o.HandOver_Location_ID AS o_HandOver_Location_ID,
COALESCE(olc.HandOver_Location_Override_ID, olc.HandOver_Location_ID) AS olc_HandOver_Location_Eff_ID,
CASE WHEN COALESCE(olc.HandOver_Location_Override_ID, olc.HandOver_Location_ID, 0)= COALESCE(o.HandOver_Location_ID, 0) THEN 'Y' ELSE 'N' END AS o_HandOver_Location_ID_correct,
o.IsUseHandOver_Location AS o_IsUseHandOver_Location,
CASE WHEN COALESCE(olc.HandOver_Location_Override_ID, olc.HandOver_Location_ID, 0)>0 THEN 'Y' ELSE 'N' END AS o_should_UseHandOver_Location -- this is according to the old logic; handover-partner plays no role in it
FROM C_OLCand olc
JOIN C_Order_Line_Alloc ola ON olc.C_OLCand_ID=ola.C_OLCand_ID
JOIN C_OrderLine ol ON ol.C_OrderLine_ID=ola.C_OrderLine_ID
JOIN C_Order o ON o.C_Order_ID=ol.C_Order_ID
JOIN C_BPartner o_bp ON o_bp.C_BPartner_ID=o.C_BPArtner_ID
WHERE true;
COMMENT ON VIEW de_metas_ordercandidate.diag_handover IS 'Issue #100 FRESH-435: can be used to show if C_ORder''s handover references are OK according to our current logic:
* o_HandOver_Partner_ID_correct: if a handOver partner is set in the C_OLCand, then it shall also be set in the C_Order, even if it does not differ from the C_Order''s C_BPartner_ID
* o_HandOver_Location_ID_correct: similar to partner, if a handover location is set in the olc, then it shall also be set in o, even if it does not differ from o''s C_BPartner_Location_ID
* o_should_UseHandOver_Location: if the order has a handover location, then it shall have IsUseHandOver_Location=''Y''.
Important: the order might be reactivated and things might be changed manually. In that case the order might seem wrong according to this view.';
-- SELECT * FROM de_metas_ordercandidate.diag_handover WHERE true AND o_Created>='2016-06-20 12:30'
DROP VIEW IF EXISTS FRESH_435.C_Order_diag_handover_to_fix CASCADE;
CREATE VIEW FRESH_435.C_Order_diag_handover_to_fix AS
SELECT v.*
FROM de_metas_ordercandidate.diag_handover v
JOIN C_Order o ON o.C_Order_ID=v.o_C_Order_ID
WHERE true
AND o_Created>='2016-06-20 12:30'
AND (
o.IsUseHandOver_Location!=v.o_should_UseHandOver_Location
OR o.HandOver_Partner_ID!=v.olc_HandOver_Partner_Eff_ID
OR o.HandOver_Location_ID!=v.olc_HandOver_Location_Eff_ID
);
COMMENT ON VIEW FRESH_435.C_Order_diag_handover_to_fix IS 'Issue #100 FRESH-435: selects de_metas_ordercandidate.diag_handover records whose orders are not OK, according to that view';
-- SELECT * FROM FRESH_435.C_Order_diag_handover_to_fix
---------------
-- Dropship-Location
---------------
DROP VIEW IF EXISTS de_metas_ordercandidate.diag_dropship_v CASCADE;
CREATE OR REPLACE VIEW de_metas_ordercandidate.diag_dropship_v AS
SELECT
olc.C_OLCand_ID AS olc_C_OLCand_ID,
olc.POReference AS olc_POReference,
ol.C_OrderLine_ID AS ol_C_OrderLine_ID,
o.Created AS o_Created,
o.Updated AS o_Updated,
o.C_Order_ID AS o_C_Order_ID,
o.POReference AS o_POReference,
o.C_BPartner_ID AS o_C_BPartner_ID,
o.C_BPartner_Location_ID AS o_C_BPartner_Location_ID,
o.DropShip_BPartner_ID AS o_DropShip_BPartner_ID,
o_bp.Value, o_bp.Name,
COALESCE(olc.DropShip_BPartner_Override_ID, olc.DropShip_BPartner_ID) AS olc_DropShip_BPartner_Eff_ID,
CASE WHEN COALESCE(olc.DropShip_BPartner_Override_ID, olc.DropShip_BPartner_ID, 0)= COALESCE(o.DropShip_BPartner_ID, 0) THEN 'Y' ELSE 'N' END AS o_DropShip_BPartner_ID_correct,
o.DropShip_Location_ID AS o_DropShip_Location_ID,
COALESCE(olc.DropShip_Location_Override_ID, olc.DropShip_Location_ID) AS olc_DropShip_Location_Eff_ID,
CASE WHEN COALESCE(olc.DropShip_Location_Override_ID, olc.DropShip_Location_ID, 0)= COALESCE(o.DropShip_Location_ID,0) THEN 'Y' ELSE 'N' END AS o_DropShip_Location_ID_correct,
o.IsDropShip AS o_IsDropShip,
CASE WHEN COALESCE(olc.DropShip_Location_Override_ID, olc.DropShip_Location_ID, 0)>0 OR COALESCE(olc.DropShip_BPartner_Override_ID, olc.DropShip_BPartner_ID, 0)>0 THEN 'Y' ELSE 'N' END AS o_should_be_dropship
FROM C_OLCand olc
JOIN C_Order_Line_Alloc ola ON olc.C_OLCand_ID=ola.C_OLCand_ID
JOIN C_OrderLine ol ON ol.C_OrderLine_ID=ola.C_OrderLine_ID
JOIN C_Order o ON o.C_Order_ID=ol.C_Order_ID
JOIN C_BPartner o_bp ON o_bp.C_BPartner_ID=o.C_BPArtner_ID
WHERE true;
COMMENT ON VIEW de_metas_ordercandidate.diag_dropship_v IS 'Issue #100 FRESH-435: select C_Orders with their C_OLCands and checks if the C_Orders'' dropship IDs are consistent with the C_OlCands'' IDs, according to our current logic:
* o_DropShip_BPartner_ID_correct: if a dropship partner is set in the olc, then it shall also be set in o, even if it does not differ from o''s C_BPartner_ID
* o_DropShip_Location_ID_correct: similar to partner, if a dropship location is set in the olc, then it shall also be set in o, even if it does not differ from o''s C_BPartner_Location_ID
* o_should_be_dropship: if olc has a an explicit dropship location or partner, then this lcoation should also be explicitly
Important: the order might be reactivated and things might be changed manually. In that case the order might seem wrong according to this view.';
DROP VIEW IF EXISTS FRESH_435.M_ShipmentSchedule_to_fix_location_general_v;
CREATE VIEW FRESH_435.M_ShipmentSchedule_to_fix_location_general_v AS
SELECT v.*,s.M_ShipmentSchedule_ID,s.C_BPArtner_Location_ID, s.C_BP_Location_Override_ID, s.DeliveryDate
FROM de_metas_ordercandidate.diag_dropship_v v
JOIN M_ShipmentSchedule s ON s.C_OrderLine_ID=v.ol_C_OrderLine_ID
WHERE true
AND o_Created>='2016-06-20 12:30'
AND s.C_BPartner_Location_ID!=COALESCE(v.o_DropShip_Location_ID, v.o_C_BPartner_Location_ID);
COMMENT ON VIEW FRESH_435.M_ShipmentSchedule_to_fix_location_general_v IS 'Issue #100 FRESH-435: selects M_ShipmentSchedule whose C_BPartner_Location_ID differs from the C_Order''s (effective) DropShip_Location_ID';
--SELECT * FROM FRESH_435.M_ShipmentSchedule_to_fix_location_general_v;
drop VIEW IF EXISTS FRESH_435.C_Order_dropship_to_fix_v;
CREATE VIEW FRESH_435.C_Order_dropship_to_fix_v AS
SELECT v.*
FROM de_metas_ordercandidate.diag_dropship_v v
WHERE true
AND v.o_Created>='2016-06-20 12:30'
AND (
v.o_DropShip_BPartner_ID_correct='N' OR
v.o_DropShip_Location_ID_correct='N' OR
v.o_should_be_dropship!=v.o_IsDropShip
);
---------------
-- DESADV
---------------
DROP VIEW IF EXISTS "de.metas.edi".EDI_Desadv_diag_locations_v;
CREATE VIEW "de.metas.edi".EDI_Desadv_diag_locations_v AS
SELECT d.EDI_Desadv_ID AS d_EDI_Desadv_ID,
d.DocumentNo AS d_DocumentNo,
d.POReference AS d_POReference,
d.Created AS d_created,
d.EDI_ExportStatus AS d_EDI_ExportStatus,
d.C_BPartner_Location_ID AS d_C_BPartner_Location_ID,
CASE WHEN o.IsDropShip='Y' THEN o.DropShip_Location_ID ELSE o.C_BPartner_Location_ID END AS d_C_BPartner_Location_ID_Should,
d.HandOver_Location_ID AS d_HandOver_Location_ID,
o.HandOver_Location_ID AS d_HandOver_Location_ID_Should
FROM EDI_Desadv d
JOIN C_Order o ON o.EDI_Desadv_ID=d.EDI_Desadv_ID
WHERE true;
DROP VIEW IF EXISTS FRESH_435.EDI_Desadv_locations_to_fix_v;
CREATE VIEW FRESH_435.EDI_Desadv_locations_to_fix_v AS
SELECT * FROM "de.metas.edi".EDI_Desadv_diag_locations_v v
WHERE true
AND d_created>='2016-06-21'
AND d_EDI_ExportStatus!='S'
AND (
COALESCE(d_C_BPartner_Location_ID,0)!=COALESCE(d_C_BPartner_Location_ID_Should,0) OR
COALESCE(d_HandOver_Location_ID,0)!=COALESCE(d_HandOver_Location_ID_Should,0)
);
-- SELECT * FROM FRESH_435.EDI_Desadv_locations_to_fix_v
-------------------------------
-- To run
------------------------------
CREATE OR REPLACE FUNCTION FRESH_435.workaround_fix_c_order_edi_desadv_and_m_Shipmentschedule()
RETURNS VOID AS
$BODY$
-- Dropship (Order and M_ShipmentSchedule)
------------
UPDATE C_Order o
SET
IsDropShip=v.o_should_be_dropship,
DropShip_BPartner_ID=v.olc_DropShip_BPartner_Eff_ID,
DropShip_Location_ID=v.olc_DropShip_Location_Eff_ID,
Updated=now(), UpdatedBy=99
FROM FRESH_435.C_Order_dropship_to_fix_v v
WHERE true
AND o.C_Order_ID=v.o_C_Order_ID;
-- run in one TRX
INSERT INTO M_ShipmentSchedule_Recompute(M_ShipmentSchedule_ID) SELECT M_ShipmentSchedule_ID FROM FRESH_435.M_ShipmentSchedule_to_fix_location_general_v v;
UPDATE M_ShipmentSchedule s
SET C_BPartner_Location_ID=v.o_DropShip_Location_ID, Updated=now(), UpdatedBy=99
FROM FRESH_435.M_ShipmentSchedule_to_fix_location_general_v v
WHERE s.M_ShipmentSchedule_ID=v.M_ShipmentSchedule_ID;
-- HandOver (Order)
-------------------
UPDATE C_Order o
SET
IsUseHandOver_Location=v.o_should_UseHandOver_Location,
HandOver_Partner_ID=v.olc_HandOver_Partner_Eff_ID,
HandOver_Location_ID=v.olc_HandOver_Location_Eff_ID,
Updated=now(), UpdatedBy=99
FROM FRESH_435.C_Order_diag_handover_to_fix v
WHERE true
AND o.C_Order_ID=v.o_C_Order_ID;
-- DESADV (lcoation and handover)
----------------------------
UPDATE EDI_Desadv d
SET
C_BPartner_Location_ID=d_C_BPartner_Location_ID_Should,
HandOver_Location_ID=d_HandOver_Location_ID_Should,
Updated=now(), UpdatedBy=99
FROM FRESH_435.EDI_Desadv_locations_to_fix_v v
WHERE v.d_EDI_Desadv_ID=d.EDI_Desadv_ID;
$BODY$
LANGUAGE sql VOLATILE; | the_stack |
-- 2018-07-16T12:46:55.470
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET ColumnName='ProfitPriceActual', Description='Effektiver Preis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung.', Name='Ertrag netto', PrintName='Ertrag netto',Updated=TO_TIMESTAMP('2018-07-16 12:46:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=544089
;
-- 2018-07-16T12:46:55.474
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='ProfitPriceActual', Name='Ertrag netto', Description='Effektiver Preis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung.', Help=NULL WHERE AD_Element_ID=544089
;
-- 2018-07-16T12:46:55.475
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ProfitPriceActual', Name='Ertrag netto', Description='Effektiver Preis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung.', Help=NULL, AD_Element_ID=544089 WHERE UPPER(ColumnName)='PROFITPRICEACTUAL' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-07-16T12:46:55.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ProfitPriceActual', Name='Ertrag netto', Description='Effektiver Preis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung.', Help=NULL WHERE AD_Element_ID=544089 AND IsCentrallyMaintained='Y'
;
-- 2018-07-16T12:46:55.478
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Ertrag netto', Description='Effektiver Preis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung.', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=544089) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 544089)
;
-- 2018-07-16T12:46:55.492
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Ertrag netto', Name='Ertrag netto' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=544089)
;
SELECT public.db_alter_table('C_OrderLine','ALTER TABLE public.C_OrderLine RENAME COLUMN PriceGrossProfit TO ProfitPriceActual');
-- 2018-07-16T12:49:07.880
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET ColumnName='ProfitPercent', Description='Differenz zwischen VK Ertrag und EK Ertrag.', EntityType='de.metas.order',Updated=TO_TIMESTAMP('2018-07-16 12:49:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=544177
;
-- 2018-07-16T12:49:07.885
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='ProfitPercent', Name='Marge %', Description='Differenz zwischen VK Ertrag und EK Ertrag.', Help=NULL WHERE AD_Element_ID=544177
;
-- 2018-07-16T12:49:07.887
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ProfitPercent', Name='Marge %', Description='Differenz zwischen VK Ertrag und EK Ertrag.', Help=NULL, AD_Element_ID=544177 WHERE UPPER(ColumnName)='PROFITPERCENT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-07-16T12:49:07.889
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ProfitPercent', Name='Marge %', Description='Differenz zwischen VK Ertrag und EK Ertrag.', Help=NULL WHERE AD_Element_ID=544177 AND IsCentrallyMaintained='Y'
;
-- 2018-07-16T12:49:07.890
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Marge %', Description='Differenz zwischen VK Ertrag und EK Ertrag.', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=544177) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 544177)
;
-- 2018-07-16T12:49:20.510
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('C_OrderLine','ALTER TABLE public.C_OrderLine ADD COLUMN ProfitPercent NUMERIC')
;
-- 2018-07-16T12:51:33.147
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,Description,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,560676,565104,0,187,0,TO_TIMESTAMP('2018-07-16 12:51:32','YYYY-MM-DD HH24:MI:SS'),100,'Differenz zwischen VK Ertrag und EK Ertrag.',0,'de.metas.order',0,'Y','Y','Y','N','N','N','N','N','Marge %',270,260,0,1,1,TO_TIMESTAMP('2018-07-16 12:51:32','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-07-16T12:51:33.148
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=565104 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2018-07-16T12:51:50.677
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,Description,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,560174,565105,0,187,0,TO_TIMESTAMP('2018-07-16 12:51:50','YYYY-MM-DD HH24:MI:SS'),100,'Effektiver Preis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung.',0,'de.metas.order',0,'Y','Y','Y','N','N','N','N','N','Ertrag netto',280,270,0,1,1,TO_TIMESTAMP('2018-07-16 12:51:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-07-16T12:51:50.678
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=565105 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2018-07-16T12:54:49.709
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET ColumnName='ProfitPurchasePriceActual', Description='Effektiver Einkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Name='EK Ertrag netto', PrintName='EK Ertrag netto',Updated=TO_TIMESTAMP('2018-07-16 12:54:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=544092
;
-- 2018-07-16T12:54:49.714
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='ProfitPurchasePriceActual', Name='EK Ertrag netto', Description='Effektiver Einkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Help='' WHERE AD_Element_ID=544092
;
-- 2018-07-16T12:54:49.716
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ProfitPurchasePriceActual', Name='EK Ertrag netto', Description='Effektiver Einkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Help='', AD_Element_ID=544092 WHERE UPPER(ColumnName)='PROFITPURCHASEPRICEACTUAL' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-07-16T12:54:49.717
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ProfitPurchasePriceActual', Name='EK Ertrag netto', Description='Effektiver Einkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Help='' WHERE AD_Element_ID=544092 AND IsCentrallyMaintained='Y'
;
-- 2018-07-16T12:54:49.718
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='EK Ertrag netto', Description='Effektiver Einkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Help='' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=544092) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 544092)
;
-- 2018-07-16T12:54:49.729
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='EK Ertrag netto', Name='EK Ertrag netto' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=544092)
;
SELECT public.db_alter_table('C_PurchaseCandidate','ALTER TABLE public.C_PurchaseCandidate RENAME COLUMN PurchasePriceActual TO ProfitPurchasePriceActual')
;
-- 2018-07-16T12:57:11.578
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET Description='Effektiver Verkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Name='VK Ertrag netto', PrintName='VK Ertrag netto',Updated=TO_TIMESTAMP('2018-07-16 12:57:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=544093
;
-- 2018-07-16T12:57:11.583
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='CustomerPriceGrossProfit', Name='VK Ertrag netto', Description='Effektiver Verkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Help='' WHERE AD_Element_ID=544093
;
-- 2018-07-16T12:57:11.584
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='CustomerPriceGrossProfit', Name='VK Ertrag netto', Description='Effektiver Verkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Help='', AD_Element_ID=544093 WHERE UPPER(ColumnName)='CUSTOMERPRICEGROSSPROFIT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-07-16T12:57:11.586
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='CustomerPriceGrossProfit', Name='VK Ertrag netto', Description='Effektiver Verkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Help='' WHERE AD_Element_ID=544093 AND IsCentrallyMaintained='Y'
;
-- 2018-07-16T12:57:11.587
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='VK Ertrag netto', Description='Effektiver Verkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Help='' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=544093) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 544093)
;
-- 2018-07-16T12:57:11.597
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='VK Ertrag netto', Name='VK Ertrag netto' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=544093)
;
-- 2018-07-16T12:57:29.341
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET ColumnName='ProfitSalesPriceActual',Updated=TO_TIMESTAMP('2018-07-16 12:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=544093
;
-- 2018-07-16T12:57:29.343
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='ProfitSalesPriceActual', Name='VK Ertrag netto', Description='Effektiver Verkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Help='' WHERE AD_Element_ID=544093
;
-- 2018-07-16T12:57:29.346
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ProfitSalesPriceActual', Name='VK Ertrag netto', Description='Effektiver Verkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Help='', AD_Element_ID=544093 WHERE UPPER(ColumnName)='PROFITSALESPRICEACTUAL' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-07-16T12:57:29.348
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ProfitSalesPriceActual', Name='VK Ertrag netto', Description='Effektiver Verkaufspreis pro Einheit, minus erwartetem Skonto und vertraglicher Rückerstattung', Help='' WHERE AD_Element_ID=544093 AND IsCentrallyMaintained='Y'
;
SELECT public.db_alter_table('C_PurchaseCandidate','ALTER TABLE public.C_PurchaseCandidate RENAME COLUMN CustomerPriceGrossProfit TO ProfitSalesPriceActual')
;
-- 2018-07-16T13:23:39.214
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Element_ID=519, ColumnName='PriceActual', Description='Effektiver Preis', Help='Der Einzelpreis oder Effektive Preis bezeichnet den Preis für das Produkt in Ausgangswährung.', Name='Einzelpreis',Updated=TO_TIMESTAMP('2018-07-16 13:23:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=560358
;
-- 2018-07-16T13:23:39.219
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Einzelpreis', Description='Effektiver Preis', Help='Der Einzelpreis oder Effektive Preis bezeichnet den Preis für das Produkt in Ausgangswährung.' WHERE AD_Column_ID=560358
;
SELECT public.db_alter_table('C_PurchaseCandidate','ALTER TABLE public.C_PurchaseCandidate RENAME COLUMN ProfitPurchasePriceActual TO PriceActual');
SELECT public.db_alter_table('C_PurchaseCandidate','ALTER TABLE public.C_PurchaseCandidate RENAME COLUMN pricegrossprofit TO ProfitPurchasePriceActual');
-- 2018-07-16T16:23:53.466
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET TechnicalNote='Mandatory, unless AD_Issue_ID>0',Updated=TO_TIMESTAMP('2018-07-16 16:23:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559005
;
-- 2018-07-16T16:23:58.995
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET TechnicalNote='Mandatory, unless AD_Issue_ID>0',Updated=TO_TIMESTAMP('2018-07-16 16:23:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559012
;
-- 2018-07-16T16:24:04.042
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET TechnicalNote='Mandatory, unless AD_Issue_ID>0',Updated=TO_TIMESTAMP('2018-07-16 16:24:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559017
;
-- 2018-07-16T16:26:02.618
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET TechnicalNote='Mandatory, unless AD_Issue_ID>0; may be equal to "NO_REMOTE_PURCHASE_ID"',Updated=TO_TIMESTAMP('2018-07-16 16:26:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559018
; | the_stack |
create function app_public.current_user_id() returns int as $$
select nullif(current_setting('jwt.claims.user_id', true), '')::int;
$$ language sql stable set search_path from current;
comment on function app_public.current_user_id() is
E'@omit\nHandy method to get the current user ID for use in RLS policies, etc; in GraphQL, use `currentUser{id}` instead.';
--------------------------------------------------------------------------------
create table app_public.users (
id serial primary key,
username citext not null unique check(username ~ '^[a-zA-Z]([a-zA-Z0-9][_]?)+$'),
name text,
avatar_url text check(avatar_url ~ '^https?://[^/]+'),
is_admin boolean not null default false,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
alter table app_public.users enable row level security;
create trigger _100_timestamps
before insert or update on app_public.users
for each row
execute procedure app_private.tg__update_timestamps();
-- By doing `@omit all` we prevent the `allUsers` field from appearing in our
-- GraphQL schema. User discovery is still possible by browsing the rest of
-- the data, but it makes it harder for people to receive a `totalCount` of
-- users, or enumerate them fully.
comment on table app_public.users is
E'@omit all\nA user who can log in to the application.';
comment on column app_public.users.id is
E'Unique identifier for the user.';
comment on column app_public.users.username is
E'Public-facing username (or ''handle'') of the user.';
comment on column app_public.users.name is
E'Public-facing name (or pseudonym) of the user.';
comment on column app_public.users.avatar_url is
E'Optional avatar URL.';
comment on column app_public.users.is_admin is
E'If true, the user has elevated privileges.';
create policy select_all on app_public.users for select using (true);
create policy update_self on app_public.users for update using (id = app_public.current_user_id());
create policy delete_self on app_public.users for delete using (id = app_public.current_user_id());
grant select on app_public.users to graphiledemo_visitor;
grant update(name, avatar_url) on app_public.users to graphiledemo_visitor;
grant delete on app_public.users to graphiledemo_visitor;
create function app_private.tg_users__make_first_user_admin() returns trigger as $$
begin
if not exists(select 1 from app_public.users) then
NEW.is_admin = true;
end if;
return NEW;
end;
$$ language plpgsql volatile set search_path from current;
create trigger _200_make_first_user_admin
before insert on app_public.users
for each row
execute procedure app_private.tg_users__make_first_user_admin();
--------------------------------------------------------------------------------
create function app_public.current_user_is_admin() returns bool as $$
-- We're using exists here because it guarantees true/false rather than true/false/null
select exists(
select 1 from app_public.users where id = app_public.current_user_id() and is_admin = true
);
$$ language sql stable set search_path from current;
comment on function app_public.current_user_is_admin() is
E'@omit\nHandy method to determine if the current user is an admin, for use in RLS policies, etc; in GraphQL should use `currentUser{isAdmin}` instead.';
--------------------------------------------------------------------------------
create function app_public.current_user() returns app_public.users as $$
select users.* from app_public.users where id = app_public.current_user_id();
$$ language sql stable set search_path from current;
--------------------------------------------------------------------------------
create table app_private.user_secrets (
user_id int not null primary key references app_public.users,
password_hash text,
password_attempts int not null default 0,
first_failed_password_attempt timestamptz,
reset_password_token text,
reset_password_token_generated timestamptz,
reset_password_attempts int not null default 0,
first_failed_reset_password_attempt timestamptz
);
comment on table app_private.user_secrets is
E'The contents of this table should never be visible to the user. Contains data mostly related to authentication.';
create function app_private.tg_user_secrets__insert_with_user() returns trigger as $$
begin
insert into app_private.user_secrets(user_id) values(NEW.id);
return NEW;
end;
$$ language plpgsql volatile set search_path from current;
create trigger _500_insert_secrets
after insert on app_public.users
for each row
execute procedure app_private.tg_user_secrets__insert_with_user();
comment on function app_private.tg_user_secrets__insert_with_user() is
E'Ensures that every user record has an associated user_secret record.';
--------------------------------------------------------------------------------
create table app_public.user_emails (
id serial primary key,
user_id int not null default app_public.current_user_id() references app_public.users on delete cascade,
email citext not null check (email ~ '[^@]+@[^@]+\.[^@]+'),
is_verified boolean not null default false,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now(),
unique(user_id, email)
);
create unique index uniq_user_emails_verified_email on app_public.user_emails(email) where is_verified is true;
alter table app_public.user_emails enable row level security;
create trigger _100_timestamps
before insert or update on app_public.user_emails
for each row
execute procedure app_private.tg__update_timestamps();
create trigger _900_send_verification_email
after insert on app_public.user_emails
for each row when (NEW.is_verified is false)
execute procedure app_private.tg__add_job_for_row('user_emails__send_verification');
-- `@omit all` because there's no point exposing `allUserEmails` - you can only
-- see your own, and having this behaviour can lead to bad practices from
-- frontend teams.
comment on table app_public.user_emails is
E'@omit all\nInformation about a user''s email address.';
comment on column app_public.user_emails.email is
E'The users email address, in `a@b.c` format.';
comment on column app_public.user_emails.is_verified is
E'True if the user has is_verified their email address (by clicking the link in the email we sent them, or logging in with a social login provider), false otherwise.';
create policy select_own on app_public.user_emails for select using (user_id = app_public.current_user_id());
create policy insert_own on app_public.user_emails for insert with check (user_id = app_public.current_user_id());
create policy delete_own on app_public.user_emails for delete using (user_id = app_public.current_user_id()); -- TODO check this isn't the last one!
grant select on app_public.user_emails to graphiledemo_visitor;
grant insert (email) on app_public.user_emails to graphiledemo_visitor;
grant delete on app_public.user_emails to graphiledemo_visitor;
--------------------------------------------------------------------------------
create table app_private.user_email_secrets (
user_email_id int primary key references app_public.user_emails on delete cascade,
verification_token text,
password_reset_email_sent_at timestamptz
);
alter table app_private.user_email_secrets enable row level security;
comment on table app_private.user_email_secrets is
E'The contents of this table should never be visible to the user. Contains data mostly related to email verification and avoiding spamming users.';
comment on column app_private.user_email_secrets.password_reset_email_sent_at is
E'We store the time the last password reset was sent to this email to prevent the email getting flooded.';
create function app_private.tg_user_email_secrets__insert_with_user_email() returns trigger as $$
declare
v_verification_token text;
begin
if NEW.is_verified is false then
v_verification_token = encode(gen_random_bytes(4), 'hex');
end if;
insert into app_private.user_email_secrets(user_email_id, verification_token) values(NEW.id, v_verification_token);
return NEW;
end;
$$ language plpgsql volatile set search_path from current;
create trigger _500_insert_secrets
after insert on app_public.user_emails
for each row
execute procedure app_private.tg_user_email_secrets__insert_with_user_email();
comment on function app_private.tg_user_email_secrets__insert_with_user_email() is
E'Ensures that every user_email record has an associated user_email_secret record.';
--------------------------------------------------------------------------------
create table app_public.user_authentications (
id serial primary key,
user_id int not null references app_public.users on delete cascade,
service text not null,
identifier text not null,
details jsonb not null default '{}'::jsonb,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now(),
constraint uniq_user_authentications unique(service, identifier)
);
alter table app_public.user_authentications enable row level security;
create trigger _100_timestamps
before insert or update on app_public.user_authentications
for each row
execute procedure app_private.tg__update_timestamps();
comment on table app_public.user_authentications is
E'@omit all\nContains information about the login providers this user has used, so that they may disconnect them should they wish.';
comment on column app_public.user_authentications.user_id is
E'@omit';
comment on column app_public.user_authentications.service is
E'The login service used, e.g. `twitter` or `github`.';
comment on column app_public.user_authentications.identifier is
E'A unique identifier for the user within the login service.';
comment on column app_public.user_authentications.details is
E'@omit\nAdditional profile details extracted from this login method';
create policy select_own on app_public.user_authentications for select using (user_id = app_public.current_user_id());
create policy delete_own on app_public.user_authentications for delete using (user_id = app_public.current_user_id()); -- TODO check this isn't the last one, or that they have a verified email address
grant select on app_public.user_authentications to graphiledemo_visitor;
grant delete on app_public.user_authentications to graphiledemo_visitor;
--------------------------------------------------------------------------------
create table app_private.user_authentication_secrets (
user_authentication_id int not null primary key references app_public.user_authentications on delete cascade,
details jsonb not null default '{}'::jsonb
);
alter table app_private.user_authentication_secrets enable row level security;
-- NOTE: user_authentication_secrets doesn't need an auto-inserter as we handle
-- that everywhere that can create a user_authentication row.
--------------------------------------------------------------------------------
create function app_public.forgot_password(email text) returns boolean as $$
declare
v_user_email app_public.user_emails;
v_reset_token text;
v_reset_min_duration_between_emails interval = interval '30 minutes';
v_reset_max_duration interval = interval '3 days';
begin
-- Find the matching user_email
select user_emails.* into v_user_email
from app_public.user_emails
where user_emails.email = forgot_password.email::citext
order by is_verified desc, id desc;
if not (v_user_email is null) then
-- See if we've triggered a reset recently
if exists(
select 1
from app_private.user_email_secrets
where user_email_id = v_user_email.id
and password_reset_email_sent_at is not null
and password_reset_email_sent_at > now() - v_reset_min_duration_between_emails
) then
return true;
end if;
-- Fetch or generate reset token
update app_private.user_secrets
set
reset_password_token = (
case
when reset_password_token is null or reset_password_token_generated < NOW() - v_reset_max_duration
then encode(gen_random_bytes(6), 'hex')
else reset_password_token
end
),
reset_password_token_generated = (
case
when reset_password_token is null or reset_password_token_generated < NOW() - v_reset_max_duration
then now()
else reset_password_token_generated
end
)
where user_id = v_user_email.user_id
returning reset_password_token into v_reset_token;
-- Don't allow spamming an email
update app_private.user_email_secrets
set password_reset_email_sent_at = now()
where user_email_id = v_user_email.id;
-- Trigger email send
perform app_jobs.add_job('user__forgot_password', json_build_object('id', v_user_email.user_id, 'email', v_user_email.email::text, 'token', v_reset_token));
return true;
end if;
return false;
end;
$$ language plpgsql strict security definer volatile set search_path from current;
comment on function app_public.forgot_password(email text) is
E'@resultFieldName success\nIf you''ve forgotten your password, give us one of your email addresses and we'' send you a reset token. Note this only works if you have added an email address!';
--------------------------------------------------------------------------------
create function app_private.login(username text, password text) returns app_public.users as $$
declare
v_user app_public.users;
v_user_secret app_private.user_secrets;
v_login_attempt_window_duration interval = interval '6 hours';
begin
select users.* into v_user
from app_public.users
where
-- Match username against users username, or any verified email address
(
users.username = login.username
or
exists(
select 1
from app_public.user_emails
where user_id = users.id
and is_verified is true
and email = login.username::citext
)
);
if not (v_user is null) then
-- Load their secrets
select * into v_user_secret from app_private.user_secrets
where user_secrets.user_id = v_user.id;
-- Have there been too many login attempts?
if (
v_user_secret.first_failed_password_attempt is not null
and
v_user_secret.first_failed_password_attempt > NOW() - v_login_attempt_window_duration
and
v_user_secret.password_attempts >= 20
) then
raise exception 'User account locked - too many login attempts' using errcode = 'LOCKD';
end if;
-- Not too many login attempts, let's check the password
if v_user_secret.password_hash = crypt(password, v_user_secret.password_hash) then
-- Excellent - they're loggged in! Let's reset the attempt tracking
update app_private.user_secrets
set password_attempts = 0, first_failed_password_attempt = null
where user_id = v_user.id;
return v_user;
else
-- Wrong password, bump all the attempt tracking figures
update app_private.user_secrets
set
password_attempts = (case when first_failed_password_attempt is null or first_failed_password_attempt < now() - v_login_attempt_window_duration then 1 else password_attempts + 1 end),
first_failed_password_attempt = (case when first_failed_password_attempt is null or first_failed_password_attempt < now() - v_login_attempt_window_duration then now() else first_failed_password_attempt end)
where user_id = v_user.id;
return null;
end if;
else
-- No user with that email/username was found
return null;
end if;
end;
$$ language plpgsql strict security definer volatile set search_path from current;
comment on function app_private.login(username text, password text) is
E'Returns a user that matches the username/password combo, or null on failure.';
--------------------------------------------------------------------------------
create function app_public.reset_password(user_id int, reset_token text, new_password text) returns app_public.users as $$
declare
v_user app_public.users;
v_user_secret app_private.user_secrets;
v_reset_max_duration interval = interval '3 days';
begin
select users.* into v_user
from app_public.users
where id = user_id;
if not (v_user is null) then
-- Load their secrets
select * into v_user_secret from app_private.user_secrets
where user_secrets.user_id = v_user.id;
-- Have there been too many reset attempts?
if (
v_user_secret.first_failed_reset_password_attempt is not null
and
v_user_secret.first_failed_reset_password_attempt > NOW() - v_reset_max_duration
and
v_user_secret.reset_password_attempts >= 20
) then
raise exception 'Password reset locked - too many reset attempts' using errcode = 'LOCKD';
end if;
-- Not too many reset attempts, let's check the token
if v_user_secret.reset_password_token = reset_token then
-- Excellent - they're legit; let's reset the password as requested
update app_private.user_secrets
set
password_hash = crypt(new_password, gen_salt('bf')),
password_attempts = 0,
first_failed_password_attempt = null,
reset_password_token = null,
reset_password_token_generated = null,
reset_password_attempts = 0,
first_failed_reset_password_attempt = null
where user_secrets.user_id = v_user.id;
return v_user;
else
-- Wrong token, bump all the attempt tracking figures
update app_private.user_secrets
set
reset_password_attempts = (case when first_failed_reset_password_attempt is null or first_failed_reset_password_attempt < now() - v_reset_max_duration then 1 else reset_password_attempts + 1 end),
first_failed_reset_password_attempt = (case when first_failed_reset_password_attempt is null or first_failed_reset_password_attempt < now() - v_reset_max_duration then now() else first_failed_reset_password_attempt end)
where user_secrets.user_id = v_user.id;
return null;
end if;
else
-- No user with that id was found
return null;
end if;
end;
$$ language plpgsql strict volatile security definer set search_path from current;
comment on function app_public.reset_password(user_id int, reset_token text, new_password text) is
E'After triggering forgotPassword, you''ll be sent a reset token. Combine this with your user ID and a new password to reset your password.';
--------------------------------------------------------------------------------
create function app_private.really_create_user(username text, email text, email_is_verified bool, name text, avatar_url text, password text default null) returns app_public.users as $$
declare
v_user app_public.users;
v_username text = username;
begin
-- Sanitise the username, and make it unique if necessary.
if v_username is null then
v_username = coalesce(name, 'user');
end if;
v_username = regexp_replace(v_username, '^[^a-z]+', '', 'i');
v_username = regexp_replace(v_username, '[^a-z0-9]+', '_', 'i');
if v_username is null or length(v_username) < 3 then
v_username = 'user';
end if;
select (
case
when i = 0 then v_username
else v_username || i::text
end
) into v_username from generate_series(0, 1000) i
where not exists(
select 1
from app_public.users
where users.username = (
case
when i = 0 then v_username
else v_username || i::text
end
)
)
limit 1;
-- Insert the new user
insert into app_public.users (username, name, avatar_url) values
(v_username, name, avatar_url)
returning * into v_user;
-- Add the user's email
if email is not null then
insert into app_public.user_emails (user_id, email, is_verified)
values (v_user.id, email, email_is_verified);
end if;
-- Store the password
if password is not null then
update app_private.user_secrets
set password_hash = crypt(password, gen_salt('bf'))
where user_id = v_user.id;
end if;
return v_user;
end;
$$ language plpgsql volatile set search_path from current;
comment on function app_private.really_create_user(username text, email text, email_is_verified bool, name text, avatar_url text, password text) is
E'Creates a user account. All arguments are optional, it trusts the calling method to perform sanitisation.';
--------------------------------------------------------------------------------
create function app_private.register_user(f_service character varying, f_identifier character varying, f_profile json, f_auth_details json, f_email_is_verified boolean default false) returns app_public.users as $$
declare
v_user app_public.users;
v_email citext;
v_name text;
v_username text;
v_avatar_url text;
v_user_authentication_id int;
begin
-- Extract data from the user’s OAuth profile data.
v_email := f_profile ->> 'email';
v_name := f_profile ->> 'name';
v_username := f_profile ->> 'username';
v_avatar_url := f_profile ->> 'avatar_url';
-- Create the user account
v_user = app_private.really_create_user(
username => v_username,
email => v_email,
email_is_verified => f_email_is_verified,
name => v_name,
avatar_url => v_avatar_url
);
-- Insert the user’s private account data (e.g. OAuth tokens)
insert into app_public.user_authentications (user_id, service, identifier, details) values
(v_user.id, f_service, f_identifier, f_profile) returning id into v_user_authentication_id;
insert into app_private.user_authentication_secrets (user_authentication_id, details) values
(v_user_authentication_id, f_auth_details);
return v_user;
end;
$$ language plpgsql volatile security definer set search_path from current;
comment on function app_private.register_user(f_service character varying, f_identifier character varying, f_profile json, f_auth_details json, f_email_is_verified boolean) is
E'Used to register a user from information gleaned from OAuth. Primarily used by link_or_register_user';
--------------------------------------------------------------------------------
create function app_private.link_or_register_user(
f_user_id integer,
f_service character varying,
f_identifier character varying,
f_profile json,
f_auth_details json
) returns app_public.users as $$
declare
v_matched_user_id int;
v_matched_authentication_id int;
v_email citext;
v_name text;
v_avatar_url text;
v_user app_public.users;
v_user_email app_public.user_emails;
begin
-- See if a user account already matches these details
select id, user_id
into v_matched_authentication_id, v_matched_user_id
from app_public.user_authentications
where service = f_service
and identifier = f_identifier
limit 1;
if v_matched_user_id is not null and f_user_id is not null and v_matched_user_id <> f_user_id then
raise exception 'A different user already has this account linked.' using errcode='TAKEN';
end if;
v_email = f_profile ->> 'email';
v_name := f_profile ->> 'name';
v_avatar_url := f_profile ->> 'avatar_url';
if v_matched_authentication_id is null then
if f_user_id is not null then
-- Link new account to logged in user account
insert into app_public.user_authentications (user_id, service, identifier, details) values
(f_user_id, f_service, f_identifier, f_profile) returning id, user_id into v_matched_authentication_id, v_matched_user_id;
insert into app_private.user_authentication_secrets (user_authentication_id, details) values
(v_matched_authentication_id, f_auth_details);
elsif v_email is not null then
-- See if the email is registered
select * into v_user_email from app_public.user_emails where email = v_email and is_verified is true;
if not (v_user_email is null) then
-- User exists!
insert into app_public.user_authentications (user_id, service, identifier, details) values
(v_user_email.user_id, f_service, f_identifier, f_profile) returning id, user_id into v_matched_authentication_id, v_matched_user_id;
insert into app_private.user_authentication_secrets (user_authentication_id, details) values
(v_matched_authentication_id, f_auth_details);
end if;
end if;
end if;
if v_matched_user_id is null and f_user_id is null and v_matched_authentication_id is null then
-- Create and return a new user account
return app_private.register_user(f_service, f_identifier, f_profile, f_auth_details, true);
else
if v_matched_authentication_id is not null then
update app_public.user_authentications
set details = f_profile
where id = v_matched_authentication_id;
update app_private.user_authentication_secrets
set details = f_auth_details
where user_authentication_id = v_matched_authentication_id;
update app_public.users
set
name = coalesce(users.name, v_name),
avatar_url = coalesce(users.avatar_url, v_avatar_url)
where id = v_matched_user_id
returning * into v_user;
return v_user;
else
-- v_matched_authentication_id is null
-- -> v_matched_user_id is null (they're paired)
-- -> f_user_id is not null (because the if clause above)
-- -> v_matched_authentication_id is not null (because of the separate if block above creating a user_authentications)
-- -> contradiction.
raise exception 'This should not occur';
end if;
end if;
end;
$$ language plpgsql volatile security definer set search_path from current;
comment on function app_private.link_or_register_user(f_user_id integer, f_service character varying, f_identifier character varying, f_profile json, f_auth_details json) is
E'If you''re logged in, this will link an additional OAuth login to your account if necessary. If you''re logged out it may find if an account already exists (based on OAuth details or email address) and return that, or create a new user account if necessary.'; | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for discuss
-- ----------------------------
DROP TABLE IF EXISTS `discuss`;
CREATE TABLE `discuss` (
`discussId` int(10) NOT NULL AUTO_INCREMENT COMMENT '评论id',
`topicId` int(10) NOT NULL COMMENT '帖子id',
`userId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户id',
`replyName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '回复者姓名',
`replyContent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '回复内容',
`created_at` datetime(4) NOT NULL ON UPDATE CURRENT_TIMESTAMP(4) COMMENT '回复创建时间',
`updated_at` datetime(4) NOT NULL,
PRIMARY KEY (`discussId`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of discuss
-- ----------------------------
BEGIN;
INSERT INTO `discuss` VALUES (10, 1, 'a9445c646fd54a3d950f52df473c0380', 'shawzhou', '我的天', '2018-11-12 07:47:19.0000', '2018-11-12 07:47:19.0000');
INSERT INTO `discuss` VALUES (11, 1, 'a9445c646fd54a3d950f52df473c0380', 'shawzhou', '呜呜呜', '2018-11-12 07:47:21.0000', '2018-11-12 07:47:21.0000');
INSERT INTO `discuss` VALUES (12, 1, 'a9445c646fd54a3d950f52df473c0380', 'shawzhou', '哈哈哈', '2018-11-12 07:47:24.0000', '2018-11-12 07:47:24.0000');
INSERT INTO `discuss` VALUES (13, 1, 'a9445c646fd54a3d950f52df473c0380', 'shawzhou', '啦啦', '2018-11-12 07:47:25.0000', '2018-11-12 07:47:25.0000');
INSERT INTO `discuss` VALUES (15, 1, 'a9445c646fd54a3d950f52df473c0380', 'shawzhou', 'wuuw', '2018-11-12 07:48:28.0000', '2018-11-12 07:48:28.0000');
INSERT INTO `discuss` VALUES (16, 1, 'a9445c646fd54a3d950f52df473c0380', 'shaw', '我的天(=@__@=)哪里?', '2018-11-14 09:17:17.0000', '2018-11-14 09:17:17.0000');
INSERT INTO `discuss` VALUES (17, 1, 'a9445c646fd54a3d950f52df473c0380', 'shaw', 'hi,my name is shawzhou', '2018-11-14 09:23:31.0000', '2018-11-14 09:23:31.0000');
INSERT INTO `discuss` VALUES (18, 1, 'a9445c646fd54a3d950f52df473c0380', 'shaw', 'lol', '2018-11-14 09:23:36.0000', '2018-11-14 09:23:36.0000');
INSERT INTO `discuss` VALUES (19, 3, 'e51c2d2e4366433fb35f017c69468149', 'woshishui', '好酷啊,天哪!!!', '2018-12-01 08:51:52.0000', '2018-12-01 08:51:52.0000');
INSERT INTO `discuss` VALUES (20, 2, 'e51c2d2e4366433fb35f017c69468149', 'woshishui', '帅气!!', '2018-12-01 08:51:59.0000', '2018-12-01 08:51:59.0000');
INSERT INTO `discuss` VALUES (21, 4, 'e51c2d2e4366433fb35f017c69468149', 'woshishui', '风景图!', '2018-12-01 08:52:09.0000', '2018-12-01 08:52:09.0000');
COMMIT;
-- ----------------------------
-- Table structure for follow
-- ----------------------------
DROP TABLE IF EXISTS `follow`;
CREATE TABLE `follow` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`userId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户id',
`followedId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '关注者id',
`status` int(1) NOT NULL COMMENT '关注状态 0:取消关注 1:已关注',
`created_at` datetime NOT NULL COMMENT '创建时间',
`updated_at` datetime NOT NULL COMMENT '最后更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of follow
-- ----------------------------
BEGIN;
INSERT INTO `follow` VALUES (5, 'c1dcc8a53ce6493ca05a357aac2d0aa4', 'a9445c646fd54a3d950f52df473c0380', 1, '2018-11-15 09:39:02', '2018-11-15 09:39:10');
INSERT INTO `follow` VALUES (6, 'a9445c646fd54a3d950f52df473c0380', 'c1dcc8a53ce6493ca05a357aac2d0aa4', 1, '2018-11-15 10:36:33', '2018-11-15 10:36:33');
INSERT INTO `follow` VALUES (7, 'cbd6eb6093e74c7290aad936e8a9a2cd', 'daabb0b0a90244a5b3204ac6779708dc', 1, '2018-12-01 08:47:54', '2018-12-01 08:53:34');
INSERT INTO `follow` VALUES (8, 'e51c2d2e4366433fb35f017c69468149', 'cbd6eb6093e74c7290aad936e8a9a2cd', 1, '2018-12-01 08:53:34', '2018-12-01 08:55:33');
COMMIT;
-- ----------------------------
-- Table structure for SequelizeMeta
-- ----------------------------
DROP TABLE IF EXISTS `SequelizeMeta`;
CREATE TABLE `SequelizeMeta` (
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`name`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Records of SequelizeMeta
-- ----------------------------
BEGIN;
INSERT INTO `SequelizeMeta` VALUES ('20181012071252-init-users.js');
INSERT INTO `SequelizeMeta` VALUES ('20181012072948-init-users.js');
INSERT INTO `SequelizeMeta` VALUES ('20181018140213-init-topic.js');
INSERT INTO `SequelizeMeta` VALUES ('20181019074022-init-discuss.js');
INSERT INTO `SequelizeMeta` VALUES ('20181021093431-init-topic-like.js');
INSERT INTO `SequelizeMeta` VALUES ('20181025024702-init-follow.js');
COMMIT;
-- ----------------------------
-- Table structure for topic
-- ----------------------------
DROP TABLE IF EXISTS `topic`;
CREATE TABLE `topic` (
`topicId` int(10) NOT NULL AUTO_INCREMENT COMMENT '帖子唯一id',
`userId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户id',
`topicTitle` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '帖子标题',
`topicImg` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '帖子图片列表',
`created_at` datetime NOT NULL COMMENT '帖子创建时间',
`updated_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '帖子最后更新时间',
`address` varchar(255) NOT NULL COMMENT '发表地址',
PRIMARY KEY (`topicId`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of topic
-- ----------------------------
BEGIN;
INSERT INTO `topic` VALUES (1, 'a9445c646fd54a3d950f52df473c0380', '用户四帖子', '[\"http://p0.ifengimg.com/pmop/2017/1102/901DB09B75FD0FB5422F657D8706E493B04A10ED_size115_w1200_h675.jpeg\",\"https://upload.wikimedia.org/wikipedia/commons/thumb/f/f0/Raijin-ogata-emuseum.JPG/300px-Raijin-ogata-emuseum.JPG\"]', '2018-11-05 01:45:40', '2018-11-05 01:45:40', '');
INSERT INTO `topic` VALUES (2, 'cbd6eb6093e74c7290aad936e8a9a2cd', '詹姆斯、篮球!!', '[\"http://pic8.nipic.com/20100727/4745653_164946829874_2.jpg\",\"http://pic5.nipic.com/20100104/2590249_091443085128_2.jpg\"]', '2018-12-01 08:46:47', '2018-12-01 08:46:47', '');
INSERT INTO `topic` VALUES (3, 'cbd6eb6093e74c7290aad936e8a9a2cd', '科比、篮球!!', '[\"http://img.article.pchome.net/00/22/99/77/pic_lib/wm/kb_01.jpg\",\"http://www.pc6.com/uploadimages/2009-11/2009112261377237.jpg\"]', '2018-12-01 08:47:24', '2018-12-01 08:47:24', '');
INSERT INTO `topic` VALUES (4, 'e51c2d2e4366433fb35f017c69468149', '风景图片', '[\"http://img3.3lian.com/2013/c2/80/d/1.jpg\",\"http://img3.3lian.com/2013/v11/41/d/81.jpg\"]', '2018-12-01 08:51:40', '2018-12-01 08:51:40', '');
INSERT INTO `topic` VALUES (5, 'daabb0b0a90244a5b3204ac6779708dc', '时尚', '[\"http://pic.nipic.com/2007-12-22/20071222104958273_2.jpg\"]', '2018-12-01 08:54:24', '2018-12-01 08:54:24', '');
COMMIT;
-- ----------------------------
-- Table structure for topic_like
-- ----------------------------
DROP TABLE IF EXISTS `topic_like`;
CREATE TABLE `topic_like` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`userId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户id',
`topicId` int(10) NOT NULL COMMENT '帖子id',
`status` int(1) NOT NULL COMMENT '点赞状态1:有效赞,0:无效赞',
`created_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of topic_like
-- ----------------------------
BEGIN;
INSERT INTO `topic_like` VALUES (1, '369a08c015df4f61a802099673cf92aa', 1, 1, '2018-10-21 12:57:07', '2018-10-21 12:57:07');
INSERT INTO `topic_like` VALUES (2, 'a9445c646fd54a3d950f52df473c0380', 1, 0, '2018-11-15 03:51:47', '2018-11-15 03:51:47');
INSERT INTO `topic_like` VALUES (3, 'c1dcc8a53ce6493ca05a357aac2d0aa4', 1, 1, '2018-11-15 10:38:50', '2018-11-15 10:38:50');
INSERT INTO `topic_like` VALUES (4, 'e51c2d2e4366433fb35f017c69468149', 4, 1, '2018-12-01 08:51:43', '2018-12-01 08:51:43');
INSERT INTO `topic_like` VALUES (5, 'e51c2d2e4366433fb35f017c69468149', 3, 1, '2018-12-01 08:51:44', '2018-12-01 08:51:44');
INSERT INTO `topic_like` VALUES (6, 'daabb0b0a90244a5b3204ac6779708dc', 5, 1, '2018-12-01 08:54:30', '2018-12-01 08:54:30');
INSERT INTO `topic_like` VALUES (7, 'daabb0b0a90244a5b3204ac6779708dc', 2, 1, '2018-12-01 08:55:13', '2018-12-01 08:55:13');
INSERT INTO `topic_like` VALUES (8, 'daabb0b0a90244a5b3204ac6779708dc', 3, 1, '2018-12-01 08:58:55', '2018-12-01 08:58:55');
COMMIT;
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`userId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`avatarUrl` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`mobile` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`prefix` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`sex` varchar(1) DEFAULT '0',
`created_at` datetime DEFAULT NULL,
`updated_at` datetime NOT NULL,
`abstract` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of users
-- ----------------------------
BEGIN;
INSERT INTO `users` VALUES (3, 'cbd6eb6093e74c7290aad936e8a9a2cd', 'shawzhou', '466150516@qq.com', '111111', 'http://piyhxgz90.bkt.clouddn.com/1543653964188头像.jpg', NULL, '86', '男', '2018-12-01 08:45:12', '2018-12-01 08:46:09', '我是一个球员');
INSERT INTO `users` VALUES (4, 'e51c2d2e4366433fb35f017c69468149', 'woshishui', 'codingzx@gmail.com', '111111', 'http://piyhxgz90.bkt.clouddn.com/1543654269146风景.jpg', NULL, '86', '男', '2018-12-01 08:47:47', '2018-12-01 08:52:30', '风景专家');
INSERT INTO `users` VALUES (5, 'daabb0b0a90244a5b3204ac6779708dc', 'wuwan', 'wuwantian@gmail.com', '111111', 'http://piyhxgz90.bkt.clouddn.com/15436544923382531170_182711296228_2.jpg', NULL, '86', '女', '2018-12-01 08:52:49', '2018-12-01 08:54:58', NULL);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1; | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `act_acticle`
-- ----------------------------
DROP TABLE IF EXISTS `act_acticle`;
CREATE TABLE `act_acticle` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`auther` varchar(20) DEFAULT NULL COMMENT '作者',
`title` varchar(50) DEFAULT NULL COMMENT '标题',
`content` text COMMENT '内容',
`is_deleted` varchar(10) DEFAULT 'N' COMMENT '是否删除',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`modify_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1085810963130765316 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of act_acticle
-- ----------------------------
INSERT INTO `act_acticle` VALUES ('1', 'rstyro11', 'aabb', 'aabb', 'N', '2019-01-17 10:05:21', '2019-01-17 10:05:22');
INSERT INTO `act_acticle` VALUES ('97', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:02');
INSERT INTO `act_acticle` VALUES ('98', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:03');
INSERT INTO `act_acticle` VALUES ('99', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:03');
INSERT INTO `act_acticle` VALUES ('101', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('102', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('103', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('104', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('108', 'rstyro', 'aa', 'aa', 'Y', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('109', 'rstyro', 'aa', 'aa', 'Y', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('110', '帅大叔', '测试', '测试,我就是我,不一样的烟火', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('111', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('112', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('113', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('114', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('115', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('123', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('124', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('125', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('126', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('127', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('128', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('129', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
INSERT INTO `act_acticle` VALUES ('130', 'rstyro', 'aa', 'aa', 'N', '2019-01-17 10:05:21', '2019-01-17 10:35:04');
-- ----------------------------
-- Table structure for `admin_login`
-- ----------------------------
DROP TABLE IF EXISTS `admin_login`;
CREATE TABLE `admin_login` (
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`user_id` bigint(11) NOT NULL,
`last_login_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后登录时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=158 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of admin_login
-- ----------------------------
INSERT INTO `admin_login` VALUES ('15', '1', '2018-12-18 10:17:13');
INSERT INTO `admin_login` VALUES ('16', '1', '2018-12-18 10:23:47');
INSERT INTO `admin_login` VALUES ('17', '1', '2018-12-18 10:24:49');
INSERT INTO `admin_login` VALUES ('18', '1', '2018-12-18 10:25:03');
INSERT INTO `admin_login` VALUES ('19', '2', '2018-12-18 10:28:09');
INSERT INTO `admin_login` VALUES ('20', '2', '2018-12-18 10:29:31');
INSERT INTO `admin_login` VALUES ('21', '2', '2018-12-18 10:29:33');
INSERT INTO `admin_login` VALUES ('22', '2', '2018-12-18 10:29:49');
INSERT INTO `admin_login` VALUES ('23', '2', '2018-12-18 10:30:39');
INSERT INTO `admin_login` VALUES ('24', '2', '2018-12-18 10:31:39');
INSERT INTO `admin_login` VALUES ('25', '2', '2018-12-18 10:35:06');
INSERT INTO `admin_login` VALUES ('26', '2', '2018-12-19 01:37:42');
INSERT INTO `admin_login` VALUES ('27', '2', '2018-12-19 01:59:16');
INSERT INTO `admin_login` VALUES ('28', '2', '2018-12-19 02:02:01');
INSERT INTO `admin_login` VALUES ('29', '2', '2018-12-19 02:04:06');
INSERT INTO `admin_login` VALUES ('30', '1', '2018-12-19 02:04:19');
INSERT INTO `admin_login` VALUES ('31', '2', '2018-12-19 02:07:07');
INSERT INTO `admin_login` VALUES ('32', '2', '2018-12-19 02:11:48');
INSERT INTO `admin_login` VALUES ('33', '1', '2018-12-19 02:12:01');
INSERT INTO `admin_login` VALUES ('34', '1', '2018-12-19 02:24:09');
INSERT INTO `admin_login` VALUES ('35', '1', '2018-12-19 02:47:56');
INSERT INTO `admin_login` VALUES ('36', '1', '2018-12-19 02:50:48');
INSERT INTO `admin_login` VALUES ('37', '1', '2018-12-19 02:51:58');
INSERT INTO `admin_login` VALUES ('38', '1', '2018-12-19 03:53:12');
INSERT INTO `admin_login` VALUES ('39', '1', '2018-12-19 03:56:38');
INSERT INTO `admin_login` VALUES ('40', '1', '2018-12-19 03:59:09');
INSERT INTO `admin_login` VALUES ('41', '1', '2018-12-19 04:49:58');
INSERT INTO `admin_login` VALUES ('42', '1', '2018-12-19 05:05:50');
INSERT INTO `admin_login` VALUES ('43', '1', '2018-12-19 05:07:28');
INSERT INTO `admin_login` VALUES ('44', '1', '2018-12-19 05:09:09');
INSERT INTO `admin_login` VALUES ('45', '1', '2018-12-19 05:14:12');
INSERT INTO `admin_login` VALUES ('46', '1', '2018-12-19 05:17:19');
INSERT INTO `admin_login` VALUES ('47', '1', '2018-12-19 06:05:29');
INSERT INTO `admin_login` VALUES ('48', '1', '2018-12-19 08:13:07');
INSERT INTO `admin_login` VALUES ('49', '1', '2018-12-19 08:14:12');
INSERT INTO `admin_login` VALUES ('50', '1', '2018-12-19 08:18:26');
INSERT INTO `admin_login` VALUES ('51', '1', '2018-12-19 08:20:54');
INSERT INTO `admin_login` VALUES ('52', '1', '2018-12-19 08:23:04');
INSERT INTO `admin_login` VALUES ('53', '1', '2018-12-19 08:23:47');
INSERT INTO `admin_login` VALUES ('54', '1', '2018-12-19 08:27:08');
INSERT INTO `admin_login` VALUES ('55', '1', '2018-12-19 08:51:07');
INSERT INTO `admin_login` VALUES ('56', '1', '2018-12-19 09:20:47');
INSERT INTO `admin_login` VALUES ('57', '1', '2018-12-19 10:31:56');
INSERT INTO `admin_login` VALUES ('58', '1', '2018-12-19 10:34:23');
INSERT INTO `admin_login` VALUES ('59', '1', '2018-12-25 09:28:34');
INSERT INTO `admin_login` VALUES ('60', '1', '2018-12-26 03:16:07');
INSERT INTO `admin_login` VALUES ('61', '1', '2018-12-28 08:34:14');
INSERT INTO `admin_login` VALUES ('62', '1', '2018-12-28 11:36:03');
INSERT INTO `admin_login` VALUES ('63', '1', '2018-12-28 11:39:57');
INSERT INTO `admin_login` VALUES ('64', '1', '2018-12-28 11:40:41');
INSERT INTO `admin_login` VALUES ('65', '1', '2018-12-29 03:03:14');
INSERT INTO `admin_login` VALUES ('66', '1', '2018-12-29 12:58:21');
INSERT INTO `admin_login` VALUES ('67', '1', '2018-12-29 13:00:24');
INSERT INTO `admin_login` VALUES ('68', '1', '2018-12-29 13:04:47');
INSERT INTO `admin_login` VALUES ('69', '1', '2018-12-29 13:07:17');
INSERT INTO `admin_login` VALUES ('70', '1', '2018-12-29 13:40:09');
INSERT INTO `admin_login` VALUES ('71', '1', '2018-12-29 13:41:59');
INSERT INTO `admin_login` VALUES ('72', '1', '2018-12-29 14:00:47');
INSERT INTO `admin_login` VALUES ('73', '1', '2018-12-29 14:03:06');
INSERT INTO `admin_login` VALUES ('74', '1', '2018-12-29 14:04:31');
INSERT INTO `admin_login` VALUES ('75', '1', '2018-12-29 14:17:42');
INSERT INTO `admin_login` VALUES ('76', '1', '2018-12-29 14:19:44');
INSERT INTO `admin_login` VALUES ('77', '1', '2018-12-29 14:35:58');
INSERT INTO `admin_login` VALUES ('78', '1', '2018-12-29 15:15:51');
INSERT INTO `admin_login` VALUES ('79', '1', '2018-12-29 15:41:25');
INSERT INTO `admin_login` VALUES ('80', '1', '2019-01-03 07:37:29');
INSERT INTO `admin_login` VALUES ('81', '1', '2019-01-03 07:39:25');
INSERT INTO `admin_login` VALUES ('82', '1', '2019-01-03 07:42:43');
INSERT INTO `admin_login` VALUES ('83', '4', '2019-01-03 07:43:08');
INSERT INTO `admin_login` VALUES ('84', '1', '2019-01-03 07:43:17');
INSERT INTO `admin_login` VALUES ('85', '4', '2019-01-03 07:43:51');
INSERT INTO `admin_login` VALUES ('86', '1', '2019-01-03 07:44:01');
INSERT INTO `admin_login` VALUES ('87', '4', '2019-01-03 07:46:04');
INSERT INTO `admin_login` VALUES ('88', '1', '2019-01-03 07:47:40');
INSERT INTO `admin_login` VALUES ('89', '4', '2019-01-03 07:47:45');
INSERT INTO `admin_login` VALUES ('90', '1', '2019-01-03 07:49:05');
INSERT INTO `admin_login` VALUES ('91', '4', '2019-01-03 07:49:11');
INSERT INTO `admin_login` VALUES ('92', '4', '2019-01-03 07:50:52');
INSERT INTO `admin_login` VALUES ('93', '1', '2019-01-03 07:51:59');
INSERT INTO `admin_login` VALUES ('94', '4', '2019-01-03 07:52:04');
INSERT INTO `admin_login` VALUES ('95', '1', '2019-01-03 07:52:28');
INSERT INTO `admin_login` VALUES ('96', '4', '2019-01-03 07:52:59');
INSERT INTO `admin_login` VALUES ('97', '1', '2019-01-03 07:53:12');
INSERT INTO `admin_login` VALUES ('98', '4', '2019-01-03 07:53:26');
INSERT INTO `admin_login` VALUES ('99', '4', '2019-01-03 07:59:22');
INSERT INTO `admin_login` VALUES ('100', '1', '2019-01-03 07:59:33');
INSERT INTO `admin_login` VALUES ('101', '4', '2019-01-03 08:01:25');
INSERT INTO `admin_login` VALUES ('102', '4', '2019-01-03 08:03:28');
INSERT INTO `admin_login` VALUES ('103', '4', '2019-01-03 08:04:41');
INSERT INTO `admin_login` VALUES ('104', '1', '2019-01-03 08:05:44');
INSERT INTO `admin_login` VALUES ('105', '1', '2019-01-03 08:06:54');
INSERT INTO `admin_login` VALUES ('106', '1', '2019-01-03 08:30:21');
INSERT INTO `admin_login` VALUES ('107', '1', '2019-01-04 09:23:18');
INSERT INTO `admin_login` VALUES ('108', '1', '2019-01-04 09:23:44');
INSERT INTO `admin_login` VALUES ('109', '1', '2019-01-04 09:26:11');
INSERT INTO `admin_login` VALUES ('110', '2', '2019-01-16 18:03:26');
INSERT INTO `admin_login` VALUES ('111', '2', '2019-01-16 18:03:54');
INSERT INTO `admin_login` VALUES ('112', '2', '2019-01-17 09:57:13');
INSERT INTO `admin_login` VALUES ('113', '2', '2019-01-17 09:59:33');
INSERT INTO `admin_login` VALUES ('114', '2', '2019-01-17 10:00:09');
INSERT INTO `admin_login` VALUES ('115', '2', '2019-01-17 10:02:05');
INSERT INTO `admin_login` VALUES ('116', '2', '2019-01-17 10:04:10');
INSERT INTO `admin_login` VALUES ('117', '2', '2019-01-17 10:06:49');
INSERT INTO `admin_login` VALUES ('118', '2', '2019-01-17 10:10:36');
INSERT INTO `admin_login` VALUES ('119', '2', '2019-01-17 10:30:38');
INSERT INTO `admin_login` VALUES ('120', '2', '2019-01-17 10:33:10');
INSERT INTO `admin_login` VALUES ('121', '2', '2019-01-17 10:34:20');
INSERT INTO `admin_login` VALUES ('122', '2', '2019-01-17 10:42:04');
INSERT INTO `admin_login` VALUES ('123', '2', '2019-01-17 11:02:00');
INSERT INTO `admin_login` VALUES ('124', '2', '2019-01-17 11:05:55');
INSERT INTO `admin_login` VALUES ('125', '2', '2019-01-17 11:07:29');
INSERT INTO `admin_login` VALUES ('126', '2', '2019-01-17 11:13:20');
INSERT INTO `admin_login` VALUES ('127', '2', '2019-01-17 11:14:12');
INSERT INTO `admin_login` VALUES ('128', '2', '2019-01-17 11:15:53');
INSERT INTO `admin_login` VALUES ('129', '2', '2019-01-17 15:03:22');
INSERT INTO `admin_login` VALUES ('130', '2', '2019-01-17 15:06:58');
INSERT INTO `admin_login` VALUES ('131', '2', '2019-01-17 15:11:12');
INSERT INTO `admin_login` VALUES ('132', '2', '2019-01-17 15:21:34');
INSERT INTO `admin_login` VALUES ('133', '2', '2019-01-17 15:25:22');
INSERT INTO `admin_login` VALUES ('134', '2', '2019-01-17 15:28:07');
INSERT INTO `admin_login` VALUES ('135', '2', '2019-01-17 15:39:50');
INSERT INTO `admin_login` VALUES ('136', '2', '2019-01-17 15:43:49');
INSERT INTO `admin_login` VALUES ('137', '2', '2019-01-17 15:50:10');
INSERT INTO `admin_login` VALUES ('138', '2', '2019-01-17 15:55:19');
INSERT INTO `admin_login` VALUES ('139', '2', '2019-01-17 16:01:11');
INSERT INTO `admin_login` VALUES ('140', '2', '2019-01-17 16:04:03');
INSERT INTO `admin_login` VALUES ('141', '2', '2019-01-17 16:11:15');
INSERT INTO `admin_login` VALUES ('142', '2', '2019-01-17 16:14:40');
INSERT INTO `admin_login` VALUES ('143', '2', '2019-01-17 16:19:00');
INSERT INTO `admin_login` VALUES ('144', '2', '2019-01-17 16:21:42');
INSERT INTO `admin_login` VALUES ('145', '2', '2019-01-18 11:14:53');
INSERT INTO `admin_login` VALUES ('146', '2', '2019-01-18 11:17:30');
INSERT INTO `admin_login` VALUES ('147', '2', '2019-01-18 11:54:59');
INSERT INTO `admin_login` VALUES ('148', '2', '2019-01-18 14:54:54');
INSERT INTO `admin_login` VALUES ('149', '2', '2019-01-18 14:59:47');
INSERT INTO `admin_login` VALUES ('150', '2', '2019-01-18 15:00:24');
INSERT INTO `admin_login` VALUES ('151', '2', '2019-08-03 10:20:41');
INSERT INTO `admin_login` VALUES ('152', '2', '2019-08-03 10:23:24');
INSERT INTO `admin_login` VALUES ('153', '2', '2019-08-03 10:50:24');
INSERT INTO `admin_login` VALUES ('154', '2', '2019-08-03 10:57:04');
INSERT INTO `admin_login` VALUES ('155', '2', '2019-08-03 10:59:51');
INSERT INTO `admin_login` VALUES ('156', '2', '2019-08-03 11:00:22');
INSERT INTO `admin_login` VALUES ('157', '2', '2019-08-03 11:09:23');
-- ----------------------------
-- Table structure for `admin_menu`
-- ----------------------------
DROP TABLE IF EXISTS `admin_menu`;
CREATE TABLE `admin_menu` (
`menu_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`parent_id` int(11) DEFAULT NULL COMMENT '父级ID',
`menu_name` varchar(50) DEFAULT NULL COMMENT '菜单名称',
`menu_url` varchar(50) DEFAULT '#' COMMENT '菜单地址',
`menu_type` enum('2','1') DEFAULT '2' COMMENT '1 -- 系统菜单,2 -- 业务菜单',
`menu_icon` varchar(50) DEFAULT '#' COMMENT '菜单Icon',
`sort_num` int(11) DEFAULT '1' COMMENT '排序',
`user_id` int(11) DEFAULT '1' COMMENT '创建这个菜单的用户id',
`is_del` int(11) DEFAULT '0' COMMENT '1-- 删除状态,0 -- 正常',
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of admin_menu
-- ----------------------------
INSERT INTO `admin_menu` VALUES ('1', '0', '系统管理', '#', '1', 'fa fa-gears', '1', '1', '0', '2017-09-08 16:15:24', '2017-09-07 14:52:41');
INSERT INTO `admin_menu` VALUES ('2', '1', '菜单管理', 'admin/menu/list', '1', '#', '1', '1', '0', '2019-01-16 18:03:44', '2017-09-07 14:52:41');
INSERT INTO `admin_menu` VALUES ('3', '1', '角色管理', 'admin/role/list', '1', null, '2', '1', '0', '2019-01-16 18:03:45', '2017-09-07 14:52:41');
INSERT INTO `admin_menu` VALUES ('4', '1', '用户管理', 'admin/user/list', '1', '', '3', '1', '0', '2019-01-16 18:03:48', '2017-09-07 14:52:41');
INSERT INTO `admin_menu` VALUES ('5', '0', '测试管理', '#', '2', 'fa fa-tasks', '2', '1', '0', '2019-08-03 11:00:15', '2017-09-07 14:52:41');
INSERT INTO `admin_menu` VALUES ('6', '5', '文章列表', 'act/acticle/list', '2', '', '1', '1', '0', '2019-08-03 11:00:02', '2017-09-07 14:52:41');
INSERT INTO `admin_menu` VALUES ('7', '5', '测试', 'test/people/list', '2', '', '2', '1', '0', '2019-08-03 11:09:46', null);
-- ----------------------------
-- Table structure for `admin_role`
-- ----------------------------
DROP TABLE IF EXISTS `admin_role`;
CREATE TABLE `admin_role` (
`role_id` int(11) NOT NULL AUTO_INCREMENT,
`role_name` varchar(50) DEFAULT NULL COMMENT '角色名',
`role_desc` varchar(255) DEFAULT NULL COMMENT '角色描述',
`rights` varchar(255) DEFAULT '0' COMMENT '最大权限的值',
`add_qx` varchar(255) DEFAULT '0' COMMENT '添加权限',
`del_qx` varchar(255) DEFAULT '0' COMMENT '删除权限',
`edit_qx` varchar(255) DEFAULT '0' COMMENT '编辑权限',
`query_qx` varchar(255) DEFAULT '0' COMMENT '查看权限',
`user_id` varchar(10) DEFAULT NULL,
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of admin_role
-- ----------------------------
INSERT INTO `admin_role` VALUES ('1', '管理员', '管理员权限', '1267650600228229401496703205375', '254', '254', '254', '254', '1', '2019-01-17 09:59:29');
INSERT INTO `admin_role` VALUES ('2', 'tyro', '111', '254', '254', '160', '190', '254', '1', '2019-08-03 11:09:59');
-- ----------------------------
-- Table structure for `admin_user`
-- ----------------------------
DROP TABLE IF EXISTS `admin_user`;
CREATE TABLE `admin_user` (
`user_id` bigint(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) DEFAULT NULL COMMENT '用户名',
`nick_name` varchar(50) DEFAULT NULL COMMENT '昵称',
`password` varchar(50) DEFAULT NULL,
`pic_path` varchar(200) DEFAULT '/images/logo.png' COMMENT '头像地址',
`status` enum('unlock','lock') DEFAULT 'unlock',
`sessionId` varchar(50) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of admin_user
-- ----------------------------
INSERT INTO `admin_user` VALUES ('1', 'admin', '超级管理员', 'd033e22ae348aeb5660fc2140aec35850c4da997', 'http://www.lrshuai.top/upload/user/20170612/05976238.png', 'unlock', '87906722879D6DFCC6032721B4935B00', '2017-08-18 13:57:32');
INSERT INTO `admin_user` VALUES ('2', 'rstyro', '管理员', '86f7e437faa5a7fce15d1ddcb9eaeaea377667b8', 'http://www.lrshuai.top/upload/user/20170612/05976238.png', 'unlock', '2479928844EB9E0C7C35914DF696D819', '2017-08-18 13:57:32');
INSERT INTO `admin_user` VALUES ('4', 'asdf', 'asdf', '', 'http://localhost:8800/show//20190803/1564801821805.jpg', 'unlock', 'EADF971A41F761702C2C93CA090BDB09', '2019-01-03 07:40:07');
-- ----------------------------
-- Table structure for `admin_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `admin_user_role`;
CREATE TABLE `admin_user_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL,
`role_id` int(11) DEFAULT NULL,
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of admin_user_role
-- ----------------------------
INSERT INTO `admin_user_role` VALUES ('32', '2', '1', '2019-01-03 16:31:04');
INSERT INTO `admin_user_role` VALUES ('33', '2', '2', '2019-01-03 16:31:04');
INSERT INTO `admin_user_role` VALUES ('34', '4', '1', '2019-08-03 10:51:08');
-- ----------------------------
-- Table structure for `test_people`
-- ----------------------------
DROP TABLE IF EXISTS `test_people`;
CREATE TABLE `test_people` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL COMMENT '姓名',
`age` int(5) DEFAULT NULL COMMENT '年龄',
`sex` int(1) DEFAULT '1' COMMENT '性别:1--男,0 -- 女',
`is_deleted` varchar(2) DEFAULT 'N' COMMENT '是否删除,Y/N',
`create_by` bigint(20) DEFAULT NULL,
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`modify_by` bigint(20) DEFAULT NULL,
`modify_time` datetime DEFAULT NULL COMMENT '鏇存柊鏃堕棿',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of test_people
-- ----------------------------
INSERT INTO `test_people` VALUES ('1', 'rstyro', '24', '1', 'N', '1', '2019-01-18 11:44:24', '1', '2019-01-18 11:44:26'); | the_stack |
----
--- CREATE TABLE
----
set codegen_cost_threshold=0;
create schema explain_pretty;
set current_schema=explain_pretty;
create table explain_pretty.EXPLAIN_PRETTY_TABLE_01
(
col_int int
,col_int2 int
,col_num numeric(10,4)
,col_char char
,col_varchar varchar(20)
,col_date date
,col_interval interval
) with(orientation=column);
COPY EXPLAIN_PRETTY_TABLE_01(col_int, col_int2, col_num, col_char, col_varchar, col_date, col_interval) FROM stdin;
11 21 1.25 T beijing 2005-02-14 2 day 13:24:56
12 12 2.25 F tianjing 2016-02-15 2 day 13:24:56
13 23 1.25 T beijing 2006-02-14 4 day 13:25:25
12 12 1.25 T xian 2005-02-14 4 day 13:25:25
15 25 2.25 F beijing 2006-02-14 2 day 13:24:56
17 27 2.27 C xian 2006-02-14 2 day 13:24:56
18 28 2.25 C tianjing 2008-02-14 8 day 13:28:56
12 22 2.25 F tianjing 2016-02-15 2 day 13:24:56
18 27 2.25 F xian 2008-02-14 2 day 13:24:56
16 26 2.36 C beijing 2006-05-08 8 day 13:28:56
16 16 2.36 C beijing 2006-05-08 8 day 13:28:56
18 28 2.25 T xian 2008-02-14 4 day 13:25:25
\.
create table explain_pretty.EXPLAIN_PRETTY_TABLE_02
(
col_int int
,col_int2 int
,col_num numeric(10,4)
,col_char char
,col_varchar varchar(20)
,col_date date
,col_interval interval
) with(orientation=column);
COPY EXPLAIN_PRETTY_TABLE_02(col_int, col_int2, col_num, col_char, col_varchar, col_date, col_interval) FROM stdin;
11 13 1.25 T beijing 2005-02-14 5 day 13:24:56
12 14 2.25 F tianjing 2006-02-15 2 day 13:24:56
13 14 1.25 T beijing 2006-02-14 4 day 13:25:25
12 15 1.25 T xian 2005-02-14 5 day 13:25:25
15 15 2.25 F beijing 2006-02-14 2 day 13:24:56
\.
analyze EXPLAIN_PRETTY_TABLE_01;
analyze EXPLAIN_PRETTY_TABLE_02;
create table row_append_table_01 as select * from EXPLAIN_PRETTY_TABLE_01;
create table row_append_table_02 as select * from EXPLAIN_PRETTY_TABLE_02;
analyze row_append_table_01;
analyze row_append_table_02;
explain (verbose on, costs off, analyze on, cpu on)
(select col_interval from EXPLAIN_PRETTY_TABLE_01 where col_int > 11) union (select col_interval from EXPLAIN_PRETTY_TABLE_02 where col_int > 12) order by col_interval;
explain (verbose on, costs off, analyze on, cpu on)
(select col_interval from row_append_table_01 where col_int > 11) union (select col_interval from row_append_table_02 where col_int > 12) order by col_interval;
explain (analyze on, costs off, timing off) select * from row_append_table_01 join row_append_table_02 on row_append_table_01.col_int=row_append_table_02.col_int and row_append_table_01.col_int + row_append_table_02.col_int > 100;
--test sort,hashagg, cpu buffer
set explain_perf_mode = run;
\o hw_explain_pretty_result.txt
explain performance select * from row_append_table_01 where col_int > 15;
explain (analyze on, timing off) select * from row_append_table_01 join row_append_table_02 on row_append_table_01.col_int=row_append_table_02.col_int and row_append_table_01.col_int + row_append_table_02.col_int > 100;
explain performance
(select distinct
col_char, col_varchar from EXPLAIN_PRETTY_TABLE_01 where col_int2<23 order by col_char)
union
(select distinct col_char, col_varchar from EXPLAIN_PRETTY_TABLE_01 where col_int2>=23)
union
(select distinct col_char, col_varchar from EXPLAIN_PRETTY_TABLE_01 where col_int2 = 26) order by col_char, col_varchar;
explain (analyze on, cpu on, buffers on)
(select distinct
col_char, col_varchar from EXPLAIN_PRETTY_TABLE_01 where col_int2<23 order by col_char)
union
(select distinct col_char, col_varchar from EXPLAIN_PRETTY_TABLE_01 where col_int2>=23)
union
(select distinct col_char, col_varchar from EXPLAIN_PRETTY_TABLE_01 where col_int2 = 26) order by col_char, col_varchar;
--test setop
explain select t1.col_int from EXPLAIN_PRETTY_TABLE_01 t1 minus select t2.col_int from EXPLAIN_PRETTY_TABLE_02 t2;
--test subquery
explain performance
select t1.col_int from EXPLAIN_PRETTY_TABLE_01 t1 intersect all (select t2.col_int from EXPLAIN_PRETTY_TABLE_02 t2) order by 1;
explain performance
select t1.col_int from row_append_table_01 t1 intersect all (select t2.col_int from row_append_table_02 t2) order by 1;
--test hashjoin
set enable_nestloop=off;
set enable_mergejoin=off;
explain (analyze on, cpu on, buffers on)
select count(*) from EXPLAIN_PRETTY_TABLE_01 t1 join EXPLAIN_PRETTY_TABLE_01 t2 on t1.col_int2 = t2.col_int2 where t1.col_int2<23;
explain performance
select count(*) from EXPLAIN_PRETTY_TABLE_01 t1 join EXPLAIN_PRETTY_TABLE_01 t2 on t1.col_int2 = t2.col_int2 where t1.col_int2<23;
--test left join
explain performance
select count(*) from EXPLAIN_PRETTY_TABLE_01 t1 left join EXPLAIN_PRETTY_TABLE_01 t2 on t1.col_int2 = t2.col_int2 where t1.col_int2<23;
set enable_vector_engine=off;
explain performance
select count(*) from EXPLAIN_PRETTY_TABLE_01 t1 join EXPLAIN_PRETTY_TABLE_01 t2 on t1.col_int2 = t2.col_int2 where t1.col_int2<23 order by 1;
reset enable_vector_engine;
--test nestloop
set enable_hashjoin=off;
set enable_mergejoin=off;
set enable_nestloop=on;
explain verbose select count(*) from EXPLAIN_PRETTY_TABLE_01 t1 join EXPLAIN_PRETTY_TABLE_01 t2 on t1.col_int2 = t2.col_int2 where t1.col_int2<23;
explain performance
select count(*) from EXPLAIN_PRETTY_TABLE_01 t1 left join EXPLAIN_PRETTY_TABLE_01 t2 on t1.col_int2 = t2.col_int2 where t1.col_int2<23;
\o
\! rm hw_explain_pretty_result.txt
--error condition
explain (format xml, verbose on) select count(*) from EXPLAIN_PRETTY_TABLE_01 t1 join EXPLAIN_PRETTY_TABLE_01 t2 on t1.col_int2 = t2.col_int2 where t1.col_int2<23;
--test multi query
set enable_nestloop=off;
set enable_mergejoin=off;
set enable_hashjoin=on;
select 1\; explain analyze select count(*) from EXPLAIN_PRETTY_TABLE_01 t1 join EXPLAIN_PRETTY_TABLE_01 t2 on t1.col_int2 = t2.col_int2 where t1.col_int2<23;
---
create table explain_pretty.row_EXPLAIN_PRETTY_TABLE_01
(
col_int int
,col_int2 int
,col_num numeric(10,4)
,col_char char
,col_varchar varchar(20)
,col_date date
,col_interval interval
);
create table explain_pretty.row_EXPLAIN_PRETTY_TABLE_02
(
col_int int
,col_int2 int
,col_num numeric(10,4)
,col_char char
,col_varchar varchar(20)
,col_date date
,col_interval interval
);
\o hw_explain_pretty_result.txt
--test subplans
explain analyze insert into explain_pretty.row_EXPLAIN_PRETTY_TABLE_01 select * from explain_pretty.EXPLAIN_PRETTY_TABLE_01;
--test bitmap
create table test_bitmap (a int, b int, c int);
insert into test_bitmap values (null, generate_series(1, 20), null);
insert into test_bitmap values (null, null, generate_series(1, 20));
create index idx_b on test_bitmap (b);
create index idx_c on test_bitmap (c);
analyze test_bitmap;
set enable_seqscan = off;
set enable_indexscan = off;
explain performance select * from test_bitmap where b<10 and c<5;
explain (analyze on, cpu on, buffers on) select * from test_bitmap where b<10 and c<5;
explain performance select * from test_bitmap where b<10 or c<5;
explain (analyze on, cpu on, buffers on) select * from test_bitmap where b<10 or c<5;
\o
\! rm hw_explain_pretty_result.txt
--test partition table
CREATE TABLE EXPLAIN_PRETTY_TABLE_05(
a1 character varying(1000),
a2 integer
)
WITH (orientation=column)
PARTITION BY RANGE (a2)
(
PARTITION p1 VALUES LESS THAN (5),
PARTITION p2 VALUES LESS THAN (10)
);
insert into EXPLAIN_PRETTY_TABLE_05 values('a',1);
insert into EXPLAIN_PRETTY_TABLE_05 values('a',5);
\o hw_explain_pretty_result.txt
explain select * from EXPLAIN_PRETTY_TABLE_05 order by 2;
\o
\! rm hw_explain_pretty_result.txt
CREATE TABLE EXPLAIN_PRETTY_TABLE_06
(
L_ORDERKEY BIGINT NOT NULL
, L_PARTKEY BIGINT NOT NULL
, L_SUPPKEY BIGINT NOT NULL
, L_LINENUMBER BIGINT NOT NULL
, L_QUANTITY DECIMAL(15,2) NOT NULL
, L_EXTENDEDPRICE DECIMAL(15,2) NOT NULL
, L_DISCOUNT DECIMAL(15,2) NOT NULL
, L_TAX DECIMAL(15,2) NOT NULL
, L_RETURNFLAG CHAR(1) NOT NULL
, L_LINESTATUS CHAR(1) NOT NULL
, L_SHIPDATE DATE NOT NULL
, L_COMMITDATE DATE NOT NULL
, L_RECEIPTDATE DATE NOT NULL
, L_SHIPINSTRUCT CHAR(25) NOT NULL
, L_SHIPMODE CHAR(10) NOT NULL
, L_COMMENT VARCHAR(44) NOT NULL
--, primary key (L_ORDERKEY, L_LINENUMBER)
)
with (orientation = column)
PARTITION BY RANGE(L_SHIPDATE)
(
PARTITION L_SHIPDATE_1 VALUES LESS THAN('1993-01-01 00:00:00'),
PARTITION L_SHIPDATE_2 VALUES LESS THAN('1994-01-01 00:00:00'),
PARTITION L_SHIPDATE_3 VALUES LESS THAN('1995-01-01 00:00:00'),
PARTITION L_SHIPDATE_4 VALUES LESS THAN('1996-01-01 00:00:00'),
PARTITION L_SHIPDATE_5 VALUES LESS THAN('1997-01-01 00:00:00'),
PARTITION L_SHIPDATE_6 VALUES LESS THAN('1998-01-01 00:00:00'),
PARTITION L_SHIPDATE_7 VALUES LESS THAN('1999-01-01 00:00:00')
)
;
create index lineitem_index on EXPLAIN_PRETTY_TABLE_06(l_orderkey) local;
set enable_seqscan=off;
set enable_tidscan=off;
set enable_indexscan = on;
set enable_bitmapscan=off;
explain (costs off) delete from EXPLAIN_PRETTY_TABLE_06 where l_orderkey<1;
-- test subplan executed on CN
create table store_sales_extend_min_1t
(
ss_item_sk int,
ss_sold_date_sk smallint,
ss_ticket_number bigint,
ss_date date,
ss_time time,
ss_timestamp timestamp,
ss_list_price decimal(7,2)
)
with (orientation = column);
create table store_sales_extend_max_1t
(ss_item_sk int,
ss_sold_date_sk smallint,
ss_ticket_number bigint,
ss_date date,
ss_time time,
ss_timestamp timestamp,
ss_list_price decimal(7,2)
)
with (orientation = column);
\o hw_explain_pretty_result.txt
explain performance select min((select max(ss_date) from store_sales_extend_min_1t) + (select min(ss_time) from store_sales_extend_max_1t)) from store_sales_extend_min_1t;
\o
\! rm hw_explain_pretty_result.txt
-- test declare curosr
set explain_perf_mode=normal;
start transaction;
explain (costs off) cursor cursor_1 for select count(*) from store_sales_extend_min_1t;
explain analyze cursor cursor_1 for select count(*) from store_sales_extend_min_1t;
end;
set explain_perf_mode=pretty;
start transaction;
explain (costs off) cursor cursor_1 for select count(*) from store_sales_extend_min_1t;
explain analyze cursor cursor_1 for select count(*) from store_sales_extend_min_1t;
end;
--test rows Removed by Filter for partition table and nestloop when nloops larger than 1
set explain_perf_mode=normal;
create table tbl_part(a int) partition by range(a)
(
partition P1 values less than (10),
partition P2 values less than (20),
partition P3 values less than (30),
partition P4 values less than (40),
partition P5 values less than (MAXVALUE)
);
insert into tbl_part values(generate_series(1,50));
select count(*) from tbl_part;
select count(*) from tbl_part where a%2=0;
explain analyze select count(*) from tbl_part where a%2=0;
Drop table tbl_part cascade;
set enable_mergejoin=off;
set enable_hashjoin=off;
create table tb1_nestloop(a int,b int);
create table tb2_nestloop (a int,d int);
insert into tb1_nestloop values(generate_series(1,10), generate_series(1,10));
insert into tb2_nestloop values(generate_series(1,20), generate_series(1,20));
analyze tb1_nestloop;
analyze tb2_nestloop;
explain analyze select * from tb1_nestloop ,tb2_nestloop where tb1_nestloop.a= tb2_nestloop.d and tb1_nestloop.a%2=0 and tb2_nestloop.a%2=0;
set enable_mergejoin=on;
set enable_hashjoin=on;
drop table tb1_nestloop cascade;
drop table tb2_nestloop cascade;
drop schema explain_pretty cascade; | the_stack |
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Direct_Costing_Raw_Data (Year Date);
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Direct_Costing_Raw_Data (Year Date, AD_Org_ID numeric(10,0));
CREATE OR REPLACE FUNCTION de_metas_endcustomer_fresh_reports.Direct_Costing_Raw_Data (Year Date, AD_Org_ID numeric(10,0)) RETURNS TABLE
(
Margin text,
l1_Value Character Varying,
L1_Name Character Varying,
L2_Value Character Varying,
L2_Name Character Varying,
L3_Value Character Varying,
L3_Name Character Varying,
Balance_1000 numeric,
Balance_2000 numeric,
Balance_100 numeric,
Balance_150 numeric,
Balance_Other numeric,
Balance numeric,
Budget_1000 numeric,
Budget_2000 numeric,
Budget_100 numeric,
Budget_150 numeric,
Budget numeric,
L1_Multiplicator numeric,
L2_Multiplicator numeric,
L3_Multiplicator numeric,
Seq text,
ad_org_id numeric
)
AS
$BODY$
SELECT
margin,
l1_value, l1_name, l2_value, l2_name, l3_value, l3_name,
Balance_1000 * Multi_1000 AS Balance_1000,
Balance_2000 * Multi_2000 AS Balance_2000,
Balance_100 * Multi_100 AS Balance_100,
Balance_150 * Multi_150 AS Balance_150,
Balance_Other * Multi_150 AS Balance_Other,
Balance_1000 * Multi_1000 + Balance_2000 * Multi_2000 + Balance_100 * Multi_100 + Balance_150 * Multi_150 + Balance_Other * Multi_150 AS Balance,
Budget_1000 * Multi_1000 AS Budget_1000,
Budget_2000 * Multi_2000 AS Budget_2000,
Budget_100 * Multi_100 AS Budget_100,
Budget_150 * Multi_150 AS Budget_150,
Budget_1000 * Multi_1000 + Budget_2000 * Multi_2000 + Budget_100 * Multi_100 + Budget_150 * Multi_150 + Budget_Other * Multi_150 AS Budget,
acctBalance(l1_ElementValue_ID, 0, 1) AS l1_Multiplicator,
acctBalance(l2_ElementValue_ID, 0, 1) AS l2_Multiplicator,
acctBalance(l3_ElementValue_ID, 0, 1) AS l3_Multiplicator,
SeqNo AS Seq,
fa.ad_org_id
FROM
de_metas_endcustomer_fresh_reports.Direct_Costing_selection s
LEFT OUTER JOIN (
SELECT
Account_ID,
SUM( CASE WHEN a.Value = '1000' THEN Balance ELSE 0 END ) AS Balance_1000,
SUM( CASE WHEN a.Value = '2000' THEN Balance ELSE 0 END ) AS Balance_2000,
SUM( CASE WHEN a.Value = '100' THEN Balance ELSE 0 END ) AS Balance_100,
SUM( CASE WHEN a.Value = '150' THEN Balance ELSE 0 END ) AS Balance_150,
SUM( CASE WHEN a.Value IS NULL OR (a.Value != '1000' AND a.Value != '2000' AND a.Value != '100' AND a.Value != '150')
THEN Balance ELSE 0 END ) AS Balance_Other,
SUM( CASE WHEN a.Value = '1000' THEN Budget ELSE 0 END ) AS Budget_1000,
SUM( CASE WHEN a.Value = '2000' THEN Budget ELSE 0 END ) AS Budget_2000,
SUM( CASE WHEN a.Value = '100' THEN Budget ELSE 0 END ) AS Budget_100,
SUM( CASE WHEN a.Value = '150' THEN Budget ELSE 0 END ) AS Budget_150,
SUM( CASE WHEN a.Value IS NULL OR (a.Value != '1000' AND a.Value != '2000' AND a.Value != '100' AND a.Value != '150')
THEN Budget ELSE 0 END ) AS Budget_Other,
fa.ad_org_id
FROM
(
SELECT fa.Account_ID
, COALESCE(ap.C_Activity_ID, a.C_Activity_ID) as C_Activity_ID
, CASE WHEN postingtype = 'A' THEN AmtAcctCr - AmtAcctDr ELSE 0 END AS Balance
, CASE WHEN postingtype = 'B' THEN AmtAcctCr - AmtAcctDr ELSE 0 END AS Budget,
fa.ad_org_id
FROM Fact_Acct fa
left outer join C_Activity a on (a.C_Activity_ID=fa.C_Activity_ID)
left outer join C_Activity ap on (ap.C_Activity_ID=a.Parent_Activity_ID)
WHERE
CASE WHEN postingtype = 'B' THEN
dateacct::date <= (select enddate from c_period where c_period_id=report.Get_Period( 1000000, $1 ))
ELSE
(dateacct::date <= $1) END
AND dateacct::Date >= (
SELECT MIN( StartDate )::Date FROM C_Period
WHERE C_Year_ID = (SELECT C_Year_ID FROM C_Period WHERE C_Period_ID = report.Get_Period( 1000000, $1 ))
)
) fa
LEFT OUTER JOIN C_Activity a ON fa.C_Activity_ID = a.C_Activity_ID
GROUP BY Account_ID, fa.ad_org_id
) fa ON fa.Account_ID = s.L3_ElementValue_ID
WHERE fa.ad_org_id = $2
ORDER BY
SeqNo
$BODY$
LANGUAGE sql STABLE
;
DROP FUNCTION IF EXISTS report.fresh_Direct_Costing (IN Date date, IN showBudget character varying, IN showRemaining character varying) ;
CREATE OR REPLACE FUNCTION report.fresh_Direct_Costing (IN Date date,
IN showBudget character varying, -- only used in report
IN showRemaining character varying,
IN ad_org_id numeric(10,0)) -- only used in report
RETURNS TABLE
(
seq text,
margin text,
margin_incr_1000 numeric,
margin_incr_2000 numeric,
margin_incr_100 numeric,
margin_incr_150 numeric,
margin_incr_other numeric,
margin_incr_all numeric,
l1_value character varying,
l1_name character varying,
isdisplayl1sum boolean,
l1_1000 numeric,
l1_2000 numeric,
l1_100 numeric,
l1_150 numeric,
l1_other numeric,
l1_all numeric,
l1_multiplicator numeric,
l2_value character varying,
l2_name character varying,
l2_1000 numeric,
l2_2000 numeric,
l2_100 numeric,
l2_150 numeric,
l2_other numeric,
l2_all numeric,
l2_multiplicator numeric,
l3_value character varying,
l3_name character varying,
balance_1000 numeric,
balance_2000 numeric,
balance_100 numeric,
balance_150 numeric,
balance_other numeric,
balance numeric,
l3_multiplicator numeric,
margin_budget_incr_1000 numeric,
margin_budget_incr_2000 numeric,
margin_budget_incr_100 numeric,
margin_budget_incr_150 numeric,
margin_budget_incr_all numeric,
l1_budget_1000 numeric,
l1_budget_2000 numeric,
l1_budget_100 numeric,
l1_budget_150 numeric,
l1_budget_all numeric,
l2_budget_1000 numeric,
l2_budget_2000 numeric,
l2_budget_100 numeric,
l2_budget_150 numeric,
l2_budget_all numeric,
budget_1000 numeric,
budget_2000 numeric,
budget_100 numeric,
budget_150 numeric,
budget numeric,
ad_org_id numeric,
gross_1000 numeric,
gross_2000 numeric,
gross_100 numeric,
gross_150 numeric,
gross_all numeric,
startdate date,
enddate date,
margin_percentage_1000 numeric,
margin_percentage_2000 numeric,
margin_percentage_100 numeric,
margin_percentage_150 numeric,
margin_percentage_all numeric,
margin_budget_percentage_1000 numeric,
margin_budget_percentage_2000 numeric,
margin_budget_percentage_100 numeric,
margin_budget_percentage_150 numeric,
margin_budget_percentage_all numeric,
l1_percentage_1000 numeric,
l1_percentage_2000 numeric,
l1_percentage_100 numeric,
l1_percentage_150 numeric,
l1_percentage_all numeric,
l1_budget_percentage_1000 numeric,
l1_budget_percentage_2000 numeric,
l1_budget_percentage_100 numeric,
l1_budget_percentage_150 numeric,
l1_budget_percentage_all numeric,
l2_percentage_1000 numeric,
l2_percentage_2000 numeric,
l2_percentage_100 numeric,
l2_percentage_150 numeric,
l2_percentage_all numeric,
l2_budget_percentage_1000 numeric,
l2_budget_percentage_2000 numeric,
l2_budget_percentage_100 numeric,
l2_budget_percentage_150 numeric,
l2_budget_percentage_all numeric,
l3_percentage_1000 numeric,
l3_percentage_2000 numeric,
l3_percentage_100 numeric,
l3_percentage_150 numeric,
l3_percentage_all numeric,
l3_budget_percentage_1000 numeric,
l3_budget_percentage_2000 numeric,
l3_budget_percentage_100 numeric,
l3_budget_percentage_150 numeric,
l3_budget_percentage_all numeric,
isdisplaymarginsum boolean,
isdisplayother boolean
)
AS
$$
SELECT
*,
ROUND( Margin_Incr_1000 / Gross_1000 * 100, 2 ) AS Margin_Percentage_1000,
ROUND( Margin_Incr_2000 / Gross_2000 * 100, 2 ) AS Margin_Percentage_2000,
ROUND( Margin_Incr_100 / Gross_100 * 100, 2 ) AS Margin_Percentage_100,
ROUND( Margin_Incr_150 / Gross_150 * 100, 2 ) AS Margin_Percentage_150,
ROUND( Margin_Incr_all / Gross_all * 100, 2 ) AS Margin_Percentage_all,
ROUND( Margin_Incr_1000 / NULLIF( Margin_Budget_Incr_1000, 0 ) * 100, 2 ) AS Margin_Budget_Percentage_1000,
ROUND( Margin_Incr_2000 / NULLIF( Margin_Budget_Incr_2000, 0 ) * 100, 2 ) AS Margin_Budget_Percentage_2000,
ROUND( Margin_Incr_100 / NULLIF( Margin_Budget_Incr_100, 0 ) * 100, 2 ) AS Margin_Budget_Percentage_100,
ROUND( Margin_Incr_150 / NULLIF( Margin_Budget_Incr_150, 0 ) * 100, 2 ) AS Margin_Budget_Percentage_150,
ROUND( Margin_Incr_all / NULLIF( Margin_Budget_Incr_All, 0 ) * 100, 2 ) AS Margin_Budget_Percentage_all,
ABS( ROUND( L1_1000 / Gross_1000 * 100, 2 ) ) AS L1_Percentage_1000,
ABS( ROUND( L1_2000 / Gross_2000 * 100, 2 ) ) AS L1_Percentage_2000,
ABS( ROUND( L1_100 / Gross_100 * 100, 2 ) ) AS L1_Percentage_100,
ABS( ROUND( L1_150 / Gross_150 * 100, 2 ) ) AS L1_Percentage_150,
ABS( ROUND( L1_All / Gross_All * 100, 2 ) ) AS L1_Percentage_All,
ABS( ROUND( L1_1000 / NULLIF( L1_Budget_1000, 0 ) * 100, 2 ) ) AS L1_Budget_Percentage_1000,
ABS( ROUND( L1_2000 / NULLIF( L1_Budget_2000, 0 ) * 100, 2 ) ) AS L1_Budget_Percentage_2000,
ABS( ROUND( L1_100 / NULLIF( L1_Budget_100, 0 ) * 100, 2 ) ) AS L1_Budget_Percentage_100,
ABS( ROUND( L1_150 / NULLIF( L1_Budget_150, 0 ) * 100, 2 ) ) AS L1_Budget_Percentage_150,
ABS( ROUND( L1_All / NULLIF( L1_Budget_All, 0 ) * 100, 2 ) ) AS L1_Budget_Percentage_All,
ABS( ROUND( L2_1000 / Gross_1000 * 100, 2 ) ) AS L2_Percentage_1000,
ABS( ROUND( L2_2000 / Gross_2000 * 100, 2 ) ) AS L2_Percentage_2000,
ABS( ROUND( L2_100 / Gross_100 * 100, 2 ) ) AS L2_Percentage_100,
ABS( ROUND( L2_150 / Gross_150 * 100, 2 ) ) AS L2_Percentage_150,
ABS( ROUND( L2_All / Gross_All * 100, 2 ) ) AS L2_Percentage_All,
ABS( ROUND( L2_1000 / NULLIF( L2_Budget_1000, 0 ) * 100, 2 ) ) AS L2_Budget_Percentage_1000,
ABS( ROUND( L2_2000 / NULLIF( L2_Budget_2000, 0 ) * 100, 2 ) ) AS L2_Budget_Percentage_2000,
ABS( ROUND( L2_100 / NULLIF( L2_Budget_100, 0 ) * 100, 2 ) ) AS L2_Budget_Percentage_100,
ABS( ROUND( L2_150 / NULLIF( L2_Budget_150, 0 ) * 100, 2 ) ) AS L2_Budget_Percentage_150,
ABS( ROUND( L2_All / NULLIF( L2_Budget_All, 0 ) * 100, 2 ) ) AS L2_Budget_Percentage_All,
ABS( ROUND( Balance_1000 / Gross_1000 * 100, 2 ) ) AS L3_Percentage_1000,
ABS( ROUND( Balance_2000 / Gross_2000 * 100, 2 ) ) AS L3_Percentage_2000,
ABS( ROUND( Balance_100 / Gross_100 * 100, 2 ) ) AS L3_Percentage_100,
ABS( ROUND( Balance_150 / Gross_150 * 100, 2 ) ) AS L3_Percentage_150,
ABS( ROUND( Balance / Gross_all * 100, 2 ) ) AS L3_percentage_All,
ABS( ROUND( Balance_1000 / NULLIF( Budget_1000, 0 ) * 100, 2 ) ) AS L3_Budget_Percentage_1000,
ABS( ROUND( Balance_2000 / NULLIF( Budget_2000, 0 ) * 100, 2 ) ) AS L3_Budget_Percentage_2000,
ABS( ROUND( Balance_100 / NULLIF( Budget_100, 0 ) * 100, 2 ) ) AS L3_Budget_Percentage_100,
ABS( ROUND( Balance_150 / NULLIF( Budget_150, 0 ) * 100, 2 ) ) AS L3_Budget_Percentage_150,
ABS( ROUND( Balance / NULLIF( Budget, 0 ) * 100, 2 ) ) AS L3_Budget_Percentage_All,
-- If current Margin is the Last Margin, display the final sum group footer
First_Agg( Margin ) OVER (ORDER BY Seq Desc ) != Margin AS isDisplayMarginSum,
-- If there are no Sums in the 'Other'-Column, don't display it
SUM( Balance_Other ) OVER () != 0 AS isDisplayOther
FROM
(
SELECT
*,
-- Get initial profit to create the percentage of each line and/or sum
NULLIF( First_agg ( L2_1000 ) OVER (ORDER BY Seq ), 0 ) AS Gross_1000,
NULLIF( First_agg ( L2_2000 ) OVER (ORDER BY Seq ), 0 ) AS Gross_2000,
NULLIF( First_agg ( L2_100 ) OVER (ORDER BY Seq ), 0 ) AS Gross_100,
NULLIF( First_agg ( L2_150 ) OVER (ORDER BY Seq ), 0 ) AS Gross_150,
NULLIF( First_agg ( L2_all ) OVER (ORDER BY Seq ), 0 ) AS Gross_All
FROM
(
SELECT
seq,
-- Margin
margin,
--
-- Balances
-- Create an Incremental sum for the Margins. This sum will be Displayed in the report
-- It is a requirement of the report that the sums are incremental over the margins
-- Note: The window function Last_Value does not get the Last Value, but the maximum
First_Agg( Incr_1000 ) OVER ( PARTITION BY Margin ORDER BY Seq DESC ) AS Margin_Incr_1000,
First_Agg( Incr_2000 ) OVER ( PARTITION BY Margin ORDER BY Seq DESC ) AS Margin_Incr_2000,
First_Agg( Incr_100 ) OVER ( PARTITION BY Margin ORDER BY Seq DESC ) AS Margin_Incr_100,
First_Agg( Incr_150 ) OVER ( PARTITION BY Margin ORDER BY Seq DESC ) AS Margin_Incr_150,
First_Agg( Incr_other ) OVER ( PARTITION BY Margin ORDER BY Seq DESC ) AS Margin_Incr_other,
First_Agg( Incr ) OVER ( PARTITION BY Margin ORDER BY Seq DESC ) AS Margin_Incr_All,
-- Level 1
L1_Value, L1_Name, isDisplayL1Sum,
Sum ( Balance_1000 ) OVER ( PARTITION BY Margin, L1_Value) AS L1_1000,
Sum ( Balance_2000 ) OVER ( PARTITION BY Margin, L1_Value) AS L1_2000,
Sum ( Balance_100 ) OVER ( PARTITION BY Margin, L1_Value) AS L1_100,
Sum ( Balance_150 ) OVER ( PARTITION BY Margin, L1_Value) AS L1_150,
Sum ( Balance_other ) OVER ( PARTITION BY Margin, L1_Value) AS L1_other,
Sum ( Balance ) OVER ( PARTITION BY Margin, L1_Value) AS L1_All,
L1_Multiplicator,
-- Level 2
L2_Value, L2_Name,
Sum ( Balance_1000 ) OVER ( PARTITION BY Margin, L2_Value) AS L2_1000,
Sum ( Balance_2000 ) OVER ( PARTITION BY Margin, L2_Value) AS L2_2000,
Sum ( Balance_100 ) OVER ( PARTITION BY Margin, L2_Value) AS L2_100,
Sum ( Balance_150 ) OVER ( PARTITION BY Margin, L2_Value) AS L2_150,
Sum ( Balance_other ) OVER ( PARTITION BY Margin, L2_Value) AS L2_other,
Sum ( Balance ) OVER ( PARTITION BY Margin, L2_Value) AS L2_All,
L2_Multiplicator,
-- Level 3
L3_Value, L3_Name,
Balance_1000, Balance_2000, Balance_100, Balance_150, Balance_other, Balance,
L3_Multiplicator,
--
-- Budgets
-- Margin
First_Agg( Budget_Incr_1000 ) OVER ( PARTITION BY Margin ORDER BY Seq DESC ) AS Margin_Budget_Incr_1000,
First_Agg( Budget_Incr_2000 ) OVER ( PARTITION BY Margin ORDER BY Seq DESC ) AS Margin_Budget_Incr_2000,
First_Agg( Budget_Incr_100 ) OVER ( PARTITION BY Margin ORDER BY Seq DESC ) AS Margin_Budget_Incr_100,
First_Agg( Budget_Incr_150 ) OVER ( PARTITION BY Margin ORDER BY Seq DESC ) AS Margin_Budget_Incr_150,
First_Agg( Budget_Incr ) OVER ( PARTITION BY Margin ORDER BY Seq DESC ) AS Margin_Budget_Incr_All,
-- Level 1
Sum ( Budget_1000 ) OVER ( PARTITION BY Margin, L1_Value ) AS L1_Budget_1000,
Sum ( Budget_2000 ) OVER ( PARTITION BY Margin, L1_Value ) AS L1_Budget_2000,
Sum ( Budget_100 ) OVER ( PARTITION BY Margin, L1_Value ) AS L1_Budget_100,
Sum ( Budget_150 ) OVER ( PARTITION BY Margin, L1_Value) AS L1_Budget_150,
Sum ( Budget ) OVER ( PARTITION BY Margin, L1_Value ) AS L1_Budget_All,
-- Level 2
Sum ( Budget_1000 ) OVER ( PARTITION BY Margin, L2_Value) AS L2_Budget_1000,
Sum ( Budget_2000 ) OVER ( PARTITION BY Margin, L2_Value) AS L2_Budget_2000,
Sum ( Budget_100 ) OVER ( PARTITION BY Margin, L2_Value) AS L2_Budget_100,
Sum ( Budget_150 ) OVER ( PARTITION BY Margin, L2_Value) AS L2_Budget_150,
Sum ( Budget ) OVER ( PARTITION BY Margin, L2_Value) AS L2_Budget_All,
-- Level 3
Budget_1000, Budget_2000, Budget_100, Budget_150, Budget,
ad_org_id
FROM
(
SELECT
seq, margin,
L1_Name IS NOT NULL AND L1_Name != '' AS isDisplayL1Sum,
L1_Value, L1_Name, L2_Value, L2_Name, L3_Value, L3_Name,
-- Preparing an incremantal Sum over all lines, to later extract an incremental sum for margin level
Balance_1000, SUM( Balance_1000 ) OVER (ORDER BY Seq ) AS Incr_1000,
Balance_2000, SUM( Balance_2000 ) OVER (ORDER BY Seq ) AS Incr_2000,
Balance_100, SUM( Balance_100 ) OVER (ORDER BY Seq ) AS Incr_100,
Balance_150, SUM( Balance_150 ) OVER (ORDER BY Seq ) AS Incr_150,
Balance_other, SUM( Balance_other ) OVER (ORDER BY Seq ) AS Incr_other,
Balance, SUM( Balance ) OVER (ORDER BY Seq ) AS Incr,
Budget_1000, SUM( Budget_1000 ) OVER (ORDER BY Seq ) AS Budget_Incr_1000,
Budget_2000, SUM( Budget_2000 ) OVER (ORDER BY Seq ) AS Budget_Incr_2000,
Budget_100, SUM( Budget_100 ) OVER (ORDER BY Seq ) AS Budget_Incr_100,
Budget_150, SUM( Budget_150 ) OVER (ORDER BY Seq ) AS Budget_Incr_150,
Budget, SUM( Budget ) OVER (ORDER BY Seq ) AS Budget_Incr,
L3_Multiplicator, L2_Multiplicator, L1_Multiplicator,
ad_org_id
FROM
de_metas_endcustomer_fresh_reports.Direct_Costing_Raw_Data($1, $4)
) x
) y
) z
LEFT OUTER JOIN (
SELECT
First_Agg ( StartDate::text ORDER BY PeriodNo )::Date AS StartDate,
$1::date AS EndDate
FROM
C_Period
WHERE
C_Year_ID = (SELECT C_Year_ID FROM C_Period WHERE C_Period_ID = report.Get_Period( 1000000, $1::Date ))
) date ON true
WHERE ad_org_id = $4
ORDER BY
seq
$$
LANGUAGE sql STABLE;
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Direct_Costing_Raw_Data_Remainings (Year Date) ;
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Direct_Costing_Raw_Data_Remainings (Year Date, AD_Org_ID numeric(10,0) );
CREATE OR REPLACE FUNCTION de_metas_endcustomer_fresh_reports.Direct_Costing_Raw_Data_Remainings (Year Date, AD_Org_ID numeric(10,0) ) RETURNS TABLE
(
l_Value Character Varying, L_Name Character Varying,
Balance_1000 numeric, Balance_2000 numeric, Balance_100 numeric, Balance_150 numeric, Balance_Other numeric, Balance numeric,
Budget_1000 numeric, Budget_2000 numeric, Budget_100 numeric, Budget_150 numeric, Budget numeric,
L_Multiplicator numeric,
ad_org_id numeric (10,0)
)
AS
$BODY$
SELECT
l_value, l_name,
Balance_1000 * Multi_1000 AS Balance_1000,
Balance_2000 * Multi_2000 AS Balance_2000,
Balance_100 * Multi_100 AS Balance_100,
Balance_150 * Multi_150 AS Balance_150,
Balance_Other * Multi_150 AS Balance_Other,
Balance_1000 * Multi_1000 + Balance_2000 * Multi_2000 + Balance_100 * Multi_100 + Balance_150 * Multi_150 + Balance_Other * Multi_150 AS Balance,
Budget_1000 * Multi_1000 AS Budget_1000,
Budget_2000 * Multi_2000 AS Budget_2000,
Budget_100 * Multi_100 AS Budget_100,
Budget_150 * Multi_150 AS Budget_150,
Budget_1000 * Multi_1000 + Budget_2000 * Multi_2000 + Budget_100 * Multi_100 + Budget_150 * Multi_150 + Budget_Other * Multi_150 AS Budget,
acctBalance(l_ElementValue_ID, 0, 1) AS l_Multiplicator,
fa.ad_org_id
FROM
de_metas_endcustomer_fresh_reports.Direct_Costing_selection_Remainings s
LEFT OUTER JOIN (
SELECT
Account_ID,
SUM( CASE WHEN a.Value = '1000' THEN Balance ELSE 0 END ) AS Balance_1000,
SUM( CASE WHEN a.Value = '2000' THEN Balance ELSE 0 END ) AS Balance_2000,
SUM( CASE WHEN a.Value = '100' THEN Balance ELSE 0 END ) AS Balance_100,
SUM( CASE WHEN a.Value = '150' THEN Balance ELSE 0 END ) AS Balance_150,
SUM( CASE WHEN a.Value IS NULL OR (a.Value != '1000' AND a.Value != '2000' AND a.Value != '100' AND a.Value != '150')
THEN Balance ELSE 0 END ) AS Balance_Other,
SUM( CASE WHEN a.Value = '1000' THEN Budget ELSE 0 END ) AS Budget_1000,
SUM( CASE WHEN a.Value = '2000' THEN Budget ELSE 0 END ) AS Budget_2000,
SUM( CASE WHEN a.Value = '100' THEN Budget ELSE 0 END ) AS Budget_100,
SUM( CASE WHEN a.Value = '150' THEN Budget ELSE 0 END ) AS Budget_150,
SUM( CASE WHEN a.Value IS NULL OR (a.Value != '1000' AND a.Value != '2000' AND a.Value != '100' AND a.Value != '150')
THEN Budget ELSE 0 END ) AS Budget_Other,
fa.ad_org_id
FROM
(
SELECT fa.Account_ID
, COALESCE(ap.C_Activity_ID, a.C_Activity_ID) as C_Activity_ID
, CASE WHEN postingtype = 'A' THEN AmtAcctCr - AmtAcctDr ELSE 0 END AS Balance
, CASE WHEN postingtype = 'B' THEN AmtAcctCr - AmtAcctDr ELSE 0 END AS Budget
, fa.ad_org_id
FROM Fact_Acct fa
left outer join C_Activity a on (a.C_Activity_ID=fa.C_Activity_ID)
left outer join C_Activity ap on (ap.C_Activity_ID=a.Parent_Activity_ID)
WHERE CASE WHEN postingtype = 'B' THEN
dateacct::date <= (select enddate from c_period where c_period_id=report.Get_Period( 1000000, $1 ))
ELSE
(dateacct::date <= $1) END
AND dateacct::Date >= (
SELECT MIN( StartDate )::Date FROM C_Period
WHERE C_Year_ID = (SELECT C_Year_ID FROM C_Period WHERE C_Period_ID = report.Get_Period( 1000000, $1 ))
)
AND fa.ad_org_id = $2
) fa
LEFT OUTER JOIN C_Activity a ON fa.C_Activity_ID = a.C_Activity_ID
GROUP BY Account_ID, fa.ad_org_id
) fa ON fa.Account_ID = s.L_ElementValue_ID
WHERE fa.ad_org_id = $2
$BODY$
LANGUAGE sql STABLE
;
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Direct_Costing_Unused_Balance (Year Date, showBudget character varying, AD_Org_ID numeric(10,0) );
CREATE OR REPLACE FUNCTION de_metas_endcustomer_fresh_reports.Direct_Costing_Unused_Balance (Year Date, showBudget character varying, AD_Org_ID numeric(10,0) ) RETURNS TABLE
(
l_value character varying,
l_name character varying,
l_1000 numeric,
l_2000 numeric,
l_100 numeric,
l_150 numeric,
l_other numeric,
l_all numeric,
l_budget_all numeric,
balance_1000 numeric,
balance_2000 numeric,
balance_100 numeric,
balance_150 numeric,
balance_other numeric,
balance numeric,
l_multiplicator numeric,
budget_1000 numeric,
budget_2000 numeric,
budget_100 numeric,
budget_150 numeric,
budget numeric,
ad_org_id numeric,
gross_1000 numeric,
gross_2000 numeric,
gross_100 numeric,
gross_150 numeric,
gross_all numeric,
startdate date,
enddate date,
l_percentage_1000 numeric,
l_percentage_2000 numeric,
l_percentage_100 numeric,
l_percentage_150 numeric,
l_percentage_all numeric,
l_budget_percentage_1000 numeric,
l_budget_percentage_2000 numeric,
l_budget_percentage_100 numeric,
l_budget_percentage_150 numeric,
l_budget_percentage_all numeric,
isdisplayother boolean
)
AS
$BODY$
SELECT
* ,
ABS( ROUND( Balance_1000 / Gross_1000 * 100, 2 ) ) AS L_Percentage_1000,
ABS( ROUND( Balance_2000 / Gross_2000 * 100, 2 ) ) AS L_Percentage_2000,
ABS( ROUND( Balance_100 / Gross_100 * 100, 2 ) ) AS L_Percentage_100,
ABS( ROUND( Balance_150 / Gross_150 * 100, 2 ) ) AS L_Percentage_150,
ABS( ROUND( Balance / Gross_all * 100, 2 ) ) AS L_percentage_All,
ABS( ROUND( Balance_1000 / NULLIF( Budget_1000, 0 ) * 100, 2 ) ) AS L_Budget_Percentage_1000,
ABS( ROUND( Balance_2000 / NULLIF( Budget_2000, 0 ) * 100, 2 ) ) AS L_Budget_Percentage_2000,
ABS( ROUND( Balance_100 / NULLIF( Budget_100, 0 ) * 100, 2 ) ) AS L_Budget_Percentage_100,
ABS( ROUND( Balance_150 / NULLIF( Budget_150, 0 ) * 100, 2 ) ) AS L_Budget_Percentage_150,
ABS( ROUND( Balance / NULLIF( Budget, 0 ) * 100, 2 ) ) AS L_Budget_Percentage_All,
SUM( Balance_Other ) OVER () != 0 AS isDisplayOther
FROM
(
SELECT
*,
NULLIF( First_agg ( L_1000 ) OVER ( ORDER BY L_Value ), 0 ) AS Gross_1000,
NULLIF( First_agg ( L_2000 ) OVER ( ORDER BY L_Value ), 0 ) AS Gross_2000,
NULLIF( First_agg ( L_100 ) OVER ( ORDER BY L_Value ), 0 ) AS Gross_100,
NULLIF( First_agg ( L_150 ) OVER ( ORDER BY L_Value ), 0 ) AS Gross_150,
NULLIF( First_agg ( L_all ) OVER ( ORDER BY L_Value ), 0 ) AS Gross_All
FROM
(
SELECT
--
-- Balances
-- Create an Incremental sum for the Margins. This sum will be Displayed in the report
-- It is a requirement of the report that the sums are incremental over the margins
-- Note: The window function Last_Value does not get the Last Value, but the maximum
-- Level
L_Value, L_Name,
Sum ( Balance_1000 ) OVER ( PARTITION BY L_Value ) AS L_1000,
Sum ( Balance_2000 ) OVER ( PARTITION BY L_Value ) AS L_2000,
Sum ( Balance_100 ) OVER ( PARTITION BY L_Value ) AS L_100,
Sum ( Balance_150 ) OVER ( PARTITION BY L_Value ) AS L_150,
Sum ( Balance_other ) OVER ( PARTITION BY L_Value ) AS L_other,
Sum ( Balance ) OVER ( PARTITION BY L_Value ) AS L_All,
Sum ( Budget ) OVER ( PARTITION BY L_Value ) AS L_Budget_All,
Balance_1000, Balance_2000, Balance_100, Balance_150, Balance_other, Balance,
L_Multiplicator,
--
-- Budgets
Budget_1000, Budget_2000, Budget_100, Budget_150, Budget,
ad_org_id
FROM
(
SELECT
L_Value, L_Name,
-- Preparing an incremantal Sum over all lines, to later extract an incremental sum for margin level
Balance_1000,
Balance_2000,
Balance_100,
Balance_150,
Balance_other,
Balance,
Budget_1000,
Budget_2000,
Budget_100,
Budget_150,
Budget,
L_Multiplicator,
ad_org_id
FROM
de_metas_endcustomer_fresh_reports.Direct_Costing_Raw_Data_Remainings($1, $3)
) x
) y
) z
LEFT OUTER JOIN (
SELECT
First_Agg ( StartDate::text ORDER BY PeriodNo )::Date AS StartDate,
$1 ::date AS EndDate
FROM
C_Period
WHERE
C_Year_ID = (SELECT C_Year_ID FROM C_Period WHERE C_Period_ID = report.Get_Period( 1000000, $1::Date ))
) date ON true
WHERE ad_org_id = $3
$BODY$
LANGUAGE sql STABLE
; | the_stack |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.2
-- Dumped by pg_dump version 9.6.1
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: citus; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS citus WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION citus; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION citus IS 'Citus distributed database';
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: btree_gin; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS btree_gin WITH SCHEMA public;
--
-- Name: EXTENSION btree_gin; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION btree_gin IS 'support for indexing common datatypes in GIN';
--
-- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;
--
-- Name: EXTENSION btree_gist; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION btree_gist IS 'support for indexing common datatypes in GiST';
--
-- Name: citext; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;
--
-- Name: EXTENSION citext; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION citext IS 'data type for case-insensitive character strings';
--
-- Name: cube; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS cube WITH SCHEMA public;
--
-- Name: EXTENSION cube; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION cube IS 'data type for multidimensional cubes';
--
-- Name: dblink; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS dblink WITH SCHEMA public;
--
-- Name: EXTENSION dblink; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION dblink IS 'connect to other PostgreSQL databases from within a database';
--
-- Name: earthdistance; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS earthdistance WITH SCHEMA public;
--
-- Name: EXTENSION earthdistance; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION earthdistance IS 'calculate great-circle distances on the surface of the Earth';
--
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch WITH SCHEMA public;
--
-- Name: EXTENSION fuzzystrmatch; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION fuzzystrmatch IS 'determine similarities and distance between strings';
--
-- Name: hll; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS hll WITH SCHEMA public;
--
-- Name: EXTENSION hll; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION hll IS 'type for storing hyperloglog data';
--
-- Name: hstore; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;
--
-- Name: EXTENSION hstore; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs';
--
-- Name: intarray; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS intarray WITH SCHEMA public;
--
-- Name: EXTENSION intarray; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION intarray IS 'functions, operators, and index support for 1-D arrays of integers';
--
-- Name: ltree; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS ltree WITH SCHEMA public;
--
-- Name: EXTENSION ltree; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION ltree IS 'data type for hierarchical tree-like structures';
--
-- Name: pg_buffercache; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_buffercache WITH SCHEMA public;
--
-- Name: EXTENSION pg_buffercache; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pg_buffercache IS 'examine the shared buffer cache';
--
-- Name: pg_freespacemap; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_freespacemap WITH SCHEMA public;
--
-- Name: EXTENSION pg_freespacemap; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pg_freespacemap IS 'examine the free space map (FSM)';
--
-- Name: pg_prewarm; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_prewarm WITH SCHEMA public;
--
-- Name: EXTENSION pg_prewarm; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pg_prewarm IS 'prewarm relation data';
--
-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public;
--
-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pg_stat_statements IS 'track execution statistics of all SQL statements executed';
--
-- Name: pg_trgm; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
--
-- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';
--
-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
--
-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';
--
-- Name: pgrowlocks; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pgrowlocks WITH SCHEMA public;
--
-- Name: EXTENSION pgrowlocks; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pgrowlocks IS 'show row-level locking information';
--
-- Name: pgstattuple; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pgstattuple WITH SCHEMA public;
--
-- Name: EXTENSION pgstattuple; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pgstattuple IS 'show tuple-level statistics';
--
-- Name: session_analytics; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS session_analytics WITH SCHEMA public;
--
-- Name: shard_rebalancer; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS shard_rebalancer WITH SCHEMA public;
--
-- Name: sslinfo; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS sslinfo WITH SCHEMA public;
--
-- Name: EXTENSION sslinfo; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION sslinfo IS 'information about SSL certificates';
--
-- Name: tablefunc; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS tablefunc WITH SCHEMA public;
--
-- Name: EXTENSION tablefunc; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION tablefunc IS 'functions that manipulate whole tables, including crosstab';
--
-- Name: unaccent; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public;
--
-- Name: EXTENSION unaccent; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION unaccent IS 'text search dictionary that removes accents';
--
-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;
--
-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';
--
-- Name: xml2; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS xml2 WITH SCHEMA public;
--
-- Name: EXTENSION xml2; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION xml2 IS 'XPath querying and XSLT';
SET search_path = public, pg_catalog;
--
-- Name: campaign_cost_model; Type: TYPE; Schema: public; Owner: -
--
CREATE TYPE campaign_cost_model AS ENUM (
'cost_per_click',
'cost_per_impression'
);
--
-- Name: campaign_state; Type: TYPE; Schema: public; Owner: -
--
CREATE TYPE campaign_state AS ENUM (
'paused',
'running',
'archived'
);
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: ads; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE ads (
id integer NOT NULL,
company_id integer NOT NULL,
campaign_id integer NOT NULL,
name text NOT NULL,
image_url text NOT NULL,
target_url text NOT NULL,
impressions_count bigint DEFAULT 0 NOT NULL,
clicks_count bigint DEFAULT 0 NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: ads_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE ads_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: ads_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE ads_id_seq OWNED BY ads.id;
--
-- Name: campaigns; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE campaigns (
id integer NOT NULL,
company_id integer NOT NULL,
name text NOT NULL,
cost_model campaign_cost_model NOT NULL,
state campaign_state NOT NULL,
monthly_budget integer,
blacklisted_site_urls character varying[],
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: campaigns_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE campaigns_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: campaigns_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE campaigns_id_seq OWNED BY campaigns.id;
--
-- Name: click_daily_rollups; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE click_daily_rollups (
id uuid DEFAULT uuid_generate_v4() NOT NULL,
company_id integer NOT NULL,
ad_id integer NOT NULL,
count bigint NOT NULL,
date date NOT NULL
);
--
-- Name: clicks; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE clicks (
id uuid DEFAULT uuid_generate_v4() NOT NULL,
company_id integer NOT NULL,
ad_id integer NOT NULL,
clicked_at timestamp without time zone NOT NULL,
site_url text NOT NULL,
cost_per_click_usd numeric(20,10),
user_ip inet NOT NULL,
user_data jsonb NOT NULL
);
--
-- Name: companies; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE companies (
id integer NOT NULL,
name text NOT NULL,
image_url text NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: companies_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE companies_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: companies_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE companies_id_seq OWNED BY companies.id;
--
-- Name: impression_daily_rollups; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE impression_daily_rollups (
id uuid DEFAULT uuid_generate_v4() NOT NULL,
company_id integer NOT NULL,
ad_id integer NOT NULL,
count bigint NOT NULL,
date date NOT NULL
);
--
-- Name: impressions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE impressions (
id uuid DEFAULT uuid_generate_v4() NOT NULL,
company_id integer NOT NULL,
ad_id integer NOT NULL,
seen_at timestamp without time zone NOT NULL,
site_url text NOT NULL,
cost_per_impression_usd numeric(20,10),
user_ip inet NOT NULL,
user_data jsonb NOT NULL
);
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE schema_migrations (
version character varying NOT NULL
);
--
-- Name: users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE users (
id integer NOT NULL,
company_id integer NOT NULL,
encrypted_password text NOT NULL,
email text NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE users_id_seq OWNED BY users.id;
--
-- Name: ads id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY ads ALTER COLUMN id SET DEFAULT nextval('ads_id_seq'::regclass);
--
-- Name: campaigns id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY campaigns ALTER COLUMN id SET DEFAULT nextval('campaigns_id_seq'::regclass);
--
-- Name: companies id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY companies ALTER COLUMN id SET DEFAULT nextval('companies_id_seq'::regclass);
--
-- Name: users id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
--
-- Name: ads ads_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY ads
ADD CONSTRAINT ads_pkey PRIMARY KEY (id, company_id);
--
-- Name: campaigns campaigns_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY campaigns
ADD CONSTRAINT campaigns_pkey PRIMARY KEY (id, company_id);
--
-- Name: click_daily_rollups click_daily_rollups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY click_daily_rollups
ADD CONSTRAINT click_daily_rollups_pkey PRIMARY KEY (id, company_id);
--
-- Name: clicks clicks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY clicks
ADD CONSTRAINT clicks_pkey PRIMARY KEY (id, company_id);
--
-- Name: companies companies_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY companies
ADD CONSTRAINT companies_pkey PRIMARY KEY (id);
--
-- Name: impression_daily_rollups impression_daily_rollups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY impression_daily_rollups
ADD CONSTRAINT impression_daily_rollups_pkey PRIMARY KEY (id, company_id);
--
-- Name: impressions impressions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY impressions
ADD CONSTRAINT impressions_pkey PRIMARY KEY (id, company_id);
--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: index_clicks_on_clicked_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_clicks_on_clicked_at ON clicks USING btree (clicked_at);
--
-- Name: index_impressions_on_seen_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_impressions_on_seen_at ON impressions USING btree (seen_at);
--
-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
--
-- PostgreSQL database dump complete
--
SET search_path TO "$user", public;
INSERT INTO schema_migrations (version) VALUES ('20160523211642');
INSERT INTO schema_migrations (version) VALUES ('20160622202229'); | the_stack |
use aj_report;
-- ----------------------------
-- Table structure for access_authority
-- ----------------------------
DROP TABLE IF EXISTS `access_authority`;
CREATE TABLE `access_authority` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`parent_target` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '父ID',
`target` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '菜单代码',
`target_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '菜单名称',
`action` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '按钮代码',
`action_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '按钮名称',
`sort` int(8) NULL DEFAULT NULL,
`enable_flag` int(1) NOT NULL DEFAULT 1 COMMENT '0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG',
`delete_flag` int(1) NULL DEFAULT 0 COMMENT ' 0--未删除 1--已删除 DIC_NAME=DEL_FLAG',
`create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '创建人',
`create_time` datetime(0) NOT NULL COMMENT '创建时间',
`update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '修改人',
`update_time` datetime(0) NOT NULL COMMENT '修改时间',
`version` tinyint(8) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `TA_uniq_index`(`target`, `action`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 233 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '运营权限表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of access_authority
-- ----------------------------
INSERT INTO `access_authority` VALUES (1, NULL, 'access', '用户权限', '', '', 1, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (2, NULL, 'report', '报表设计', '', '', 2, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (101, 'access', 'authorityManage', '权限管理', 'insert', '新增权限', 101, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (102, 'access', 'authorityManage', '权限管理', 'update', '修改权限', 102, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (103, 'access', 'authorityManage', '权限管理', 'delete', '删除权限', 103, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (104, 'access', 'authorityManage', '权限管理', 'query', '查询权限', 104, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (105, 'access', 'roleManage', '角色管理', 'insert', '新建角色', 105, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2021-07-17 20:41:46', 2);
INSERT INTO `access_authority` VALUES (106, 'access', 'roleManage', '角色管理', 'update', '修改角色', 106, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (107, 'access', 'roleManage', '角色管理', 'delete', '删除角色', 107, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (108, 'access', 'roleManage', '角色管理', 'query', '查询角色', 108, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (109, 'access', 'roleManage', '角色管理', 'grantAuthority', '分配权限', 109, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (110, 'access', 'userManage', '用户管理', 'insert', '新增用户', 110, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (111, 'access', 'userManage', '用户管理', 'update', '修改用户', 111, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (112, 'access', 'userManage', '用户管理', 'delete', '删除用户', 112, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (113, 'access', 'userManage', '用户管理', 'query', '查询用户', 113, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (114, 'access', 'userManage', '用户管理', 'resetPassword', '重置密码', 114, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (115, 'access', 'userManage', '用户管理', 'grantRole', '分配角色', 115, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (200, 'report', 'datasourceManage', '数据源管理', 'insert', '新建数据源', 200, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (201, 'report', 'datasourceManage', '数据源管理', 'update', '修改数据源', 201, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (202, 'report', 'datasourceManage', '数据源管理', 'delete', '删除数据源', 202, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (203, 'report', 'datasourceManage', '数据源管理', 'query', '查询数据源', 203, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (204, 'report', 'resultsetManage', '数据集管理', 'insert', '新建数据集', 204, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (205, 'report', 'resultsetManage', '数据集管理', 'update', '修改数据集', 205, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (206, 'report', 'resultsetManage', '数据集管理', 'delete', '删除数据集', 206, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (207, 'report', 'resultsetManage', '数据集管理', 'query', '查询数据集', 207, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (221, 'report', 'reportManage', '报表管理', 'insert', '新建报表', 221, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (222, 'report', 'reportManage', '报表管理', 'update', '修改报表', 222, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (223, 'report', 'reportManage', '报表管理', 'delete', '删除报表', 223, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (224, 'report', 'reportManage', '报表管理', 'query', '查询报表', 224, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (231, 'report', 'bigScreenManage', '大屏报表', 'share', '分享报表', 231, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (232, 'report', 'bigScreenManage', '大屏报表', 'view', '查看大屏', 232, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `access_authority` VALUES (233, 'report', 'bigScreenManage', '大屏报表', 'design', '设计大屏', 233, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
-- Table structure for `access_role`
-- ----------------------------
DROP TABLE IF EXISTS `access_role`;
CREATE TABLE `access_role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`role_code` varchar(32) COLLATE utf8_bin NOT NULL COMMENT '角色编码',
`role_name` varchar(64) COLLATE utf8_bin NOT NULL COMMENT '角色名称',
`enable_flag` int(1) NOT NULL DEFAULT '1' COMMENT '0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG',
`delete_flag` int(1) DEFAULT '0' COMMENT ' 0--未删除 1--已删除 DIC_NAME=DEL_FLAG',
`create_by` varchar(64) COLLATE utf8_bin NOT NULL COMMENT '创建人',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_by` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='运营角色表';
-- ----------------------------
-- Records of `access_role`
-- ----------------------------
BEGIN;
INSERT INTO `access_role` VALUES ('1', 'root', '超级管理员', '1', '0', 'root', '2019-07-23 16:00:33', 'root', '2019-07-23 16:00:33', '1'), ('2', 'designer', '设计员', '1', '0', 'root', '2019-07-23 16:00:33', 'root', '2019-07-23 16:00:33', '1'), ('3', 'viewer', '查看员', '1', '0', 'root', '2019-07-23 16:00:33', 'root', '2019-07-23 16:00:33', '1');
COMMIT;
-- ----------------------------
-- Table structure for access_role_authority
-- ----------------------------
DROP TABLE IF EXISTS `access_role_authority`;
CREATE TABLE `access_role_authority` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`role_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '角色名称',
`target` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '权限目标',
`action` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 510 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '运营角色权限表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of access_role_authority
-- ----------------------------
INSERT INTO `access_role_authority` VALUES (460, 'viewer', 'datasourceManage', 'query');
INSERT INTO `access_role_authority` VALUES (461, 'viewer', 'resultsetManage', 'query');
INSERT INTO `access_role_authority` VALUES (462, 'viewer', 'reportManage', 'query');
INSERT INTO `access_role_authority` VALUES (463, 'viewer', 'bigScreenManage', 'share');
INSERT INTO `access_role_authority` VALUES (464, 'viewer', 'bigScreenManage', 'view');
INSERT INTO `access_role_authority` VALUES (465, 'designer', 'datasourceManage', 'insert');
INSERT INTO `access_role_authority` VALUES (466, 'designer', 'datasourceManage', 'update');
INSERT INTO `access_role_authority` VALUES (467, 'designer', 'datasourceManage', 'delete');
INSERT INTO `access_role_authority` VALUES (468, 'designer', 'datasourceManage', 'query');
INSERT INTO `access_role_authority` VALUES (469, 'designer', 'resultsetManage', 'insert');
INSERT INTO `access_role_authority` VALUES (470, 'designer', 'resultsetManage', 'update');
INSERT INTO `access_role_authority` VALUES (471, 'designer', 'resultsetManage', 'delete');
INSERT INTO `access_role_authority` VALUES (472, 'designer', 'resultsetManage', 'query');
INSERT INTO `access_role_authority` VALUES (473, 'designer', 'reportManage', 'insert');
INSERT INTO `access_role_authority` VALUES (474, 'designer', 'reportManage', 'update');
INSERT INTO `access_role_authority` VALUES (475, 'designer', 'reportManage', 'delete');
INSERT INTO `access_role_authority` VALUES (476, 'designer', 'reportManage', 'query');
INSERT INTO `access_role_authority` VALUES (477, 'designer', 'bigScreenManage', 'share');
INSERT INTO `access_role_authority` VALUES (478, 'designer', 'bigScreenManage', 'view');
INSERT INTO `access_role_authority` VALUES (479, 'designer', 'bigScreenManage', 'design');
INSERT INTO `access_role_authority` VALUES (480, 'root', 'authorityManage', 'insert');
INSERT INTO `access_role_authority` VALUES (481, 'root', 'authorityManage', 'update');
INSERT INTO `access_role_authority` VALUES (482, 'root', 'authorityManage', 'delete');
INSERT INTO `access_role_authority` VALUES (483, 'root', 'authorityManage', 'query');
INSERT INTO `access_role_authority` VALUES (484, 'root', 'roleManage', 'insert');
INSERT INTO `access_role_authority` VALUES (485, 'root', 'roleManage', 'update');
INSERT INTO `access_role_authority` VALUES (486, 'root', 'roleManage', 'delete');
INSERT INTO `access_role_authority` VALUES (487, 'root', 'roleManage', 'query');
INSERT INTO `access_role_authority` VALUES (488, 'root', 'roleManage', 'grantAuthority');
INSERT INTO `access_role_authority` VALUES (489, 'root', 'userManage', 'insert');
INSERT INTO `access_role_authority` VALUES (490, 'root', 'userManage', 'update');
INSERT INTO `access_role_authority` VALUES (491, 'root', 'userManage', 'delete');
INSERT INTO `access_role_authority` VALUES (492, 'root', 'userManage', 'query');
INSERT INTO `access_role_authority` VALUES (493, 'root', 'userManage', 'resetPassword');
INSERT INTO `access_role_authority` VALUES (494, 'root', 'userManage', 'grantRole');
INSERT INTO `access_role_authority` VALUES (495, 'root', 'datasourceManage', 'insert');
INSERT INTO `access_role_authority` VALUES (496, 'root', 'datasourceManage', 'update');
INSERT INTO `access_role_authority` VALUES (497, 'root', 'datasourceManage', 'delete');
INSERT INTO `access_role_authority` VALUES (498, 'root', 'datasourceManage', 'query');
INSERT INTO `access_role_authority` VALUES (499, 'root', 'resultsetManage', 'insert');
INSERT INTO `access_role_authority` VALUES (500, 'root', 'resultsetManage', 'update');
INSERT INTO `access_role_authority` VALUES (501, 'root', 'resultsetManage', 'delete');
INSERT INTO `access_role_authority` VALUES (502, 'root', 'resultsetManage', 'query');
INSERT INTO `access_role_authority` VALUES (503, 'root', 'reportManage', 'insert');
INSERT INTO `access_role_authority` VALUES (504, 'root', 'reportManage', 'update');
INSERT INTO `access_role_authority` VALUES (505, 'root', 'reportManage', 'delete');
INSERT INTO `access_role_authority` VALUES (506, 'root', 'reportManage', 'query');
INSERT INTO `access_role_authority` VALUES (507, 'root', 'bigScreenManage', 'share');
INSERT INTO `access_role_authority` VALUES (508, 'root', 'bigScreenManage', 'view');
INSERT INTO `access_role_authority` VALUES (509, 'root', 'bigScreenManage', 'design');
SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
-- Table structure for `access_user`
-- ----------------------------
DROP TABLE IF EXISTS `access_user`;
CREATE TABLE `access_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`login_name` varchar(64) COLLATE utf8_bin NOT NULL COMMENT ' 登录名',
`real_name` varchar(64) COLLATE utf8_bin NOT NULL COMMENT '真实用户',
`password` varchar(128) COLLATE utf8_bin NOT NULL COMMENT '密码',
`phone` varchar(16) COLLATE utf8_bin DEFAULT NULL COMMENT '手机号码',
`email` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '用户邮箱',
`remark` varchar(512) COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
`last_login_time` datetime DEFAULT NULL COMMENT '最后一次登陆时间',
`last_login_ip` varchar(16) COLLATE utf8_bin DEFAULT NULL COMMENT '最后一次登录IP',
`enable_flag` int(1) NOT NULL DEFAULT '1' COMMENT '0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG',
`delete_flag` int(1) NOT NULL DEFAULT '0' COMMENT ' 0--未删除 1--已删除 DIC_NAME=DEL_FLAG',
`create_by` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `IDX1` (`login_name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=308 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='运营用户表';
-- ----------------------------
-- Records of `access_user`
-- ----------------------------
BEGIN;
INSERT INTO `access_user` VALUES ('1', 'admin', '管理员', 'afbc19467fbff0690b5eba5209d0e966', '18019216253', 'admin1@admin.com', null, '2018-08-20 22:04:02', '172.30.16.129', '1', '0', 'admin', '2019-07-23 16:00:38', 'admin', '2019-07-23 16:00:38', '1'), ('2', 'guest', '访客', '5632ad5d163ccaf1ecc305315a1a8e16', '18019214578', 'admin1@admin.com', null, '2018-08-20 22:04:02', '172.30.16.129', '1', '0', 'guest', '2019-07-23 16:00:38', 'admin', '2019-07-23 16:00:38', '1');
COMMIT;
-- ----------------------------
-- Table structure for `access_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `access_user_role`;
CREATE TABLE `access_user_role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`login_name` varchar(32) COLLATE utf8_bin NOT NULL COMMENT '权限目标',
`role_code` varchar(32) COLLATE utf8_bin NOT NULL COMMENT '角色名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='运营角色权限表';
-- ----------------------------
-- Records of `access_user_role`
-- ----------------------------
BEGIN;
INSERT INTO `access_user_role` VALUES ('13', 'guest', 'viewer'), ('14', 'admin', 'root'), ('15', 'admin', 'designer'), ('16', 'admin', 'viewer');
COMMIT;
DROP TABLE IF EXISTS `gaea_user`; | the_stack |
--####################################################################
--script to create PostgreSql version of the Northwind test DB
--####################################################################
DROP DATABASE IF EXISTS "Northwind";
CREATE DATABASE "Northwind" WITH OWNER = "LinqUser";
\connect "Northwind";
CREATE TABLE "Region" (
"RegionID" SERIAL NOT NULL,
"RegionDescription" VARCHAR(50) NOT NULL,
PRIMARY KEY("RegionID")
);
CREATE TABLE "Territories" (
"TerritoryID" VARCHAR(20) NOT NULL,
"TerritoryDescription" VARCHAR(50) NOT NULL,
"RegionID" INTEGER NOT NULL,
PRIMARY KEY("TerritoryID"),
CONSTRAINT "FK_Terr_Region" FOREIGN KEY ("RegionID") REFERENCES "Region"("RegionID")
);
--####################################################################
CREATE TABLE "Categories" (
"CategoryID" SERIAL NOT NULL,
"CategoryName" VARCHAR(15) NOT NULL,
"Description" TEXT NULL,
"Picture" BYTEA,
PRIMARY KEY("CategoryID")
);
CREATE TABLE "Suppliers" (
"SupplierID" SERIAL NOT NULL,
"CompanyName" VARCHAR(40) NOT NULL DEFAULT '',
"ContactName" VARCHAR(30) NULL,
"ContactTitle" VARCHAR(30) NULL,
"Address" VARCHAR(60) NULL,
"City" VARCHAR(15) NULL,
"Region" VARCHAR(15) NULL,
"PostalCode" VARCHAR(10) NULL,
"Country" VARCHAR(15) NULL,
"Phone" VARCHAR(24) NULL,
"Fax" VARCHAR(24) NULL,
PRIMARY KEY("SupplierID")
);
--####################################################################
CREATE TABLE "Products" (
"ProductID" SERIAL NOT NULL,
"ProductName" VARCHAR(40) NOT NULL DEFAULT '',
"SupplierID" INTEGER NULL,
"CategoryID" INTEGER NULL,
"QuantityPerUnit" VARCHAR(20) NULL,
"UnitPrice" DECIMAL NULL,
"UnitsInStock" SMALLINT NULL,
"UnitsOnOrder" SMALLINT NULL,
"ReorderLevel" SMALLINT NULL,
"Discontinued" BOOL NOT NULL,
PRIMARY KEY("ProductID"),
CONSTRAINT "FK_prod_catg" FOREIGN KEY ("CategoryID") REFERENCES "Categories"("CategoryID"),
CONSTRAINT "FK_prod_supp" FOREIGN KEY ("SupplierID") REFERENCES "Suppliers"("SupplierID")
);
CREATE TABLE "Customers" (
"CustomerID" VARCHAR(5) NOT NULL,
"CompanyName" VARCHAR(40) NOT NULL,
"ContactName" VARCHAR(30) NOT NULL ,
"ContactTitle" VARCHAR(30) NULL,
"Address" VARCHAR(60) NULL,
"City" VARCHAR(15) NULL,
"Region" VARCHAR(15) NULL,
"PostalCode" VARCHAR(10) NULL,
"Country" VARCHAR(15) NULL,
"Phone" VARCHAR(24) NULL,
"Fax" VARCHAR(24) NULL,
PRIMARY KEY("CustomerID")
);
--####################################################################
CREATE TABLE "Shippers" (
"ShipperID" SERIAL NOT NULL,
"CompanyName" VARCHAR(40) NOT NULL,
"Phone" VARCHAR(24) NULL,
PRIMARY KEY("ShipperID")
);
--####################################################################
CREATE TABLE "Employees" (
"EmployeeID" SERIAL NOT NULL,
"LastName" VARCHAR(20) NOT NULL,
"FirstName" VARCHAR(10) NOT NULL,
"Title" VARCHAR(30) NULL,
"BirthDate" DATE NULL,
"HireDate" TIMESTAMP NULL,
"Address" VARCHAR(60) NULL,
"City" VARCHAR(15) NULL,
"Region" VARCHAR(15) NULL,
"PostalCode" VARCHAR(10) NULL,
"Country" VARCHAR(15) NULL,
"HomePhone" VARCHAR(24) NULL,
"Photo" BYTEA,
"Notes" TEXT NULL,
"TitleOfCourtesy" VARCHAR(25) NULL,
"PhotoPath" VARCHAR (255) NULL,
"Extension" VARCHAR(5) NULL,
"ReportsTo" INTEGER NULL,
CONSTRAINT "FK_Emp_ReportsToEmp" FOREIGN KEY ("ReportsTo") REFERENCES "Employees"("EmployeeID"),
PRIMARY KEY("EmployeeID")
);
--####################################################################
CREATE TABLE "EmployeeTerritories" (
"EmployeeID" INTEGER NOT NULL REFERENCES "Employees"("EmployeeID"),
"TerritoryID" VARCHAR(20) NOT NULL REFERENCES "Territories"("TerritoryID"),
PRIMARY KEY("EmployeeID","TerritoryID")
);
CREATE TABLE "Orders" (
"OrderID" SERIAL NOT NULL,
"CustomerID" VARCHAR(5) NOT NULL,
"EmployeeID" INTEGER NULL,
"OrderDate" TIMESTAMP NULL,
"RequiredDate" TIMESTAMP NULL,
"ShippedDate" TIMESTAMP NULL,
"ShipVia" INT NULL,
"Freight" DECIMAL NULL,
"ShipName" VARCHAR(40) NULL,
"ShipAddress" VARCHAR(60) NULL,
"ShipCity" VARCHAR(15) NULL,
"ShipRegion" VARCHAR(15) NULL,
"ShipPostalCode" VARCHAR(10) NULL,
"ShipCountry" VARCHAR(15) NULL,
PRIMARY KEY("OrderID"),
CONSTRAINT fk_order_customer FOREIGN KEY ("CustomerID") REFERENCES "Customers"("CustomerID"),
CONSTRAINT fk_order_product FOREIGN KEY ("EmployeeID") REFERENCES "Employees"("EmployeeID")
);
CREATE TABLE "OrderDetails" (
"OrderID" INT NOT NULL REFERENCES "Orders"("OrderID"),
"ProductID" INT NOT NULL REFERENCES "Products"("ProductID"),
"UnitPrice" decimal,
"Quantity" INT,
"Discount" float,
PRIMARY KEY ("OrderID","ProductID")
);
--####################################################################
--## make sure permissions are set
--####################################################################
grant all on "Categories" to "LinqUser";
grant all on "Customers" to "LinqUser";
grant all on "Employees" to "LinqUser";
grant all on "EmployeeTerritories" to "LinqUser";
grant all on "OrderDetails" to "LinqUser";
grant all on "Orders" to "LinqUser";
grant all on "Products" to "LinqUser";
grant all on "Region" to "LinqUser";
grant all on "Shippers" to "LinqUser";
grant all on "Suppliers" to "LinqUser";
grant all on "Territories" to "LinqUser";
--sequences
grant all on "Products_ProductID_seq" to "LinqUser";
--####################################################################
--## populate tables with seed data
--####################################################################
truncate table "Categories" CASCADE;
Insert INTO "Categories" ("CategoryName","Description")
values ('Beverages', 'Soft drinks, coffees, teas, beers, and ales');
Insert INTO "Categories" ("CategoryName","Description")
values ('Condiments','Sweet and savory sauces, relishes, spreads, and seasonings');
Insert INTO "Categories" ("CategoryName","Description")
values ('Seafood','Seaweed and fish');
INSERT INTO "Region" ("RegionDescription") VALUES ('North America');
INSERT INTO "Region" ("RegionDescription") VALUES ('Europe');
INSERT INTO "Territories" ("TerritoryID","TerritoryDescription", "RegionID") VALUES ('US.Northwest', 'Northwest', 1);
insert INTO "Customers" ("CustomerID", "CompanyName","ContactName","Country","PostalCode","City")
values ('AIRBU', 'airbus','jacques','France','10000','Paris');
insert INTO "Customers" ("CustomerID", "CompanyName","ContactName","Country","PostalCode","City")
values ('BT___','BT','graeme','U.K.','E14','London');
insert INTO "Customers" ("CustomerID", "CompanyName","ContactName","Country","PostalCode","City")
values ('ATT__','ATT','bob','USA','10021','New York');
insert INTO "Customers" ("CustomerID", "CompanyName","ContactName","Country","PostalCode","City")
values ('UKMOD', 'MOD','(secret)','U.K.','E14','London');
insert INTO "Customers" ("CustomerID", "CompanyName","ContactName", "ContactTitle", "Country","PostalCode","City", "Phone")
values ('ALFKI', 'Alfreds Futterkiste','Maria Anders','Sales Representative','Germany','12209','Berlin','030-0074321');
insert INTO "Customers" ("CustomerID", "CompanyName","ContactName", "ContactTitle", "Country","PostalCode","Address","City", "Phone", "Fax")
values ('BONAP', 'Bon app''','Laurence Lebihan','Owner','France','13008','12, rue des Bouchers','Marseille','91.24.45.40', '91.24.45.41');
insert INTO "Customers" ("CustomerID", "CompanyName","ContactName", "ContactTitle", "Country","PostalCode","City", "Phone")
values ('WARTH', 'Wartian Herkku','Pirkko Koskitalo','Accounting Manager','Finland','90110','Oulu','981-443655');
--truncate table Orders; -- must be truncated before Products
truncate table "Products" CASCADE;
insert INTO "Suppliers" ("CompanyName", "ContactName", "ContactTitle", "Address", "City", "Region", "Country")
VALUES ('alles AG', 'Harald Reitmeyer', 'Prof', 'Fischergasse 8', 'Heidelberg', 'B-W', 'Germany');
insert INTO "Suppliers" ("CompanyName", "ContactName", "ContactTitle", "Address", "City", "Region", "Country")
VALUES ('Microsoft', 'Mr Allen', 'Monopolist', '1 MS', 'Redmond', 'WA', 'USA');
INSERT INTO "Suppliers" ("CompanyName", "ContactName", "ContactTitle", "Address", "City", "Region", "PostalCode", "Country", "Phone", "Fax")
VALUES ('Pavlova, Ltd.', 'Ian Devling', 'Marketing Manager', '74 Rose St. Moonie Ponds', 'Melbourne', 'Victoria', '3058', 'Australia', '(03) 444-2343', '(03) 444-6588');
--#################################################################################
insert INTO "Products" ("ProductName","SupplierID", "QuantityPerUnit","UnitsInStock","UnitsOnOrder","Discontinued")
VALUES ('Pen',1, 10, 12, 2, '0');
insert INTO "Products" ("ProductName","SupplierID", "QuantityPerUnit","UnitsInStock","UnitsOnOrder","Discontinued")
VALUES ('Bicycle',1, 1, 6, 0, '0');
insert INTO "Products" ("ProductName","QuantityPerUnit","UnitsInStock","UnitsOnOrder","Discontinued")
VALUES ('Phone',3, 7, 0, '0');
insert INTO "Products" ("ProductName","QuantityPerUnit","UnitsInStock","UnitsOnOrder","Discontinued")
VALUES ('SAM',1, 51, 11, '0');
insert INTO "Products" ("ProductName","QuantityPerUnit","UnitsInStock","UnitsOnOrder","Discontinued")
VALUES ('iPod',0, 11, 0, '0');
insert INTO "Products" ("ProductName","QuantityPerUnit","UnitsInStock","UnitsOnOrder","Discontinued")
VALUES ('Toilet Paper',2, 0, 3, '1');
insert INTO "Products" ("ProductName","QuantityPerUnit","UnitsInStock","UnitsOnOrder","Discontinued")
VALUES ('Fork',5, 111, 0, '0');
insert INTO "Products" ("ProductName","SupplierID", "QuantityPerUnit","UnitsInStock","UnitsOnOrder","Discontinued")
VALUES ('Linq Book',2, 1, 0, 26, '0');
INSERT INTO "Products" ("ProductName","SupplierID", "QuantityPerUnit","UnitPrice", "UnitsInStock","UnitsOnOrder","Discontinued")
VALUES ('Carnarvon Tigers', 3,'16 kg pkg.',62.50, 42, 0, false);
insert INTO "Employees" ("LastName","FirstName","Title","BirthDate","HireDate","Address","City","ReportsTo","Country","HomePhone")
VALUES ('Fuller','Andrew','Vice President, Sales','19540101','19890101', '908 W. Capital Way','Tacoma',NULL,'USA','(111)222333');
insert INTO "Employees" ("LastName","FirstName","Title","BirthDate","HireDate","Address","City","ReportsTo","Country","HomePhone")
VALUES ('Davolio','Nancy','Sales Representative','19640101','19940101','507 - 20th Ave. E. Apt. 2A','Seattle',1,'USA','(444)555666');
insert INTO "Employees" ("LastName","FirstName","Title","BirthDate","HireDate","Address","City","ReportsTo","Country","HomePhone")
VALUES ('Builder','Bob','Handyman','19640101','19940101','666 dark street','Seattle',2,'USA','(777)888999');
insert into "EmployeeTerritories" ("EmployeeID","TerritoryID")
values (2,'US.Northwest');
--####################################################################
truncate table "Orders" CASCADE;
insert INTO "Orders" ("CustomerID", "EmployeeID", "OrderDate", "Freight")
Values ('AIRBU', 1, now(), 21.3);
insert INTO "Orders" ("CustomerID", "EmployeeID", "OrderDate", "Freight")
Values ('BT___', 1, now(), 11.1);
insert INTO "Orders" ("CustomerID", "EmployeeID", "OrderDate", "Freight")
Values ('BT___', 1, now(), 11.5);
insert INTO "Orders" ("CustomerID", "EmployeeID", "OrderDate", "Freight")
Values ('UKMOD', 1, now(), 32.5);
insert INTO "Orders" ("CustomerID", "EmployeeID", "OrderDate", "RequiredDate", "ShippedDate", "Freight", "ShipName", "ShipAddress",
"ShipCity", "ShipCountry")
Values ('BONAP', 1, '1996-10-16', '1996-11-27', '1996-10-21', 10.21, 'Bon app''', '12, rue des Bouchers', 'Marseille', 'France' );
INSERT INTO "OrderDetails" ("OrderID", "ProductID", "UnitPrice", "Quantity", "Discount")
VALUES (1,2, 33, 5, 11);
INSERT INTO "OrderDetails" ("OrderID", "ProductID", "UnitPrice", "Quantity", "Discount")
VALUES (5,9, 50, 20, 0.05); --## CanarvonTigers
CREATE FUNCTION hello0() RETURNS text AS $$
BEGIN RETURN 'hello0'; END;
$$ LANGUAGE plpgsql;
-- contatenates strings. test case: select hello2('aa','bb')
CREATE OR REPLACE FUNCTION hello1(name text) RETURNS text AS $$
BEGIN RETURN 'hello,' || name || '!'; END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION hello2(name text, unused text) RETURNS text AS $$
BEGIN RETURN 'hello,' || name || '!'; SELECT * FROM customer; END;
$$ LANGUAGE plpgsql;
-- count orders for given CustomerID. test case: select getOrderCount(1)
CREATE OR REPLACE FUNCTION "getOrderCount"("custId" VARCHAR) RETURNS INT AS $$
DECLARE
count1 INTEGER;
BEGIN
SELECT COUNT(*) INTO count1 FROM "Orders" WHERE "CustomerID"="custId";
RETURN count1;
END;
$$ LANGUAGE plpgsql;
COMMIT; | the_stack |
-- 2018-09-26T14:14:57.077
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsCalculated='Y',Updated=TO_TIMESTAMP('2018-09-26 14:14:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=563207
;
-- 2018-09-26T14:15:27.597
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsDLMPartitionBoundary,IsEncrypted,IsForceIncludeInGeneratedModel,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsRangeFilter,IsSelectionColumn,IsShowFilterIncrementButtons,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SelectionColumnSeqNo,SeqNo,Updated,UpdatedBy,Version) VALUES (0,563219,540009,0,10,259,'ContractStatus',TO_TIMESTAMP('2018-09-26 14:15:27','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.contracts',255,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','Vertrags-Status',0,0,TO_TIMESTAMP('2018-09-26 14:15:27','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 2018-09-26T14:15:27.601
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=563219 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2018-09-26T14:16:44.831
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540918,TO_TIMESTAMP('2018-09-26 14:16:44','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','N','ContractStatus',TO_TIMESTAMP('2018-09-26 14:16:44','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2018-09-26T14:16:44.842
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540918 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2018-09-26T14:17:55.291
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541733,540918,TO_TIMESTAMP('2018-09-26 14:17:55','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','Gekündigt',TO_TIMESTAMP('2018-09-26 14:17:55','YYYY-MM-DD HH24:MI:SS'),100,'C','Cancelled')
;
-- 2018-09-26T14:17:55.305
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541733 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2018-09-26T14:18:00.914
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-09-26 14:18:00','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Ref_List_ID=541733 AND AD_Language='de_CH'
;
-- 2018-09-26T14:18:03.355
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-09-26 14:18:03','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Ref_List_ID=541733 AND AD_Language='nl_NL'
;
-- 2018-09-26T14:18:09.262
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-09-26 14:18:09','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Cancelled' WHERE AD_Ref_List_ID=541733 AND AD_Language='en_US'
;
-- 2018-09-26T14:18:36.398
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541734,540918,TO_TIMESTAMP('2018-09-26 14:18:36','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','Aktiv',TO_TIMESTAMP('2018-09-26 14:18:36','YYYY-MM-DD HH24:MI:SS'),100,'A','Active')
;
-- 2018-09-26T14:18:36.401
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541734 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2018-09-26T14:18:42.412
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-09-26 14:18:42','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Active' WHERE AD_Ref_List_ID=541734 AND AD_Language='en_US'
;
-- 2018-09-26T14:18:45.267
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-09-26 14:18:45','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Ref_List_ID=541734 AND AD_Language='nl_NL'
;
-- 2018-09-26T14:18:46.870
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-09-26 14:18:46','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Ref_List_ID=541734 AND AD_Language='de_CH'
;
-- 2018-09-26T14:19:16.431
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541735,540918,TO_TIMESTAMP('2018-09-26 14:19:16','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','Verlängert',TO_TIMESTAMP('2018-09-26 14:19:16','YYYY-MM-DD HH24:MI:SS'),100,'E','Extended')
;
-- 2018-09-26T14:19:16.436
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541735 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2018-09-26T14:19:21.446
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-09-26 14:19:21','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Ref_List_ID=541735 AND AD_Language='de_CH'
;
-- 2018-09-26T14:19:23.108
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-09-26 14:19:23','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Ref_List_ID=541735 AND AD_Language='nl_NL'
;
-- 2018-09-26T14:19:26.208
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-09-26 14:19:26','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Extended' WHERE AD_Ref_List_ID=541735 AND AD_Language='en_US'
;
-- 2018-09-26T14:20:08.795
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540918, IsCalculated='Y',Updated=TO_TIMESTAMP('2018-09-26 14:20:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=563219
;
-- 2018-09-27T18:29:06.843
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET DefaultValue='A',Updated=TO_TIMESTAMP('2018-09-27 18:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=563219
;
-- 2018-09-27T18:29:12.492
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('C_Order','ALTER TABLE public.C_Order ADD COLUMN ContractStatus VARCHAR(255) DEFAULT ''A''')
;
-- 2018-09-27T18:29:41.833
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,563219,569151,0,186,TO_TIMESTAMP('2018-09-27 18:29:41','YYYY-MM-DD HH24:MI:SS'),100,255,'de.metas.contracts','Y','N','N','N','N','N','N','N','Vertrags-Status',TO_TIMESTAMP('2018-09-27 18:29:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-09-27T18:29:41.837
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=569151 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2018-09-27T18:30:23.015
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,569151,0,186,553868,540499,'F',TO_TIMESTAMP('2018-09-27 18:30:22','YYYY-MM-DD HH24:MI:SS'),100,'Y','Y','N','Y','N','N','N',0,'Vertrags-Status',410,0,0,TO_TIMESTAMP('2018-09-27 18:30:22','YYYY-MM-DD HH24:MI:SS'),100)
; | the_stack |
-- 2018-09-12T16:13:30.399
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,544254,0,'Additional_produktinfos',TO_TIMESTAMP('2018-09-12 16:13:29','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Obligatorische Zusatzangaben','Obligatorische Zusatzangaben',TO_TIMESTAMP('2018-09-12 16:13:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-09-12T16:13:30.423
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=544254 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2018-09-12T16:13:34.550
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y' WHERE AD_Element_ID=544254 AND AD_Language='de_CH'
;
-- 2018-09-12T16:13:34.638
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(544254,'de_CH')
;
-- 2018-09-12T16:13:36.971
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y' WHERE AD_Element_ID=544254 AND AD_Language='nl_NL'
;
-- 2018-09-12T16:13:36.979
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(544254,'nl_NL')
;
-- 2018-09-12T16:14:17.150
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Name='Additional Produktinfos',PrintName='Additional Produktinfos' WHERE AD_Element_ID=544254 AND AD_Language='en_US'
;
-- 2018-09-12T16:14:17.159
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(544254,'en_US')
;
-- 2018-09-12T16:14:38.520
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,544255,0,'Warehouse_temperature',TO_TIMESTAMP('2018-09-12 16:14:38','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Lager- und Transporttemperatur','Lager- und Transporttemperatur',TO_TIMESTAMP('2018-09-12 16:14:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-09-12T16:14:38.526
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=544255 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2018-09-12T16:14:41.587
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y' WHERE AD_Element_ID=544255 AND AD_Language='en_US'
;
-- 2018-09-12T16:14:41.601
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(544255,'en_US')
;
-- 2018-09-12T16:14:44.382
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y' WHERE AD_Element_ID=544255 AND AD_Language='nl_NL'
;
-- 2018-09-12T16:14:44.389
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(544255,'nl_NL')
;
-- 2018-09-12T16:14:46.347
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y' WHERE AD_Element_ID=544255 AND AD_Language='de_CH'
;
-- 2018-09-12T16:14:46.364
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(544255,'de_CH')
;
-- 2018-09-12T16:14:57.395
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Warehouse Temperature',PrintName='Warehouse Temperature' WHERE AD_Element_ID=544255 AND AD_Language='en_US'
;
-- 2018-09-12T16:14:57.412
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(544255,'en_US')
;
-- 2018-09-12T16:15:17.756
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsDLMPartitionBoundary,IsEncrypted,IsForceIncludeInGeneratedModel,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsRangeFilter,IsSelectionColumn,IsShowFilterIncrementButtons,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SelectionColumnSeqNo,SeqNo,Updated,UpdatedBy,Version) VALUES (0,561005,544254,0,14,208,'Additional_produktinfos',TO_TIMESTAMP('2018-09-12 16:15:17','YYYY-MM-DD HH24:MI:SS'),100,'N','D',2000,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','Obligatorische Zusatzangaben',0,0,TO_TIMESTAMP('2018-09-12 16:15:17','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 2018-09-12T16:15:17.772
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=561005 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2018-09-12T16:15:20.742
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('M_Product','ALTER TABLE public.M_Product ADD COLUMN Additional_produktinfos VARCHAR(2000)')
;
-- 2018-09-12T16:18:02.961
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsDLMPartitionBoundary,IsEncrypted,IsForceIncludeInGeneratedModel,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsRangeFilter,IsSelectionColumn,IsShowFilterIncrementButtons,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SelectionColumnSeqNo,SeqNo,Updated,UpdatedBy,Version) VALUES (0,561006,544255,0,10,208,'Warehouse_temperature',TO_TIMESTAMP('2018-09-12 16:18:02','YYYY-MM-DD HH24:MI:SS'),100,'N','D',20,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','Lager- und Transporttemperatur',0,0,TO_TIMESTAMP('2018-09-12 16:18:02','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 2018-09-12T16:18:02.968
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=561006 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2018-09-12T16:18:06.218
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('M_Product','ALTER TABLE public.M_Product ADD COLUMN Warehouse_temperature VARCHAR(20)')
;
-- 2018-09-12T17:07:14.153
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,561006,568971,0,180,0,TO_TIMESTAMP('2018-09-12 17:07:13','YYYY-MM-DD HH24:MI:SS'),100,0,'D',0,'Y','Y','Y','N','N','N','N','N','Lager- und Transporttemperatur',410,420,0,1,1,TO_TIMESTAMP('2018-09-12 17:07:13','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-09-12T17:07:14.222
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=568971 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2018-09-12T17:07:47.099
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,561005,568972,0,180,0,TO_TIMESTAMP('2018-09-12 17:07:46','YYYY-MM-DD HH24:MI:SS'),100,0,'D',0,'Y','Y','Y','N','N','N','N','N','Obligatorische Zusatzangaben',420,430,0,1,1,TO_TIMESTAMP('2018-09-12 17:07:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-09-12T17:07:47.104
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=568972 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2018-09-12T17:08:21.611
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,568971,0,180,553799,1000040,'F',TO_TIMESTAMP('2018-09-12 17:08:21','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Lager- und Transporttemperatur',160,0,0,TO_TIMESTAMP('2018-09-12 17:08:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-09-12T17:08:32.634
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,568972,0,180,553800,1000040,'F',TO_TIMESTAMP('2018-09-12 17:08:32','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Obligatorische Zusatzangaben',170,0,0,TO_TIMESTAMP('2018-09-12 17:08:32','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-09-12T18:02:54.599
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2018-09-12 18:02:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=553800
;
-- 2018-09-12T18:02:56.496
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2018-09-12 18:02:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=553799
; | the_stack |
-- 2020-03-16T13:18:36.124Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='SELECT * FROM ProfitAndLossReport(''@DateFrom/1993-01-01@''::Timestamp, ''@DateTo/2992-01-01@''::Timestamp, @AD_Org_ID@::numeric, ''@ExcludeEmptyLines@'');',Updated=TO_TIMESTAMP('2020-03-16 15:18:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584650
;
-- 2020-03-16T13:18:52.721Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET SeqNo=40,Updated=TO_TIMESTAMP('2020-03-16 15:18:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541745
;
-- 2020-03-16T13:19:30.472Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,IsActive,Created,CreatedBy,AD_Process_ID,AD_Reference_ID,IsRange,AD_Process_Para_ID,FieldLength,AD_Org_ID,IsCentrallyMaintained,IsEncrypted,Updated,UpdatedBy,ColumnName,IsMandatory,IsAutocomplete,SeqNo,Help,Description,Name,EntityType,AD_Element_ID) VALUES (0,'Y',TO_TIMESTAMP('2020-03-16 15:19:30','YYYY-MM-DD HH24:MI:SS'),100,584650,30,'N',541759,0,0,'Y','N',TO_TIMESTAMP('2020-03-16 15:19:30','YYYY-MM-DD HH24:MI:SS'),100,'AD_Org_ID','Y','N',30,'Eine Organisation ist ein Bereich ihres Mandanten - z.B. Laden oder Abteilung. Sie können Daten über Organisationen hinweg gemeinsam verwenden.','Organisatorische Einheit des Mandanten','Sektion','U',113)
;
-- 2020-03-16T13:19:30.475Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541759 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2020-03-16T13:19:33.937Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET EntityType='D',Updated=TO_TIMESTAMP('2020-03-16 15:19:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541759
;
-- 2020-03-16T13:19:46.967Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2020-03-16 15:19:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541745
;
-- 2020-03-16T13:19:47.904Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2020-03-16 15:19:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541704
;
-- 2020-03-16T13:20:00.119Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='N',Updated=TO_TIMESTAMP('2020-03-16 15:20:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541704
;
-- 2020-03-16T13:20:10.552Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='N',Updated=TO_TIMESTAMP('2020-03-16 15:20:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541745
;
DROP FUNCTION IF EXISTS ProfitAndLossBalanceForAccountInPeriod(IN p_C_ElementValue_ID numeric, IN p_startDate timestamp, IN p_endDate timestamp)
;
DROP FUNCTION IF EXISTS ProfitAndLossBalanceForAccountInPeriod(IN p_C_ElementValue_ID numeric, IN p_startDate timestamp, IN p_endDate timestamp, IN p_AD_Org_Id numeric)
;
/**
fact_acct_summary's amtacctdr and amtacctcr are always increasing, and exactly 1 per day per organisation per posting type.
Therefore calculating the balance for the winter sales period: 2019-12-20 -> 2020-02-01 is done by subtracting endDate_balance - the_balance_before_startDate as follows:
(2020-02-01.debit - 2020-02-01.credit) - (2019-12-19.debit - 2019-12-19.credit)
*/
CREATE OR REPLACE FUNCTION ProfitAndLossBalanceForAccountInPeriod(IN p_C_ElementValue_ID numeric,
IN p_startDate timestamp,
IN p_endDate timestamp,
IN p_AD_Org_Id numeric)
RETURNS NUMERIC
AS
$BODY$
WITH factAcctSummaryNoPeriod AS
(
SELECT --
fas.amtacctdr,
fas.amtacctcr,
fas.dateacct
FROM c_elementvalue ev
INNER JOIN fact_acct_summary fas ON fas.account_id = ev.c_elementvalue_id
WHERE TRUE
AND ev.c_elementvalue_id = p_C_ElementValue_ID
AND ev.accounttype IN ('E', 'R')
AND fas.ad_org_id = p_AD_Org_ID
-- only 'Actual' posting type is used
AND fas.postingtype = 'A'
),
factAcctSummaryInPeriod AS
(
SELECT --
fas.amtacctdr,
fas.amtacctcr,
fas.dateacct
FROM factAcctSummaryNoPeriod fas
WHERE TRUE
AND fas.dateacct >= p_startDate
AND fas.dateacct <= p_endDate
),
balanceUpToStartDay AS
(
SELECT fas.amtacctdr - fas.amtacctcr balance
FROM factAcctSummaryNoPeriod fas
WHERE TRUE
AND fas.dateacct = (SELECT max(fas.dateacct)
FROM factAcctSummaryNoPeriod fas
WHERE fas.dateacct < p_startDate)
UNION ALL
(
SELECT 0
)
LIMIT 1
),
balanceUpToEndDate AS
(
SELECT fas.amtacctdr - fas.amtacctcr balance
FROM factAcctSummaryInPeriod fas
WHERE fas.dateacct = (SELECT max(fas2.dateacct) FROM factAcctSummaryInPeriod fas2)
)
SELECT maxBal.balance - minBal.balance
FROM balanceUpToStartDay minBal,
balanceUpToEndDate maxBal
/**
Why is this union needed?
In case no `fact_acct_summary` for an account_id exists, `result_table` returns no rows. It doesn't return null (so that i can use coalesce), but returns NO rows.
example: SELECT ProfitAndLossBalanceForAccountInPeriod(1, '1993-01-01'::Timestamp, '2992-01-01'::Timestamp, 1000000); -- this returns NO rows
I have simply added this union in case the select returns nothing. If you have a better solution, i'm more than happy to hear it, as this feels like a hack.
*/
UNION ALL
(
SELECT 0
)
LIMIT 1
;
$BODY$
LANGUAGE SQL
STABLE
;
ALTER FUNCTION ProfitAndLossBalanceForAccountInPeriod(numeric, timestamp, timestamp, numeric)
OWNER TO metasfresh
;
DROP FUNCTION IF EXISTS ProfitAndLossReport(IN p_startDate timestamp, IN p_endDate timestamp, IN p_compareWithPrevious1Year boolean, IN p_compareWithPrevious3Years boolean)
;
DROP FUNCTION IF EXISTS ProfitAndLossReport(IN p_startDate timestamp, IN p_endDate timestamp)
;
DROP FUNCTION IF EXISTS ProfitAndLossReport(IN p_startDate timestamp, IN p_endDate timestamp, p_ExcludeEmptyLines text)
;
DROP FUNCTION IF EXISTS ProfitAndLossReport(IN p_startDate timestamp, IN p_endDate timestamp, IN p_AD_Org_ID numeric, IN p_ExcludeEmptyLines text)
;
CREATE OR REPLACE FUNCTION ProfitAndLossReport(IN p_startDate timestamp,
IN p_endDate timestamp,
IN p_AD_Org_ID numeric,
IN p_ExcludeEmptyLines text = 'Y')
RETURNS TABLE
(
AccountValue text,
AccountName text,
balance_three_years_ago numeric,
balance_two_years_ago numeric,
balance_one_year_ago numeric,
balance numeric
)
AS
$BODY$
WITH data AS
(
SELECT--
ev.value AccountValue,
ev.name AccountName,
ProfitAndLossBalanceForAccountInPeriod(ev.c_elementvalue_id, p_startDate - '3 Year'::interval, p_endDate - '3 Year'::interval, p_AD_Org_ID) balance_three_years_ago,
ProfitAndLossBalanceForAccountInPeriod(ev.c_elementvalue_id, p_startDate - '2 Year'::interval, p_endDate - '2 Year'::interval, p_AD_Org_ID) balance_two_years_ago,
ProfitAndLossBalanceForAccountInPeriod(ev.c_elementvalue_id, p_startDate - '1 Year'::interval, p_endDate - '1 Year'::interval, p_AD_Org_ID) balance_one_year_ago,
ProfitAndLossBalanceForAccountInPeriod(ev.c_elementvalue_id, p_startDate, p_endDate, p_AD_Org_ID) current_balance
FROM c_elementvalue ev
WHERE TRUE
AND ev.accounttype IN ('E', 'R')
AND ev.IsSummary = 'N'
),
dataExcludingEmptyLines AS
(
SELECT --
AccountValue,
AccountName,
balance_three_years_ago,
balance_two_years_ago,
balance_one_year_ago,
current_balance
FROM data
WHERE (
p_ExcludeEmptyLines = 'N'
OR (
current_balance != 0
OR balance_one_year_ago != 0
OR balance_two_years_ago != 0
OR balance_three_years_ago != 0
)
)
)
SELECT --
AccountValue,
AccountName,
balance_three_years_ago,
balance_two_years_ago,
balance_one_year_ago,
current_balance
FROM dataExcludingEmptyLines d
ORDER BY d.AccountValue
;
$BODY$
LANGUAGE sql
STABLE
;
-- test: SELECT * FROM ProfitAndLossReport('1993-01-01'::Timestamp, '2992-01-01'::Timestamp, 1000000);
-- test SELECT * FROM ProfitAndLossReport('2018-01-01'::Timestamp, '2018-07-01'::Timestamp, 1000000); | the_stack |
-- --------------------------------------------------------
-- Host: wess
-- Server version: 5.1.73-log - Source distribution
-- Server OS: redhat-linux-gnu
-- HeidiSQL Version: 8.3.0.4694
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for shop
CREATE DATABASE IF NOT EXISTS `shop` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `shop`;
-- Dumping structure for table shop.shop_admin
CREATE TABLE IF NOT EXISTS `shop_admin` (
`admin_id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(16) NOT NULL,
`email` varchar(255) DEFAULT NULL,
`password` varchar(40) NOT NULL,
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`is_del` bit(1) DEFAULT NULL,
PRIMARY KEY (`admin_id`),
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
-- Dumping data for table shop.shop_admin: 5 rows
/*!40000 ALTER TABLE `shop_admin` DISABLE KEYS */;
INSERT INTO `shop_admin` (`admin_id`, `username`, `email`, `password`, `create_time`, `is_del`) VALUES
(1, 'yantze', 'yantze@126.com', 'f7c3bc1d808e04732adf679965ccc34ca7ae3441', '2014-05-19 21:21:54', b'0'),
(7, 'admin', 'yantze@111.com', 'f7c3bc1d808e04732adf679965ccc34ca7ae3441', '2014-05-24 03:21:18', b'1'),
(8, 'yangzhi', '123456789', 'f7c3bc1d808e04732adf679965ccc34ca7ae3441', '2014-05-24 03:30:58', b'0'),
(10, '杨志', '123', '40bd001563085fc35165329ea1ff5c5ecbdbbeef', '2014-05-26 11:10:02', b'0'),
(11, 'demo', 'demo@db.com', '89e495e7941cf9e40e6980d14a16bf023ccd4c91', '2014-05-28 00:50:52', b'0');
/*!40000 ALTER TABLE `shop_admin` ENABLE KEYS */;
-- Dumping structure for table shop.shop_category
CREATE TABLE IF NOT EXISTS `shop_category` (
`category_id` int(11) NOT NULL AUTO_INCREMENT,
`cate_name` varchar(45) NOT NULL,
`parent_id` varchar(45) NOT NULL,
`category_layer` int(6) unsigned zerofill DEFAULT NULL,
PRIMARY KEY (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
-- Dumping data for table shop.shop_category: ~6 rows (approximately)
/*!40000 ALTER TABLE `shop_category` DISABLE KEYS */;
INSERT INTO `shop_category` (`category_id`, `cate_name`, `parent_id`, `category_layer`) VALUES
(1, '休闲零食', '0', 000100),
(2, '坚果炒货', '1', 000101),
(3, '肉干肉脯', '1', 000102),
(4, '开心零食', '0', 000200),
(5, '糖果巧克力', '4', 000201),
(6, '饼干蛋糕', '4', 000202);
/*!40000 ALTER TABLE `shop_category` ENABLE KEYS */;
-- Dumping structure for table shop.shop_fav
CREATE TABLE IF NOT EXISTS `shop_fav` (
`fav_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_uuid` varchar(36) NOT NULL,
`product_uuid` varchar(36) NOT NULL,
`fav_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`comment` varchar(45) DEFAULT NULL,
PRIMARY KEY (`fav_id`),
UNIQUE KEY `fav_id_UNIQUE` (`fav_id`),
KEY `user_uuid_idx` (`user_uuid`),
CONSTRAINT `fk_fav_user_uuid` FOREIGN KEY (`user_uuid`) REFERENCES `shop_user` (`user_uuid`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8;
-- Dumping data for table shop.shop_fav: ~11 rows (approximately)
/*!40000 ALTER TABLE `shop_fav` DISABLE KEYS */;
INSERT INTO `shop_fav` (`fav_id`, `user_uuid`, `product_uuid`, `fav_time`, `comment`) VALUES
(79, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'A85ED768-D9CE-6DEB-913E-B8D84F29F4BA', '2015-02-11 17:16:33', NULL),
(81, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '2714EA2A-49B8-A04C-672B-1E0EEF71E995', '2015-02-11 17:16:35', NULL),
(83, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'F6449A13-AAE2-E61E-C3C7-C1BA2CC24373', '2015-02-11 17:16:38', NULL),
(85, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'A85ED768-D9CE-6DEB-913E-B8D84F29F4BA', '2015-02-11 17:16:40', NULL),
(87, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '2714EA2A-49B8-A04C-672B-1E0EEF71E995', '2015-02-11 17:16:42', NULL),
(89, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'F6449A13-AAE2-E61E-C3C7-C1BA2CC24373', '2015-02-11 17:16:44', NULL),
(91, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'F6449A13-AAE2-E61E-C3C7-C1BA2CC24373', '2015-02-11 17:16:46', NULL),
(93, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'AAD46A77-3A61-E498-7311-38C7103F8A2C', '2015-02-11 17:16:50', NULL),
(95, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '31E2921D-5C2F-482B-3373-BBFDD615BFD9', '2015-02-11 17:16:53', NULL),
(97, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '71CAF7BA-76AE-C4A4-F29D-B31E0C19BC1C', '2015-02-11 17:16:55', NULL),
(99, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '9ADB0846-BD35-25DF-28BC-B65FD1254DDE', '2015-02-11 17:16:58', NULL);
/*!40000 ALTER TABLE `shop_fav` ENABLE KEYS */;
-- Dumping structure for table shop.shop_group_privilege
CREATE TABLE IF NOT EXISTS `shop_group_privilege` (
`privilege_id` int(11) NOT NULL,
`privilege_name` varchar(50) NOT NULL,
`privilege_desc` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='分组权限';
-- Dumping data for table shop.shop_group_privilege: 0 rows
/*!40000 ALTER TABLE `shop_group_privilege` DISABLE KEYS */;
/*!40000 ALTER TABLE `shop_group_privilege` ENABLE KEYS */;
-- Dumping structure for table shop.shop_history
CREATE TABLE IF NOT EXISTS `shop_history` (
`history_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_uuid` varchar(36) NOT NULL,
`product_uuid` varchar(36) NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`history_id`),
UNIQUE KEY `history_id_UNIQUE` (`history_id`),
KEY `user_uuid_idx` (`user_uuid`),
CONSTRAINT `fk_history_user_uuid` FOREIGN KEY (`user_uuid`) REFERENCES `shop_user` (`user_uuid`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table shop.shop_history: ~0 rows (approximately)
/*!40000 ALTER TABLE `shop_history` DISABLE KEYS */;
/*!40000 ALTER TABLE `shop_history` ENABLE KEYS */;
-- Dumping structure for table shop.shop_option
CREATE TABLE IF NOT EXISTS `shop_option` (
`option_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`value` varchar(45) DEFAULT NULL,
PRIMARY KEY (`option_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- Dumping data for table shop.shop_option: ~2 rows (approximately)
/*!40000 ALTER TABLE `shop_option` DISABLE KEYS */;
INSERT INTO `shop_option` (`option_id`, `name`, `value`) VALUES
(1, 'sitename', '零食大王'),
(2, 'sitedesc', '我们的零食很好吃');
/*!40000 ALTER TABLE `shop_option` ENABLE KEYS */;
-- Dumping structure for table shop.shop_order
CREATE TABLE IF NOT EXISTS `shop_order` (
`order_id` int(11) NOT NULL AUTO_INCREMENT,
`user_uuid` varchar(36) NOT NULL,
`product_uuid` varchar(36) NOT NULL,
`reg_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`order_serial` varchar(50) NOT NULL,
`amount` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`order_id`),
KEY `product_uuid_idx` (`product_uuid`),
KEY `user_uuid_idx` (`user_uuid`),
CONSTRAINT `fk_order_product_uuid` FOREIGN KEY (`product_uuid`) REFERENCES `shop_product` (`product_uuid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_order_user_uuid` FOREIGN KEY (`user_uuid`) REFERENCES `shop_user` (`user_uuid`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=178 DEFAULT CHARSET=utf8;
-- Dumping data for table shop.shop_order: ~75 rows (approximately)
/*!40000 ALTER TABLE `shop_order` DISABLE KEYS */;
INSERT INTO `shop_order` (`order_id`, `user_uuid`, `product_uuid`, `reg_time`, `order_serial`, `amount`) VALUES
(49, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '3DB4D533-DB32-2D26-858A-7D0B3184ED34', '2014-06-12 08:02:17', '14025127759820347', 0),
(54, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-12 08:25:27', '14025127759820347', 0),
(55, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-12 11:56:03', '14025453529813332', 0),
(56, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '3DB4D533-DB32-2D26-858A-7D0B3184ED34', '2014-06-12 11:56:20', '14025453529813332', 0),
(57, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-12 11:57:04', '14025453529813332', 0),
(58, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-12 12:12:25', '14025454479846145', 0),
(59, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-13 08:54:50', '14026208849818339', 0),
(60, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-13 08:54:58', '14026208849818339', 0),
(61, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-13 08:55:10', '14026208849818339', 0),
(62, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-18 15:59:06', '14030783419844205', 0),
(63, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-19 11:05:09', '14031459979840931', 0),
(64, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-19 11:06:27', '14031459979840931', 0),
(65, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-19 11:08:04', '14031459979840931', 0),
(66, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '77989D34-084E-F85C-06B1-58BE5B043372', '2014-06-19 11:08:26', '14031459979840931', 0),
(67, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '77989D34-084E-F85C-06B1-58BE5B043372', '2014-06-19 11:08:43', '14031459979840931', 0),
(68, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '017D1BF7-0AD9-6850-C01F-B095E96A5E00', '2014-06-19 11:10:11', '14031459979840931', 0),
(75, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '12163A7E-0C61-6E11-567B-18971683E15C', '2014-06-20 19:47:07', '14032579579882069', 0),
(78, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '3DB4D533-DB32-2D26-858A-7D0B3184ED34', '2014-06-20 22:04:58', '14032652609850583', 0),
(79, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-06-21 09:27:32', '14033140509844562', 0),
(80, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-06-21 09:27:56', '14033140509844562', 0),
(81, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-06-21 09:28:19', '14033140509844562', 0),
(83, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-06-21 09:29:35', '14033141349823358', 0),
(84, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '64CDD23D-FF1B-DB3C-685E-2F473A366E17', '2014-06-21 09:29:41', '14033141349823358', 0),
(86, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-06-21 14:46:42', '14033314509824221', 0),
(87, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'D5E1060E-88FE-0C4C-E849-9CE001F5CF13', '2014-06-21 14:46:45', '14033314509824221', 0),
(89, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'D5E1060E-88FE-0C4C-E849-9CE001F5CF13', '2014-06-21 14:50:14', '14033334139876409', 0),
(90, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'D5E1060E-88FE-0C4C-E849-9CE001F5CF13', '2014-06-21 14:50:35', '14033334139876409', 0),
(92, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'D5E1060E-88FE-0C4C-E849-9CE001F5CF13', '2014-06-22 00:39:54', '14033687819822943', 0),
(96, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'D5E1060E-88FE-0C4C-E849-9CE001F5CF13', '2014-06-24 05:24:59', '14035585389818116', 0),
(97, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'D5E1060E-88FE-0C4C-E849-9CE001F5CF13', '2014-06-24 05:28:01', '14035585389818116', 0),
(98, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-06-24 05:32:54', '14035591749885652', 0),
(99, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-06-24 05:33:01', '14035591749885652', 0),
(100, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-06-24 05:33:02', '14035591749885652', 0),
(101, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-06-24 05:33:03', '14035591749885652', 0),
(102, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-06-24 05:33:07', '14035591869895513', 0),
(106, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-06-24 13:54:30', '14035884649866161', 0),
(107, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-06-24 16:39:45', '14035987299866432', 0),
(109, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '313185E2-B881-078A-D00D-76B0D2C6EAFD', '2014-06-24 19:10:49', '14036082499895521', 0),
(110, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '313185E2-B881-078A-D00D-76B0D2C6EAFD', '2014-06-24 19:11:09', '14036082619834623', 0),
(111, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-06-24 22:43:04', '14036082619834623', 0),
(112, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'F866E83B-DE55-D28F-9055-1D7EDD425E75', '2014-06-24 22:43:27', '14036209909822821', 0),
(114, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-06-25 13:11:04', '14036730609855062', 0),
(115, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-06-25 13:11:09', '14036730679822664', 0),
(116, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-06-25 21:54:57', '14037044379864636', 0),
(117, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '313185E2-B881-078A-D00D-76B0D2C6EAFD', '2014-06-26 08:50:46', '14037438099866570', 0),
(119, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-06-26 13:58:09', '14037622899847120', 0),
(120, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-06-26 13:58:16', '14037622949817298', 0),
(121, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '768C15EF-19E0-2323-7616-9A42300611AB', '2014-06-26 13:58:27', '14037622949817298', 0),
(122, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-08-08 11:08:05', '14074672439826737', 0),
(123, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '9DC48BCB-7C54-7DF1-941B-473D8B1C13C6', '2014-08-08 11:08:22', '14074672439826737', 0),
(124, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'C35F6327-3A04-3620-A211-519708E46F16', '2014-08-08 11:08:30', '14074672439826737', 0),
(125, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-11-17 07:47:58', '14161816789810266', 0),
(133, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-11-17 07:51:49', '14161816899833090', 0),
(135, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-11-17 07:52:44', '14161816899833090', 0),
(137, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2014-11-17 07:53:56', '14161816899833090', 0),
(139, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 07:56:57', '14161816899833090', 0),
(141, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '768C15EF-19E0-2323-7616-9A42300611AB', '2014-11-17 08:31:02', '14161816899833090', 0),
(143, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 08:42:00', '14161816899833090', 0),
(145, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 08:43:47', '14161850279875068', 0),
(147, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 08:43:50', '14161850279875068', 0),
(149, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 08:44:00', '14161850279875068', 0),
(151, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 08:44:09', '14161850279875068', 0),
(153, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 08:44:13', '14161850279875068', 0),
(155, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 08:44:17', '14161850279875068', 0),
(157, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 08:44:36', '14161850279875068', 0),
(159, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 08:46:38', '14161850279875068', 0),
(161, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 08:47:02', '14161850279875068', 0),
(163, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2014-11-17 08:50:43', '14161850279875068', 0),
(165, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'AAD46A77-3A61-E498-7311-38C7103F8A2C', '2015-02-11 14:15:43', '14236353439890980', 0),
(167, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2015-02-11 16:16:11', '14236425719823705', 0),
(169, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'FC44E720-4A4F-5425-F059-3859924D2A52', '2015-02-11 16:28:46', '14236353519879007', 0),
(171, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '58930FBD-382E-D723-5B9F-E88A2F31C5C6', '2015-02-11 16:28:52', '14236353519879007', 0),
(173, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'A85ED768-D9CE-6DEB-913E-B8D84F29F4BA', '2015-02-11 17:18:48', '14236353519879007', 0),
(175, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '2714EA2A-49B8-A04C-672B-1E0EEF71E995', '2015-02-11 17:18:54', '14236353519879007', 0),
(177, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '2015-02-11 18:10:58', '14236494589865569', 0);
/*!40000 ALTER TABLE `shop_order` ENABLE KEYS */;
-- Dumping structure for table shop.shop_order_status
CREATE TABLE IF NOT EXISTS `shop_order_status` (
`order_status_id` int(11) NOT NULL AUTO_INCREMENT,
`order_serial` varchar(50) NOT NULL,
`status` varchar(45) NOT NULL,
PRIMARY KEY (`order_status_id`),
UNIQUE KEY `order_serial` (`order_serial`),
KEY `order_status_order_id_idx` (`order_serial`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
-- Dumping data for table shop.shop_order_status: ~21 rows (approximately)
/*!40000 ALTER TABLE `shop_order_status` DISABLE KEYS */;
INSERT INTO `shop_order_status` (`order_status_id`, `order_serial`, `status`) VALUES
(4, '14025127759820347', '已成功送到'),
(7, '14025349519894410', '已成功送到'),
(8, '14025349529884275', '已成功送到'),
(9, '14025453529813332', '已成功送到'),
(10, '14025454479846145', '已成功送到'),
(11, '14032579579882069', '已成功送到'),
(12, '14033140509844562', '已成功送到'),
(13, '14033314509824221', '已成功送到'),
(14, '14033332109869326', '已成功送到'),
(15, '14035219399873587', '已成功送到'),
(16, '14035591749885652', '已成功送到'),
(17, '14035987299866432', '已成功送到'),
(18, '14036082499895521', '已成功送到'),
(19, '14036082619834623', '已成功送到'),
(20, '14036719949855512', '已成功送到'),
(21, '14036730609855062', '已成功送到'),
(22, '14037438099866570', '已成功送到'),
(23, '14037622899847120', '已成功送到'),
(24, '14074672439826737', '已成功送到'),
(25, '14161816789810266', '已成功送到'),
(27, '14236353439890980', '已成功送到');
/*!40000 ALTER TABLE `shop_order_status` ENABLE KEYS */;
-- Dumping structure for table shop.shop_product
CREATE TABLE IF NOT EXISTS `shop_product` (
`product_id` int(11) NOT NULL AUTO_INCREMENT,
`product_uuid` varchar(36) NOT NULL,
`product_name` varchar(45) NOT NULL,
`reg_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`money` int(11) NOT NULL,
`amount` int(11) NOT NULL,
`money_type` varchar(10) DEFAULT NULL,
`category_id` int(11) NOT NULL,
`is_del` bit(1) NOT NULL,
PRIMARY KEY (`product_id`),
KEY `product_uuid_index` (`product_uuid`),
KEY `pk_category_id` (`category_id`),
CONSTRAINT `fk_category_id` FOREIGN KEY (`category_id`) REFERENCES `shop_category` (`category_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8;
-- Dumping data for table shop.shop_product: ~23 rows (approximately)
/*!40000 ALTER TABLE `shop_product` DISABLE KEYS */;
INSERT INTO `shop_product` (`product_id`, `product_uuid`, `product_name`, `reg_time`, `money`, `amount`, `money_type`, `category_id`, `is_del`) VALUES
(1, '12163A7E-0C61-6E11-567B-18971683E15C', 'yang', '2014-06-20 23:01:01', 123456, 91, 'RMB', 2, b'1'),
(14, '017D1BF7-0AD9-6850-C01F-B095E96A5E00', 'yan', '2014-06-20 23:01:11', 45, 1234, 'RMB', 2, b'1'),
(15, '77989D34-084E-F85C-06B1-58BE5B043372', '糖', '2014-06-20 23:01:20', 8, 8, 'RMB', 1, b'1'),
(16, '3DB4D533-DB32-2D26-858A-7D0B3184ED34', '杨志', '2014-06-20 23:01:29', 1, 1, 'Doller', 3, b'1'),
(17, '8B1B27FA-B232-9705-2DAA-B8C82A7E0945', '哙哙旗舰店 吉利火星即食桶装爆米花60g*16桶 组合装', '2014-06-20 22:26:28', 96, 1, 'rmb', 1, b'0'),
(18, 'FC44E720-4A4F-5425-F059-3859924D2A52', '益达木糖醇无糖口香糖清爽草莓味40粒瓶装56g', '2014-06-20 22:29:17', 11, 1, 'rmb', 1, b'0'),
(19, 'D5E1060E-88FE-0C4C-E849-9CE001F5CF13', '哙哙旗舰店 裕源乐合琥珀核桃仁100克*3罐优惠装', '2014-06-20 22:29:58', 40, 1, 'rmb', 2, b'0'),
(20, '58930FBD-382E-D723-5B9F-E88A2F31C5C6', '黄飞红麻辣花生210g', '2014-06-20 22:31:08', 9, 1, 'rmb', 2, b'0'),
(21, '64CDD23D-FF1B-DB3C-685E-2F473A366E17', '加州原野美国开心果100g(新老包装随机发放)', '2014-06-20 22:31:35', 10, 1, 'rmb', 2, b'0'),
(22, '9DC48BCB-7C54-7DF1-941B-473D8B1C13C6', '福建特产 友臣 金丝肉松饼208g', '2014-06-20 23:07:14', 10, 1, 'rmb', 6, b'0'),
(23, '1D16EB77-85FC-D5D2-C6A8-B0F64C67A4D0', '好丽友提拉米苏12枚276g', '2014-06-20 23:07:17', 20, 1, 'rmb', 6, b'0'),
(24, 'F866E83B-DE55-D28F-9055-1D7EDD425E75', '蜜兰诺 松塔 12粒装 192克(新老包装随机发送) 盒装', '2014-06-20 23:07:19', 17, 1, 'rmb', 6, b'0'),
(25, '768C15EF-19E0-2323-7616-9A42300611AB', '猴姑酥性饼干720g(30包)15天装 胃不好猴姑饼干', '2014-06-20 23:07:22', 99, 1, 'rmb', 6, b'0'),
(26, 'AAD46A77-3A61-E498-7311-38C7103F8A2C', '嘉士柏牛轧糖500g台湾特产手工花生牛轧糖 竹盐 芝麻牛扎糖 花生口味', '2014-06-20 23:08:09', 18, 1, 'rmb', 5, b'0'),
(27, '31E2921D-5C2F-482B-3373-BBFDD615BFD9', '麦德好燕麦巧克力 麦德好正宗营养麦片巧克力糖1000g', '2014-06-20 23:08:22', 33, 1, 'rmb', 5, b'0'),
(28, '71CAF7BA-76AE-C4A4-F29D-B31E0C19BC1C', '费列罗Ferrero进口巧克力DIY心形礼盒27粒【顺丰-代写卡】', '2014-06-20 23:08:37', 108, 1, 'rmb', 5, b'0'),
(29, '9ADB0846-BD35-25DF-28BC-B65FD1254DDE', '加拿大进口费列罗(FerreroRocher)榛果威化金莎巧克力T48粒钻石装礼盒600g', '2014-06-20 23:08:55', 138, 1, 'rmb', 5, b'0'),
(30, 'A85ED768-D9CE-6DEB-913E-B8D84F29F4BA', '良品铺子 麻辣灯影牛肉丝250g*2包 四川特产牛肉干 牛肉丝', '2014-06-20 23:11:43', 56, 1, 'rmb', 3, b'0'),
(31, 'E089B39E-FF7E-E736-DFE3-4B258F15CC7A', '重庆特产 有友泡凤爪山椒味100g*5袋', '2015-02-11 16:03:13', 20, 1, 'rmb', 3, b'1'),
(32, '2714EA2A-49B8-A04C-672B-1E0EEF71E995', '武汉特产 周黑鸭鸭脖210g', '2014-06-20 23:18:22', 30, 1, 'rmb', 3, b'0'),
(33, 'F6449A13-AAE2-E61E-C3C7-C1BA2CC24373', '良品铺子 秘制牛肉干140g*2包 卤汁牛肉 肉干肉脯', '2014-06-20 23:12:28', 50, 1, 'rmb', 3, b'0'),
(34, '313185E2-B881-078A-D00D-76B0D2C6EAFD', '彩虹渔场台湾手工花生牛轧糖800g 原味芝麻 花粉巧克力 四种口味618好货钜惠古厝甜头', '2014-06-20 23:15:10', 109, 1, 'rmb', 4, b'0'),
(35, 'C35F6327-3A04-3620-A211-519708E46F16', '麦斯威尔咖啡礼盒(香醇咖啡150g+咖啡搭档250g+对杯)', '2014-06-20 23:15:23', 66, 1, 'rmb', 4, b'0');
/*!40000 ALTER TABLE `shop_product` ENABLE KEYS */;
-- Dumping structure for table shop.shop_user
CREATE TABLE IF NOT EXISTS `shop_user` (
`user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_uuid` varchar(36) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(40) NOT NULL,
`email` varchar(40) NOT NULL,
`phone` int(10) unsigned DEFAULT NULL,
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`money` int(10) unsigned NOT NULL DEFAULT '0',
`is_del` bit(1) NOT NULL DEFAULT b'0',
`user_group` varchar(50) DEFAULT NULL,
PRIMARY KEY (`user_id`),
UNIQUE KEY `user_id_UNIQUE` (`user_id`,`user_uuid`),
KEY `user_uuid_idx` (`user_uuid`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
-- Dumping data for table shop.shop_user: ~11 rows (approximately)
/*!40000 ALTER TABLE `shop_user` DISABLE KEYS */;
INSERT INTO `shop_user` (`user_id`, `user_uuid`, `username`, `password`, `email`, `phone`, `create_time`, `money`, `is_del`, `user_group`) VALUES
(1, '123456df', 'ddd', 'f7c3bc1d808e04732adf679965ccc34ca7ae3441', '', 123456789, '2014-05-24 10:55:49', 1, b'0', NULL),
(2, '', 'yantze', 'f7c3bc1d808e04732adf679965ccc34ca7ae3441', '111', NULL, NULL, 0, b'0', NULL),
(3, '', 'yang', '40bd001563085fc35165329ea1ff5c5ecbdbbeef', '123', NULL, NULL, 0, b'0', NULL),
(4, '', 'yang', '7c4a8d09ca3762af61e59520943dc26494f8941b', '123456', NULL, NULL, 0, b'0', NULL),
(5, '', 'ya', '40bd001563085fc35165329ea1ff5c5ecbdbbeef', '123', NULL, NULL, 0, b'0', NULL),
(6, 'B2D4CCEE-C8AC-AD3C-E469-8A91C80BE80D', 'yax', '9c969ddf454079e3d439973bbab63ea6233e4087', '123', NULL, NULL, 0, b'1', NULL),
(7, '7206F219-7857-0A0B-183B-DED68F09C436', 'yax', 'b60d121b438a380c343d5ec3c2037564b82ffef3', '123', NULL, '2014-05-24 22:57:30', 0, b'1', NULL),
(8, '612C61D4-A88C-F2E6-ACEE-A5E2B3C3912D', 'yax', '40fa37ec00c761c7dbb6ebdee6d4a260b922f5f4', '123', NULL, '2014-05-24 22:58:11', 0, b'0', NULL),
(9, 'CEA658B6-6212-99E6-3001-675492E2C5CB', 'user', 'f7c3bc1d808e04732adf679965ccc34ca7ae3441', 'yantze@111.com', NULL, '2014-05-25 05:42:51', 0, b'1', NULL),
(10, '95728FD6-8854-54F0-20CB-371540A5EC27', 'yang', '40bd001563085fc35165329ea1ff5c5ecbdbbeef', '123', NULL, '2014-05-25 20:56:55', 0, b'0', NULL),
(11, '62EDF0BA-3060-4D89-3010-0CD37F2EC6B8', 'demo', '89e495e7941cf9e40e6980d14a16bf023ccd4c91', 'demo@db.com', NULL, '2014-05-28 00:45:00', 0, b'0', NULL);
/*!40000 ALTER TABLE `shop_user` ENABLE KEYS */;
-- Dumping structure for table shop.shop_user_groups
CREATE TABLE IF NOT EXISTS `shop_user_groups` (
`group_id` int(11) NOT NULL AUTO_INCREMENT,
`group_name` varchar(50) NOT NULL,
`group_privilege` varchar(50) NOT NULL,
PRIMARY KEY (`group_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1150 DEFAULT CHARSET=utf8 COMMENT='用户组表';
-- Dumping data for table shop.shop_user_groups: 0 rows
/*!40000 ALTER TABLE `shop_user_groups` DISABLE KEYS */;
/*!40000 ALTER TABLE `shop_user_groups` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | the_stack |
REM Script: Analytics - More complex ranking functions
REM SQL from the KISS (Keep It Simply SQL) Analytic video series by Developer Advocate Connor McDonald. This script demonstrates the PERCENT_RANK, CUME_DIST and NTILE functions.
Run this script standalone, or take it as part of the complete Analytics class at https://tinyurl.com/devgym-classes
drop table movies purge;
-- Note - the data in this table may be correct, it may be fictional. It was just harvested from the web so please dont rely on it.
create table movies
( year_of_release number(4),
name varchar2(60),
gross_sales number(12)
);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2009,'Avatar',2783918982);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (1997,'Titanic',2207615668);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2015,'Jurassic World',1666248032);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2012,'The Avengers',1519479547);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2015,'Furious 7',1515993181);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2015,'The Avengers: Age of Ultron',1404705868);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2011,'Harry Potter and the Deathly Hallows: Part II',1341511219);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2013,'Frozen',1274234980);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2013,'Iron Man 3',1215392272);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2015,'Minions',1163530631);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2003,'The Lord of the Rings: The Return of the King',1141408667);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2011,'Transformers: Dark of the Moon',1123790543);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2012,'Skyfall',1110526981);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'Transformers: Age of Extinction',1104039076);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2012,'The Dark Knight Rises',1084439099);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2010,'Toy Story 3',1069818229);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2006,'Pirates of the Caribbean: Dead Man''s Chest',1066215812);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2011,'Pirates of the Caribbean: On Stranger Tides',1045663875);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (1993,'Jurassic Park',1038812584);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (1999,'Star Wars Ep. I: The Phantom Menace',1027044677);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2010,'Alice in Wonderland',1025491110);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2012,'The Hobbit: An Unexpected Journey',1017003568);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2008,'The Dark Knight',1002891358);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (1994,'The Lion King',987480140);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2013,'Despicable Me 2',974873764);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2001,'Harry Potter and the Sorcerer''s Stone',974755371);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2007,'Pirates of the Caribbean: At World''s End',963420425);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2013,'The Hobbit: The Desolation of Smaug',960366855);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2010,'Harry Potter and the Deathly Hallows: Part I',959301070);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'The Hobbit: The Battle of the Five Armies',955119788);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2007,'Harry Potter and the Order of the Phoenix',942943935);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2003,'Finding Nemo',936429370);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2009,'Harry Potter and the Half-Blood Prince',935083686);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2002,'The Lord of the Rings: The Two Towers',934703179);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2004,'Shrek 2',932252921);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2005,'Harry Potter and the Goblet of Fire',896911078);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2007,'Spider-Man 3',890875303);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2001,'The Lord of the Rings: The Fellowship of the Ring',887217688);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2012,'Ice Age: Continental Drift',879765137);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2002,'Harry Potter and the Chamber of Secrets',878979634);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2013,'The Hunger Games: Catching Fire',864868047);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2009,'Ice Age: Dawn of the Dinosaurs',859701857);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2015,'Inside Out',853031215);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2005,'Star Wars Ep. III: Revenge of the Sith',848998877);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2009,'Transformers: Revenge of the Fallen',836519699);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2010,'Inception',832584416);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2012,'The Twilight Saga: Breaking Dawn, Part 2',829724737);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2015,'Spectre',821980199);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2002,'Spider-Man',821706375);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (1996,'Independence Day',817355682);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2007,'Shrek the Third',805623351);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2004,'Harry Potter and the Prisoner of Azkaban',796688549);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (1982,'ET: The Extra-Terrestrial',792804231);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2013,'Fast and Furious 6',789952811);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2009,'2012',788408539);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2008,'Indiana Jones and the Kingdom of the Crystal Skull',786558145);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (1977,'Star Wars Ep. IV: A New Hope',786535665);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2004,'Spider-Man 2',783705001);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'Guardians of the Galaxy',771172112);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2006,'The Da Vinci Code',767820459);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'Maleficent',758536735);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2012,'The Amazing Spider-Man',757890267);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2010,'Shrek Forever After',755903876);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'X-Men: Days of Future Past',748121534);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2012,'Madagascar 3: Europe''s Most Wanted',746921271);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2013,'Monsters University',743588329);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2003,'The Matrix Reloaded',738576929);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2009,'Up',731542621);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2005,'The Chronicles of Narnia',720539572);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2013,'Gravity',716392705);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'Captain America: The Winter Soldier',713846958);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'The Hunger Games: Mockingjay - Part 1',709635885);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'The Amazing Spider-Man 2',708996336);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2007,'Transformers',708098205);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2010,'The Twilight Saga: Eclipse',706102828);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'Dawn of the Planet of the Apes',703545589);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2015,'Mission: Impossible - Rogue Nation',700868363);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2011,'Mission: Impossible - Ghost Protocol',694713230);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2011,'The Twilight Saga: Breaking Dawn, Part 1',689420051);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2009,'The Twilight Saga: New Moon',687557727);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (1994,'Forrest Gump',679857164);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2012,'The Hunger Games',677923379);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (1999,'The Sixth Sense',672806292);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2013,'Man of Steel',667999518);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'Interstellar',665417894);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2011,'Kung Fu Panda 2',664837547);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2012,'Men in Black 3',654213485);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'Big Hero 6',652127828);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2006,'Ice Age: The Meltdown',651899282);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2002,'Star Wars Ep. II: Attack of the Clones',648200000);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2003,'Pirates of the Caribbean: The Curse of the Black Pearl',634954103);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2013,'Thor: The Dark World',633360018);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2008,'Kung Fu Panda',631910531);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2011,'Fast Five',629969804);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2007,'Ratatouille',626549695);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2008,'Hancock',624234272);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2010,'Iron Man 2',623256345);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2004,'The Passion of the Christ',622420667);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (1997,'The Lost World: Jurassic Park',618626844);
Insert into movies (YEAR_OF_RELEASE,NAME,GROSS_SALES) values (2014,'How to Train Your Dragon 2',616102924);
alter table movies add primary key ( name );
select count(*) from movies;
-- For these functions, you will get different (better) results than in the video, because we are using more data. We dont use so much in the video due to limited screen space.
select name, gross_sales,
100*cume_dist() over ( order by gross_sales ) as cumedist
from movies
order by 2,name;
select name, gross_sales,
100*percent_rank() over ( order by gross_sales ) as pctrank
from movies
order by 2,name;
select name, gross_sales,
ntile(4) over ( order by gross_sales ) as quartile
from movies
order by 2,name;
select name, gross_sales,
ntile(4) over ( order by gross_sales desc ) as quartile
from movies
order by 2,name; | the_stack |
--
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You under the Apache License, Version 2.0
-- (the "License"); you may not use this file except in compliance with
-- the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
-- Test the builtin type 'bit'
-- Specifically the base-16, hex bit literal
-- stupid test of literals
values(X'aAff');
-- casting to a for bit data type
values (cast (x'ee' as char(2) for bit data));
values x'aAff' || (cast (x'ee' as char(2) for bit data));
-- are the search conditions true?
create table tab1 (c1 char(25));
insert into tab1 values 'search condition is true';
select * from tab1 where ((X'1010' || X'0011' || X'0100') = X'101000110100');
select * From tab1 where ((X'1010' || X'0011' || X'0100') = X'101000110100');
select * from tab1 where (X'1100' > X'0011');
drop table tab1;
-- simple negative test
values(X'gg');
values(X'z');
values(X'zz');
-- fails after bug 5742 is fixed
values(X'9');
-- some quick tests of the length function
-- # bits in a string expression
values({fn length(X'ab')} * 8);
values({fn length(X'11')} * 8);
-- # characters in a string expression
values({fn length(X'ab')});
values({fn length(X'11')});
-- # octets in a string expression
values({fn length(X'ab')});
values({fn length(X'11')});
-- stupid test for syntax
create table t1 (b1 char for bit data, b2 char(2) for bit data, b3 varchar(2) for bit data, b4 LONG VARCHAR FOR BIT DATA,
b5 LONG VARCHAR FOR BIT DATA, b6 LONG VARCHAR FOR BIT DATA);
drop table t1;
create table t1 (b1 char for bit data, b2 char(1) for bit data not null, b3 varchar(1) for bit data not null,
b4 LONG VARCHAR FOR BIT DATA not null, b5 LONG VARCHAR FOR BIT DATA not null,
b6 LONG VARCHAR FOR BIT DATA not null);
drop table t1;
create table t (i int, s smallint, c char(10), v varchar(50),
d double precision, r real, b char (2) for bit data, bv varchar(8) for bit data,
lbv LONG VARCHAR FOR BIT DATA);
-- explicit null
insert into t values (null, null, null, null, null, null, null, null, null);
-- implicit null
insert into t (i) values (null);
select b, bv, lbv from t;
-- sample data
insert into t values (0, 100, 'hello', 'everyone is here', 200.0e0, 200.0e0,
X'12af', X'0000111100001111', X'abc123');
insert into t values (-1, -100, 'goodbye', 'everyone is there', -200.0e0, -200.0e0,
X'0000', X'', X'10101010');
-- truncation -- should get an error
insert into t (b, bv) values (X'ffffffff', X'ffffffff');
select b, bv, lbv from t;
-- padding -- will be warning, some day (not now)
insert into t (b, bv) values (X'01', X'01');
insert into t (b, bv) values (X'', X'');
select b, bv from t;
drop table t;
--
-- simple comparisons
-- returns 1 if the search conditions are true
--
create table nulltab (b char(1) for bit data);
insert into nulltab values (null);
select 1 from nulltab where X'0001' > X'0000';
select 1 from nulltab where X'0100' > X'0001';
select 1 from nulltab where X'ff00' > X'00ff';
select 1 from nulltab where X'0100' > X'0100';
select 1 from nulltab where X'0100' > b;
select 1 from nulltab where X'0001' >= X'0000';
select 1 from nulltab where X'0100' >= X'0001';
select 1 from nulltab where X'ff00' >= X'00ff';
select 1 from nulltab where X'0100' >= b;
select 1 from nulltab where X'0001' < X'0000';
select 1 from nulltab where X'0100' < X'0001';
select 1 from nulltab where X'ff00' < X'00ff';
select 1 from nulltab where X'0100' < b;
select 1 from nulltab where X'0001' <= X'0000';
select 1 from nulltab where X'0100' <= X'0001';
select 1 from nulltab where X'ff00' <= X'00ff';
select 1 from nulltab where X'0100' <= b;
drop table nulltab;
--
-- select comparisons
--
create table t (b10 char(20) for bit data, vb10 varchar(20) for bit data, b16 char(2) for bit data, vb16 varchar(2) for bit data, lbv LONG VARCHAR FOR BIT DATA, c20 char(20), cv20 varchar(20));
insert into t values (null, null, null, null, null, 'null', 'null columns');
insert into t values (X'', X'', X'', X'', X'', '0', 'zero length column');
insert into t values (X'0000000001', X'0000000001', X'01', X'01', X'0000000001', '1', '1');
insert into t values (X'0000000011', X'0000000011', X'03', X'03', X'03', '3', '3');
insert into t values (X'1111111111', X'1111111111', X'ff', X'ff', X'1111111111', 'ff', 'ff');
insert into t values (X'11', X'11', X'aa', X'aa', X'aa', 'aa', 'aa');
-- make sure built-in functions work ok on binary types,
-- it is a little special since it maps to an
-- array. use length to make sure it wont
-- diff from run to run
select {fn length(cast(b10 as char(10)))} from t where b10 is not null;
select {fn length(cast(vb10 as char(10)))} from t where vb10 is not null;
select {fn length(cast(lbv as char(10)))} from t where vb10 is not null;
select b10, c20, cv20 from t order by b10 asc;
select b10, c20, cv20 from t order by b10 desc;
select vb10, c20, cv20 from t order by vb10;
select b16, c20, cv20 from t order by b16;
select vb16, c20, cv20 from t order by vb16;
select vb16, c20, cv20, lbv from t order by lbv;
select b10 from t where b10 > X'0000000010';
select b10 from t where b10 < X'0000000010';
select b10 from t where b10 <= X'0000000011';
select b10 from t where b10 >= X'0000000011';
select b10 from t where b10 <> X'0000000011';
select vb10 from t where vb10 > X'0000000010';
select vb10 from t where vb10 < X'0000000010';
select vb10 from t where vb10 <= X'0000000011';
select vb10 from t where vb10 >= X'0000000011';
select vb10 from t where vb10 <> X'0000000011';
select b16 from t where b16 > X'0000000010';
select b16 from t where b16 < X'0000000010';
select b16 from t where b16 <= X'0000000011';
select b16 from t where b16 >= X'0000000011';
select b16 from t where b16 <> X'0000000011';
select vb16 from t where vb16 > X'0000000010';
select vb16 from t where vb16 < X'0000000010';
select vb16 from t where vb16 <= X'0000000011';
select vb16 from t where vb16 >= X'0000000011';
select vb16 from t where vb16 <> X'0000000011';
select lbv from t where lbv > X'0000000010';
select lbv from t where lbv < X'0000000010';
select lbv from t where lbv <= X'0000000011';
select lbv from t where lbv >= X'0000000011';
select lbv from t where lbv <> X'0000000011';
select b10, vb10||X'11' from t where vb10||X'11' > b10;
select b10, X'11'||vb10 from t where X'11'||vb10 > b10;
select b16, vb16||X'11' from t where vb16||X'11' > b16;
select b10 || vb10 from t;
select lbv || b10 from t;
select b10 || lbv from t;
select lbv || vb10 from t;
select vb10 || lbv from t;
select t1.b10 from t t1, t t2 where t1.b10 > t2.b10;
-- FUNCTIONS
-- some length functions
select {fn length(b10)} from t;
select {fn length(vb10)} from t;
select {fn length(lbv)} from t;
select {fn length(c20)} from t;
select {fn length(cv20)} from t;
drop table t;
-----------------------
-- test normalization
-----------------------
create table t1 (c1 char(2) for bit data);
insert into t1 values (X'0001');
insert into t1 values (X'0010');
insert into t1 values (X'0011');
select * from t1;
-- now insert something that needs to be expanded
insert into t1 values (X'11');
select * from t1;
-- insert select, expand 1 byte
create table t2 (c1 char(3) for bit data);
insert into t2 select c1 from t1;
select * from t2;
drop table t2;
-- insert select, expand many bytes
create table t2 (c1 char(20) for bit data);
insert into t2 select c1 from t1;
select * from t2;
drop table t2;
drop table t1;
--
-- some extra tests for truncation. in 2.0
create table t1 (b1 char(1) for bit data);
-- ok
insert into t1 values (X'11');
-- valid length
insert into t1 values (X'10');
insert into t1 values (X'11');
-- truncation errors
insert into t1 values (X'1000');
insert into t1 values (X'100000');
insert into t1 values (X'10000000');
insert into t1 values (X'1000000000');
insert into t1 values (X'100001');
insert into t1 values (X'0001');
insert into t1 values (X'8001');
insert into t1 values (X'8000');
drop table t1;
create table t1 (b9 char(2) for bit data);
-- ok
insert into t1 values (X'1111');
-- truncation errors
insert into t1 values (X'111100');
insert into t1 values (X'11110000');
insert into t1 values (X'1111000000');
insert into t1 values (X'1111111100000000');
insert into t1 values (X'1111111111');
insert into t1 values (X'11111111100001');
insert into t1 values (X'0001');
insert into t1 values (X'8001');
insert into t1 values (X'8000');
drop table t1;
-- a few other conditions
create table t1 (b3 char(2) for bit data, b7 char(4) for bit data, b8 char (5) for bit data, b15 char(8) for bit data, b16 char(9) for bit data);
-- ok
insert into t1 values
(
X'1111',
X'11111111',
X'1111111111',
X'1111111111111111',
X'111111111111111111'
);
-- ok
insert into t1 values
(
X'1110',
X'11111110',
X'11111111',
X'1111111111111110',
X'1111111111111111'
);
-- bad
-- truncation error for column b8
insert into t1 values
(
null,
null,
X'111111111110',
null,
null
);
-- truncation error for column b7
insert into t1 values
(
null,
X'1111111100',
null,
null,
null
);
-- truncation error for column b7
insert into t1 values
(
null,
X'1111111111',
null,
null,
null
);
-- truncation error for column b15
insert into t1 values
(
null,
null,
null,
X'111111111111111100',
null
);
-- truncation error for column b15
insert into t1 values
(
null,
null,
null,
X'111111111111111111',
null
);
-- truncation error for column b16
insert into t1 values
(
null,
null,
null,
null,
X'11111111111111111110'
);
AUTOCOMMIT OFF;
-- bug 5160 - incorrect typing of VALUES table constructor on an insert;
create table iv (id int, vc varchar(12));
insert into iv values (1, 'abc'), (2, 'defghijk'), (3, 'lmnopqrstcc');
insert into iv values (4, null), (5, 'null ok?'), (6, '2blanks ');
insert into iv values (7, 'dddd'), (8, '0123456789123'), (9, 'too long');
select id, vc, {fn length(vc)} AS LEN from iv order by 1;
-- the inner values must not be changed to VARCHAR as it is not the table constructor
insert into iv select * from (values (10, 'pad'), (11, 'pad me'), (12, 'anakin jedi')) as t(i, c);
select id, vc, {fn length(vc)} AS LEN from iv order by 1;
-- check values outside of table constructors retain their CHARness
select c, {fn length(c)} AS LEN from (values (1, 'abc'), (2, 'defghijk'), (3, 'lmnopqrstcc')) as t(i, c);
drop table iv;
create table bv (id int, vb varchar(16) for bit data);
insert into bv values (1, X'1a'), (2, X'cafebabe'), (3, null);
select id, vb, {fn length(vb)} AS LEN from bv order by 1;
drop table bv;
create table dv (id int, vc varchar(12));
-- beetle 5568
-- should fail because DB2 doesn't allow this implicit casting to string
insert into dv values (1, 1.2), (2, 34.5639), (3, null);
-- should pass
insert into dv values (1, '1.2'), (2, '34.5639'), (3, null);
select id, vc from dv order by 1;
drop table dv;
-- bug 5306 -- incorrect padding of VALUES table constructor on an insert,
-- when implicit casting (bit->char or char->bit) is used.
-- 5306: Char -> For Bit Data Types
create table bitTable (id int, bv LONG VARCHAR FOR BIT DATA);
insert into bitTable values (1, X'031'), (2, X'032'), (3, X'');
insert into bitTable values (4, null), (5, X'033'), (6, X'2020');
select id, bv, {fn length(bv)} as LEN from bitTable order by 1;
-- the inner values must not be changed to varying, as it is not the table constructor
insert into bitTable select * from (values (10, 'pad'), (11, 'pad me'), (12, 'anakin jedi')) as t(i, c);
select id, bv, {fn length(bv)} AS LEN from bitTable order by 1;
drop table bitTable;
-- 5306: Bit -> Char
create table charTable (id int, cv long varchar);
insert into charTable values (1, x'0101'), (2, x'00101100101001'), (3, x'');
insert into charTable values (4, null), (5, x'1010101111'), (6, x'1000');
select id, cv, {fn length(cv)} as LEN from charTable order by 1;
-- the inner values must not be changed to varying, as it is not the table constructor
insert into charTable select * from (values (10, x'001010'), (11, x'01011010101111'), (12, x'0101010101000010100101110101')) as t(i, c);
select id, cv, {fn length(cv)} AS LEN from charTable order by 1;
drop table charTable;
-- Verify that 5306 still works with Union.
create table pt5 (b5 char(2) for bit data);
create table pt10 (b10 char (4) for bit data);
insert into pt10 values (x'01000110');
insert into pt5 values (x'1010');
select {fn length(CM)} from (select b5 from pt5 union all select b10 from pt10) as t(CM);
drop table pt5;
drop table pt10;
-- beetle 5612
create table t5612 (c1 char(10), c2 varchar(10), c3 long varchar);
insert into t5612 values (X'00680069', X'00680069', X'00680069');
select * from t5612;
values cast(X'00680069' as char(30)), cast(X'00680069' as varchar(30)), cast(X'00680069' as long varchar);
-- DERBY-1085
create table npetest1 (col1 varchar(36) for bit data not null, constraint pknpe1 primary key (col1));
create table npetest2 (col2 varchar(36) for bit data, constraint fknpe1 foreign key (col2) references npetest1(col1) on delete cascade);
insert into npetest1 (col1) values (X'0000000001');
insert into npetest1 (col1) values (X'0000000002');
insert into npetest1 (col1) values (X'0000000003');
insert into npetest2 (col2) values (X'0000000001');
insert into npetest2 (col2) values (NULL);
insert into npetest2 (col2) values (X'0000000002');
select col1 from npetest1 where col1 not in (select col2 from npetest2);
select col1 from npetest1 where col1 not in (select col2 from npetest2 where col2 is not null);
drop table npetest2;
drop table npetest1; | the_stack |
-- 2020-03-02T08:23:40.019Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,IsActive,Created,CreatedBy,AD_Org_ID,Updated,UpdatedBy,AD_Element_ID,ColumnName,PrintName,Name,EntityType) VALUES (0,'Y',TO_TIMESTAMP('2020-03-02 10:23:39','YYYY-MM-DD HH24:MI:SS'),100,0,TO_TIMESTAMP('2020-03-02 10:23:39','YYYY-MM-DD HH24:MI:SS'),100,577574,'DebitStmtAmt','Debit Statement Amount','Debit Statement Amount','U')
;
-- 2020-03-02T08:23:40.029Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, PO_PrintName,CommitWarning,WEBUI_NameBrowse,WEBUI_NameNew,Help,PrintName,PO_Description,PO_Help,PO_Name,WEBUI_NameNewBreadcrumb,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.PO_PrintName,t.CommitWarning,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.Help,t.PrintName,t.PO_Description,t.PO_Help,t.PO_Name,t.WEBUI_NameNewBreadcrumb,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577574 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2020-03-02T08:23:42.660Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET EntityType='D',Updated=TO_TIMESTAMP('2020-03-02 10:23:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577574
;
-- 2020-03-02T08:24:21.386Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,IsActive,Created,CreatedBy,AD_Org_ID,Updated,UpdatedBy,AD_Element_ID,ColumnName,PrintName,Name,EntityType) VALUES (0,'Y',TO_TIMESTAMP('2020-03-02 10:24:21','YYYY-MM-DD HH24:MI:SS'),100,0,TO_TIMESTAMP('2020-03-02 10:24:21','YYYY-MM-DD HH24:MI:SS'),100,577575,'CreditStmtAmt','Credit Statement Amount','Credit Statement Amount','D')
;
-- 2020-03-02T08:24:21.388Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, PO_PrintName,CommitWarning,WEBUI_NameBrowse,WEBUI_NameNew,Help,PrintName,PO_Description,PO_Help,PO_Name,WEBUI_NameNewBreadcrumb,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.PO_PrintName,t.CommitWarning,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.Help,t.PrintName,t.PO_Description,t.PO_Help,t.PO_Name,t.WEBUI_NameNewBreadcrumb,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577575 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2020-03-02T08:26:15.887Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Reference_ID,FieldLength,Version,IsKey,IsParent,IsTranslated,IsIdentifier,SeqNo,AD_Client_ID,IsActive,Created,CreatedBy,IsUpdateable,DDL_NoForeignKey,IsSelectionColumn,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,IsEncrypted,Updated,UpdatedBy,IsAdvancedText,IsLazyLoading,AD_Table_ID,IsCalculated,AD_Column_ID,IsDimension,IsMandatory,IsStaleable,IsUseDocSequence,IsRangeFilter,IsShowFilterIncrementButtons,IsDLMPartitionBoundary,IsGenericZoomKeyColumn,SelectionColumnSeqNo,AD_Element_ID,IsForceIncludeInGeneratedModel,IsGenericZoomOrigin,ColumnName,IsAutoApplyValidationRule,Name,AD_Org_ID,EntityType) VALUES (12,10,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2020-03-02 10:26:15','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','N','N','N','Y','N',TO_TIMESTAMP('2020-03-02 10:26:15','YYYY-MM-DD HH24:MI:SS'),100,'N','N',600,'N',570075,'N','N','N','N','N','N','N','N',0,577574,'N','N','DebitStmtAmt','N','Debit Statement Amount',0,'D')
;
-- 2020-03-02T08:26:15.889Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Column_ID=570075 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2020-03-02T08:26:15.914Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_Column_Translation_From_AD_Element(577574)
;
-- 2020-03-02T08:26:19.881Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('I_BankStatement','ALTER TABLE public.I_BankStatement ADD COLUMN DebitStmtAmt NUMERIC')
;
-- 2020-03-02T08:26:36.631Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Reference_ID,FieldLength,Version,IsKey,IsParent,IsTranslated,IsIdentifier,SeqNo,AD_Client_ID,IsActive,Created,CreatedBy,IsUpdateable,DDL_NoForeignKey,IsSelectionColumn,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,IsEncrypted,Updated,UpdatedBy,IsAdvancedText,IsLazyLoading,AD_Table_ID,IsCalculated,AD_Column_ID,IsDimension,IsMandatory,IsStaleable,IsUseDocSequence,IsRangeFilter,IsShowFilterIncrementButtons,IsDLMPartitionBoundary,IsGenericZoomKeyColumn,SelectionColumnSeqNo,AD_Element_ID,IsForceIncludeInGeneratedModel,IsGenericZoomOrigin,ColumnName,IsAutoApplyValidationRule,Name,AD_Org_ID,EntityType) VALUES (12,10,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2020-03-02 10:26:36','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','N','N','N','Y','N',TO_TIMESTAMP('2020-03-02 10:26:36','YYYY-MM-DD HH24:MI:SS'),100,'N','N',600,'N',570076,'N','N','N','N','N','N','N','N',0,577575,'N','N','CreditStmtAmt','N','Credit Statement Amount',0,'D')
;
-- 2020-03-02T08:26:36.632Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Column_ID=570076 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2020-03-02T08:26:36.634Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_Column_Translation_From_AD_Element(577575)
;
-- 2020-03-02T08:26:40.004Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('I_BankStatement','ALTER TABLE public.I_BankStatement ADD COLUMN CreditStmtAmt NUMERIC')
;
-- 2020-03-02T08:30:31.968Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Reference_ID,FieldLength,Version,IsKey,IsParent,IsTranslated,IsIdentifier,SeqNo,AD_Client_ID,IsActive,Created,CreatedBy,IsUpdateable,DDL_NoForeignKey,IsSelectionColumn,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,IsEncrypted,Updated,UpdatedBy,IsAdvancedText,IsLazyLoading,AD_Table_ID,IsCalculated,AD_Column_ID,IsDimension,IsMandatory,IsStaleable,IsUseDocSequence,IsRangeFilter,IsShowFilterIncrementButtons,IsDLMPartitionBoundary,IsGenericZoomKeyColumn,SelectionColumnSeqNo,AD_Element_ID,IsForceIncludeInGeneratedModel,IsGenericZoomOrigin,ColumnName,IsAutoApplyValidationRule,Name,AD_Org_ID,EntityType) VALUES (12,10,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2020-03-02 10:30:31','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','N','N','N','Y','N',TO_TIMESTAMP('2020-03-02 10:30:31','YYYY-MM-DD HH24:MI:SS'),100,'N','N',393,'N',570077,'N','N','N','N','N','N','N','N',0,577574,'N','N','DebitStmtAmt','N','Debit Statement Amount',0,'D')
;
-- 2020-03-02T08:30:31.970Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Column_ID=570077 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2020-03-02T08:30:31.972Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_Column_Translation_From_AD_Element(577574)
;
-- 2020-03-02T08:30:40.480Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('C_BankStatementLine','ALTER TABLE public.C_BankStatementLine ADD COLUMN DebitStmtAmt NUMERIC')
;
-- 2020-03-02T08:30:51.796Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Reference_ID,FieldLength,Version,IsKey,IsParent,IsTranslated,IsIdentifier,SeqNo,AD_Client_ID,IsActive,Created,CreatedBy,IsUpdateable,DDL_NoForeignKey,IsSelectionColumn,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,IsEncrypted,Updated,UpdatedBy,IsAdvancedText,IsLazyLoading,AD_Table_ID,IsCalculated,AD_Column_ID,IsDimension,IsMandatory,IsStaleable,IsUseDocSequence,IsRangeFilter,IsShowFilterIncrementButtons,IsDLMPartitionBoundary,IsGenericZoomKeyColumn,SelectionColumnSeqNo,AD_Element_ID,IsForceIncludeInGeneratedModel,IsGenericZoomOrigin,ColumnName,IsAutoApplyValidationRule,Name,AD_Org_ID,EntityType) VALUES (12,10,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2020-03-02 10:30:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','N','N','N','Y','N',TO_TIMESTAMP('2020-03-02 10:30:51','YYYY-MM-DD HH24:MI:SS'),100,'N','N',393,'N',570078,'N','N','N','N','N','N','N','N',0,577575,'N','N','CreditStmtAmt','N','Credit Statement Amount',0,'D')
;
-- 2020-03-02T08:30:51.798Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Column_ID=570078 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2020-03-02T08:30:51.800Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_Column_Translation_From_AD_Element(577575)
;
-- 2020-03-02T08:30:54.756Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('C_BankStatementLine','ALTER TABLE public.C_BankStatementLine ADD COLUMN CreditStmtAmt NUMERIC')
;
-- 2020-03-02T09:00:22.364Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO t_alter_column values('c_bankstatementline','CreditStmtAmt','NUMERIC',null,null)
;
-- 2020-03-02T09:00:29.036Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO t_alter_column values('c_bankstatementline','DebitStmtAmt','NUMERIC',null,null)
;
-- 2020-03-02T09:11:54.979Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=570077
;
-- 2020-03-02T09:11:54.985Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=570077
;
-- 2020-03-02T09:12:00.670Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=570078
;
-- 2020-03-02T09:12:00.675Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=570078
;
-- 2020-03-02T09:12:39.533Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Auszugsbetrag Soll', IsTranslated='Y', Name='Auszugsbetrag Soll',Updated=TO_TIMESTAMP('2020-03-02 11:12:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=577574
;
-- 2020-03-02T09:12:39.535Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577574,'de_CH')
;
-- 2020-03-02T09:12:43.341Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Auszugsbetrag Soll', IsTranslated='Y', Name='Auszugsbetrag Soll',Updated=TO_TIMESTAMP('2020-03-02 11:12:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=577574
;
-- 2020-03-02T09:12:43.343Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577574,'de_DE')
;
-- 2020-03-02T09:12:43.370Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577574,'de_DE')
;
-- 2020-03-02T09:12:43.373Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='DebitStmtAmt', Name='Auszugsbetrag Soll', Description=NULL, Help=NULL WHERE AD_Element_ID=577574
;
-- 2020-03-02T09:12:43.374Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='DebitStmtAmt', Name='Auszugsbetrag Soll', Description=NULL, Help=NULL, AD_Element_ID=577574 WHERE UPPER(ColumnName)='DEBITSTMTAMT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-03-02T09:12:43.376Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='DebitStmtAmt', Name='Auszugsbetrag Soll', Description=NULL, Help=NULL WHERE AD_Element_ID=577574 AND IsCentrallyMaintained='Y'
;
-- 2020-03-02T09:12:43.377Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Auszugsbetrag Soll', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577574) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577574)
;
-- 2020-03-02T09:12:43.390Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Auszugsbetrag Soll', Name='Auszugsbetrag Soll' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=577574)
;
-- 2020-03-02T09:12:43.404Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Auszugsbetrag Soll', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577574
;
-- 2020-03-02T09:12:43.406Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Auszugsbetrag Soll', Description=NULL, Help=NULL WHERE AD_Element_ID = 577574
;
-- 2020-03-02T09:12:43.408Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Auszugsbetrag Soll', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577574
;
-- 2020-03-02T09:12:45.890Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-03-02 11:12:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Element_ID=577574
;
-- 2020-03-02T09:12:45.891Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577574,'en_US')
;
-- 2020-03-02T09:13:06.937Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Auszugsbetrag Haben', IsTranslated='Y', Name='Auszugsbetrag Haben',Updated=TO_TIMESTAMP('2020-03-02 11:13:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=577575
;
-- 2020-03-02T09:13:06.938Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577575,'de_CH')
;
-- 2020-03-02T09:13:10.373Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Auszugsbetrag Haben', IsTranslated='Y', Name='Auszugsbetrag Haben',Updated=TO_TIMESTAMP('2020-03-02 11:13:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=577575
;
-- 2020-03-02T09:13:10.374Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577575,'de_DE')
;
-- 2020-03-02T09:13:10.402Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577575,'de_DE')
;
-- 2020-03-02T09:13:10.403Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='CreditStmtAmt', Name='Auszugsbetrag Haben', Description=NULL, Help=NULL WHERE AD_Element_ID=577575
;
-- 2020-03-02T09:13:10.405Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='CreditStmtAmt', Name='Auszugsbetrag Haben', Description=NULL, Help=NULL, AD_Element_ID=577575 WHERE UPPER(ColumnName)='CREDITSTMTAMT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-03-02T09:13:10.406Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='CreditStmtAmt', Name='Auszugsbetrag Haben', Description=NULL, Help=NULL WHERE AD_Element_ID=577575 AND IsCentrallyMaintained='Y'
;
-- 2020-03-02T09:13:10.407Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Auszugsbetrag Haben', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577575) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577575)
;
-- 2020-03-02T09:13:10.419Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Auszugsbetrag Haben', Name='Auszugsbetrag Haben' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=577575)
;
-- 2020-03-02T09:13:10.433Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Auszugsbetrag Haben', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577575
;
-- 2020-03-02T09:13:10.435Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Auszugsbetrag Haben', Description=NULL, Help=NULL WHERE AD_Element_ID = 577575
;
-- 2020-03-02T09:13:10.437Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Auszugsbetrag Haben', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577575
;
-- 2020-03-02T09:13:12.817Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-03-02 11:13:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Element_ID=577575
;
-- 2020-03-02T09:13:12.818Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577575,'en_US')
; | the_stack |
DROP FUNCTION IF EXISTS ad_user_record_access_updatefrom_bpartnerhierarchy()
;
CREATE FUNCTION ad_user_record_access_updatefrom_bpartnerhierarchy()
RETURNS void
LANGUAGE plpgsql
AS
$$
DECLARE
v_count numeric;
BEGIN
DROP TABLE IF EXISTS TMP_RecordsToGrantAccess;
CREATE TEMPORARY TABLE TMP_RecordsToGrantAccess
(
ad_table_id numeric NOT NULL,
record_id numeric NOT NULL,
ad_user_id numeric NOT NULL,
access varchar,
comments text,
id numeric NOT NULL,
parent_id numeric,
root_id numeric,
level integer
);
CREATE UNIQUE INDEX ON TMP_RecordsToGrantAccess (id);
--
-- BPartners
--
WITH RECURSIVE bpartner AS (
SELECT bp.c_bpartner_id AS root_bpartner_id,
bp.name AS root_bpartner_name,
u.ad_user_id AS root_salesRep_ID,
u.name AS root_salesRep_Name,
bp.c_bpartner_id,
bp.name AS BPName,
permissions.access AS access,
NEXTVAL('ad_user_record_access_seq') AS id,
NULL::numeric AS parent_id,
NULL::numeric AS root_id,
0::integer AS level
FROM c_bpartner bp
INNER JOIN ad_user u ON u.c_bpartner_id = bp.c_bpartner_id AND u.isactive = 'Y' AND u.issystemuser = 'Y'
,
(SELECT 'R' AS access
UNION ALL
SELECT 'W' AS access
) AS permissions
WHERE TRUE
AND (bp.c_bpartner_salesrep_id IS NULL OR bp.c_bpartner_salesrep_id = bp.c_bpartner_id)
-- AND EXISTS(SELECT 1 FROM c_bpartner child_bp WHERE child_bp.c_bpartner_salesrep_id = bp.c_bpartner_id)
AND EXISTS(SELECT 1
FROM c_flatrate_term contract
WHERE TRUE
AND contract.bill_bpartner_id = bp.c_bpartner_id
AND contract.c_flatrate_conditions_id IN (1000026, 1000027)
AND contract.docstatus = 'CO'
AND contract.startdate <= NOW()
AND (contract.enddate IS NULL OR contract.enddate >= NOW()))
--
UNION ALL
--
SELECT parent.root_bpartner_id,
parent.root_bpartner_name,
parent.root_salesRep_ID,
parent.root_salesRep_Name,
child.c_bpartner_id,
child.name AS BPName,
parent.access AS ACCESS,
NEXTVAL('ad_user_record_access_seq') AS id,
parent.id AS parent_id,
parent.id AS root_id,
parent.level + 1 AS level
FROM bpartner parent
INNER JOIN c_bpartner child
ON child.c_bpartner_salesrep_id = parent.c_bpartner_id
WHERE child.c_bpartner_id <> parent.c_bpartner_id -- avoid recursion
)
INSERT
INTO TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id, level)
SELECT 291 AS ad_table_id,
c_bpartner_id AS record_id,
root_salesRep_ID AS ad_user_id,
bpartner.access AS access,
'BP: ' || BPName || '(Root: ' || root_bpartner_name || ')' AS comments,
bpartner.id AS id,
bpartner.parent_id AS parent_id,
bpartner.root_id AS root_id,
bpartner.level AS level
FROM bpartner
ORDER BY root_bpartner_id;
-- select * from bpartner order by root_bpartner_id
GET DIAGNOSTICS v_count = ROW_COUNT;
RAISE NOTICE 'Considered % C_BPartner(s)', v_count;
--
-- Set Root_ID
--
UPDATE TMP_RecordsToGrantAccess SET root_id=id WHERE root_id IS NULL;
GET DIAGNOSTICS v_count = ROW_COUNT;
RAISE NOTICE 'Set Root_ID for % records', v_count;
--
-- Orders
--
INSERT
INTO TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
SELECT 259 AS AD_Table_ID,
o.c_order_id AS record_id,
a.ad_user_id AS ad_user_id,
a.access AS access,
'' AS comments,
NEXTVAL('ad_user_record_access_seq') AS id,
a.id AS parent_id,
a.root_id AS root_id
FROM TMP_RecordsToGrantAccess a
INNER JOIN C_Order o ON o.c_bpartner_id = a.record_id
WHERE a.ad_table_id = 291 -- C_BPartner
;
GET DIAGNOSTICS v_count = ROW_COUNT;
RAISE NOTICE 'Considered % C_Order(s)', v_count;
--
-- Invoices
--
INSERT
INTO TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
SELECT 318 AS AD_Table_ID,
i.c_invoice_id AS record_id,
a.ad_user_id AS ad_user_id,
a.access AS access,
'' AS comments,
NEXTVAL('ad_user_record_access_seq') AS id,
a.id AS parent_id,
a.root_id AS root_id
FROM TMP_RecordsToGrantAccess a
INNER JOIN c_invoice i ON i.c_bpartner_id = a.record_id
WHERE a.ad_table_id = 291 -- C_BPartner
;
GET DIAGNOSTICS v_count = ROW_COUNT;
RAISE NOTICE 'Considered % C_Invoice(s)', v_count;
--
-- InOuts
--
INSERT
INTO TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
SELECT 319 AS AD_Table_ID,
io.m_inout_id AS record_id,
a.ad_user_id AS ad_user_id,
a.access AS access,
'' AS comments,
NEXTVAL('ad_user_record_access_seq') AS id,
a.id AS parent_id,
a.root_id AS root_id
FROM TMP_RecordsToGrantAccess a
INNER JOIN m_inout io ON io.c_bpartner_id = a.record_id
WHERE a.ad_table_id = 291 -- C_BPartner
;
GET DIAGNOSTICS v_count = ROW_COUNT;
RAISE NOTICE 'Considered % M_InOut(s)', v_count;
--
-- Payments
--
INSERT
INTO TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
SELECT 335 AS AD_Table_ID,
p.c_payment_id AS record_id,
a.ad_user_id AS ad_user_id,
a.access AS access,
'' AS comments,
NEXTVAL('ad_user_record_access_seq') AS id,
a.id AS parent_id,
a.root_id AS root_id
FROM TMP_RecordsToGrantAccess a
INNER JOIN c_payment p ON p.c_bpartner_id = a.record_id
WHERE a.ad_table_id = 291 -- C_BPartner
;
GET DIAGNOSTICS v_count = ROW_COUNT;
RAISE NOTICE 'Considered % C_Payment(s)', v_count;
--
-- Requests
--
INSERT
INTO TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
SELECT 417 AS AD_Table_ID,
r.R_Request_Id AS record_id,
a.ad_user_id AS ad_user_id,
a.access AS access,
'' AS comments,
NEXTVAL('ad_user_record_access_seq') AS id,
a.id AS parent_id,
a.root_id AS root_id
FROM TMP_RecordsToGrantAccess a
INNER JOIN R_Request r ON r.c_bpartner_id = a.record_id
WHERE a.ad_table_id = 291 -- C_BPartner
;
GET DIAGNOSTICS v_count = ROW_COUNT;
RAISE NOTICE 'Considered % R_Request(s)', v_count;
--
-- Users
-- grant access of the users linked to the partners
INSERT
INTO TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
SELECT 114 AS AD_Table_ID,
u.AD_User_ID AS record_id,
a.ad_user_id AS ad_user_id,
a.access AS access,
'' AS comments,
NEXTVAL('ad_user_record_access_seq') AS id,
a.id AS parent_id,
a.root_id AS root_id
FROM TMP_RecordsToGrantAccess a
INNER JOIN AD_User u ON u.c_bpartner_id = a.record_id;
GET DIAGNOSTICS v_count = ROW_COUNT;
RAISE NOTICE 'Considered % AD_User(s)', v_count;
--
-- Check TMP_RecordsToGrantAccess
-- select * from TMP_RecordsToGrantAccess;
--
--
-- Update ad_user_record_access
--
--
-- remove existing access rules
DELETE FROM ad_user_record_access WHERE PermissionIssuer = 'AUTO_BP_HIERARCHY';
GET DIAGNOSTICS v_count = ROW_COUNT;
RAISE NOTICE 'Removed % previous AD_User_Record_Access records', v_count;
--
--
INSERT INTO ad_user_record_access ( --
ad_table_id, --
record_id, --
--
access, --
--
-- ad_usergroup_id, --
ad_user_id, --
PermissionIssuer,
--
-- validfrom, validto --
ad_client_id, --
ad_org_id, --
isactive,
created, createdby, updated, updatedby,
--
ad_user_record_access_id, parent_id, root_id)
SELECT a.ad_table_id AS ad_table_id,
a.record_id AS record_id,
a.access AS access,
a.ad_user_id AS ad_user_id,
'AUTO_BP_HIERARCHY' AS permissionissuer,
--
1000000 AS ad_client_id,
0 AS AD_Org_ID,
'Y' AS IsActive,
NOW() AS created,
99 AS createdby,
NOW() AS updatedby,
99 AS updated,
--
a.id AS ad_user_record_access_id,
a.parent_id AS parent_id,
a.root_id AS root_id
FROM TMP_RecordsToGrantAccess a;
GET DIAGNOSTICS v_count = ROW_COUNT;
RAISE NOTICE 'Inserted % AD_User_Record_Access records', v_count;
END;
$$
;
-- alter function ad_user_record_access_updatefrom_bpartnerhierarchy() owner to metasfresh;
-- Test
/*
select ad_user_record_access_updatefrom_bpartnerhierarchy();
*/ | the_stack |
--
-- Name: git_host_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.git_host_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: git_host; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.git_host (
id INTEGER NOT NULL DEFAULT nextval('git_host_id_seq'::regclass),
name character varying(250) NOT NULL,
active bool NOT NULL,
webhook_url character varying(500),
webhook_secret character varying(250),
event_type_header character varying(250),
secret_header character varying(250),
secret_validator character varying(250),
created_on timestamptz NOT NULL,
created_by INTEGER NOT NULL,
updated_on timestamptz,
updated_by INTEGER,
PRIMARY KEY ("id"),
UNIQUE(name)
);
---- Insert master data into git_host
INSERT INTO git_host (name, created_on, created_by, active, webhook_url, webhook_secret, event_type_header, secret_header, secret_validator)
VALUES ('Github', NOW(), 1, 't', '/orchestrator/webhook/git/1', MD5(random()::text), 'X-GitHub-Event', 'X-Hub-Signature' , 'SHA-1'),
('Bitbucket Cloud', NOW(), 1, 't', '/orchestrator/webhook/git/2/' || MD5(random()::text), NULL, 'X-Event-Key', NULL, 'URL_APPEND');
---- add column in git_provider (git_host.id)
ALTER TABLE git_provider
ADD COLUMN git_host_id INTEGER;
---- Add Foreign key constraint on git_host_id in Table git_provider
ALTER TABLE git_provider
ADD CONSTRAINT git_host_id_fkey FOREIGN KEY (git_host_id) REFERENCES public.git_host(id);
---- update notification template for CI trigger stack
UPDATE notification_templates
set template_payload = '{
"text": ":arrow_forward: Build pipeline Triggered | {{#ciMaterials}} Branch > {{branch}} {{/ciMaterials}} | Application > {{appName}}",
"blocks": [{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "\n"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":arrow_forward: *Build Pipeline triggered*\n{{eventTime}} \n Triggered by {{triggeredBy}}"
},
"accessory": {
"type": "image",
"image_url": "https://github.com/devtron-labs/notifier/assets/image/img_build_notification.png",
"alt_text": "calendar thumbnail"
}
},
{
"type": "section",
"fields": [{
"type": "mrkdwn",
"text": "*Application*\n{{appName}}"
},
{
"type": "mrkdwn",
"text": "*Pipeline*\n{{pipelineName}}"
}
]
},
{{#ciMaterials}}
{{^webhookType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Branch*\n`{{appName}}/{{branch}}`"
},
{
"type": "mrkdwn",
"text": "*Commit*\n<{{& commitLink}}|{{commit}}>"
}
]
},
{{/webhookType}}
{{#webhookType}}
{{#webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Title*\n{{webhookData.data.title}}"
},
{
"type": "mrkdwn",
"text": "*Git URL*\n<{{& webhookData.data.giturl}}|View>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Source Branch*\n{{webhookData.data.sourcebranchname}}"
},
{
"type": "mrkdwn",
"text": "*Source Commit*\n<{{& webhookData.data.sourcecheckoutlink}}|{{webhookData.data.sourcecheckout}}>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Branch*\n{{webhookData.data.targetbranchname}}"
},
{
"type": "mrkdwn",
"text": "*Target Commit*\n<{{& webhookData.data.targetcheckoutlink}}|{{webhookData.data.targetcheckout}}>"
}
]
},
{{/webhookData.mergedType}}
{{^webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Checkout*\n{{webhookData.data.targetcheckout}}"
}
]
},
{{/webhookData.mergedType}}
{{/webhookType}}
{{/ciMaterials}}
{
"type": "actions",
"elements": [{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Details"
}
{{#buildHistoryLink}}
,
"url": "{{& buildHistoryLink}}"
{{/buildHistoryLink}}
}]
}
]
}'
where channel_type = 'slack'
and node_type = 'CI'
and event_type_id = 1;
---- update notification template for CI success stack
UPDATE notification_templates
set template_payload = '{
"text": ":tada: Build pipeline Successful | {{#ciMaterials}} Branch > {{branch}} {{/ciMaterials}} | Application > {{appName}}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "\n"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":tada: *Build Pipeline successful*\n{{eventTime}} \n Triggered by {{triggeredBy}}"
},
"accessory": {
"type": "image",
"image_url": "https://github.com/devtron-labs/notifier/assets/image/img_build_notification.png",
"alt_text": "calendar thumbnail"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Application*\n{{appName}}"
},
{
"type": "mrkdwn",
"text": "*Pipeline*\n{{pipelineName}}"
}
]
},
{{#ciMaterials}}
{{^webhookType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Branch*\n`{{appName}}/{{branch}}`"
},
{
"type": "mrkdwn",
"text": "*Commit*\n<{{& commitLink}}|{{commit}}>"
}
]
},
{{/webhookType}}
{{#webhookType}}
{{#webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Title*\n{{webhookData.data.title}}"
},
{
"type": "mrkdwn",
"text": "*Git URL*\n<{{& webhookData.data.giturl}}|View>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Source Branch*\n{{webhookData.data.sourcebranchname}}"
},
{
"type": "mrkdwn",
"text": "*Source Commit*\n<{{& webhookData.data.sourcecheckoutlink}}|{{webhookData.data.sourcecheckout}}>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Branch*\n{{webhookData.data.targetbranchname}}"
},
{
"type": "mrkdwn",
"text": "*Target Commit*\n<{{& webhookData.data.targetcheckoutlink}}|{{webhookData.data.targetcheckout}}>"
}
]
},
{{/webhookData.mergedType}}
{{^webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Checkout*\n{{webhookData.data.targetcheckout}}"
}
]
},
{{/webhookData.mergedType}}
{{/webhookType}}
{{/ciMaterials}}
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Details"
}
{{#buildHistoryLink}}
,
"url": "{{& buildHistoryLink}}"
{{/buildHistoryLink}}
}
]
}
]
}'
where channel_type = 'slack'
and node_type = 'CI'
and event_type_id = 2;
---- update notification template for CI fail stack
UPDATE notification_templates
set template_payload = '{
"text": ":x: Build pipeline Failed | {{#ciMaterials}} Branch > {{branch}} {{/ciMaterials}} | Application > {{appName}}",
"blocks": [{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "\n"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":x: *Build Pipeline failed*\n{{eventTime}} \n Triggered by {{triggeredBy}}"
},
"accessory": {
"type": "image",
"image_url": "https://github.com/devtron-labs/notifier/assets/image/img_build_notification.png",
"alt_text": "calendar thumbnail"
}
},
{
"type": "section",
"fields": [{
"type": "mrkdwn",
"text": "*Application*\n{{appName}}"
},
{
"type": "mrkdwn",
"text": "*Pipeline*\n{{pipelineName}}"
}
]
},
{{#ciMaterials}}
{{^webhookType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Branch*\n`{{appName}}/{{branch}}`"
},
{
"type": "mrkdwn",
"text": "*Commit*\n<{{& commitLink}}|{{commit}}>"
}
]
},
{{/webhookType}}
{{#webhookType}}
{{#webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Title*\n{{webhookData.data.title}}"
},
{
"type": "mrkdwn",
"text": "*Git URL*\n<{{& webhookData.data.giturl}}|View>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Source Branch*\n{{webhookData.data.sourcebranchname}}"
},
{
"type": "mrkdwn",
"text": "*Source Commit*\n<{{& webhookData.data.sourcecheckoutlink}}|{{webhookData.data.sourcecheckout}}>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Branch*\n{{webhookData.data.targetbranchname}}"
},
{
"type": "mrkdwn",
"text": "*Target Commit*\n<{{& webhookData.data.targetcheckoutlink}}|{{webhookData.data.targetcheckout}}>"
}
]
},
{{/webhookData.mergedType}}
{{^webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Checkout*\n{{webhookData.data.targetcheckout}}"
}
]
},
{{/webhookData.mergedType}}
{{/webhookType}}
{{/ciMaterials}}
{
"type": "actions",
"elements": [{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Details"
}
{{#buildHistoryLink}}
,
"url": "{{& buildHistoryLink}}"
{{/buildHistoryLink}}
}]
}
]
}'
where channel_type = 'slack'
and node_type = 'CI'
and event_type_id = 3;
---- update notification template for CD trigger stack
UPDATE notification_templates
set template_payload = '{
"text": ":arrow_forward: Deployment pipeline Triggered | {{#ciMaterials}} Branch > {{branch}} {{/ciMaterials}} | Application > {{appName}}",
"blocks": [{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "\n"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":arrow_forward: *Deployment Pipeline triggered on {{envName}}*\n{{eventTime}} \n by {{triggeredBy}}"
},
"accessory": {
"type": "image",
"image_url":"https://github.com/devtron-labs/notifier/assets/image/img_deployment_notification.png",
"alt_text": "Deploy Pipeline Triggered"
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [{
"type": "mrkdwn",
"text": "*Application*\n{{appName}}\n*Pipeline*\n{{pipelineName}}"
},
{
"type": "mrkdwn",
"text": "*Environment*\n{{envName}}\n*Stage*\n{{stage}}"
}
]
},
{{#ciMaterials}}
{{^webhookType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Branch*\n`{{appName}}/{{branch}}`"
},
{
"type": "mrkdwn",
"text": "*Commit*\n<{{& commitLink}}|{{commit}}>"
}
]
},
{{/webhookType}}
{{#webhookType}}
{{#webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Title*\n{{webhookData.data.title}}"
},
{
"type": "mrkdwn",
"text": "*Git URL*\n<{{& webhookData.data.giturl}}|View>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Source Branch*\n{{webhookData.data.sourcebranchname}}"
},
{
"type": "mrkdwn",
"text": "*Source Commit*\n<{{& webhookData.data.sourcecheckoutlink}}|{{webhookData.data.sourcecheckout}}>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Branch*\n{{webhookData.data.targetbranchname}}"
},
{
"type": "mrkdwn",
"text": "*Target Commit*\n<{{& webhookData.data.targetcheckoutlink}}|{{webhookData.data.targetcheckout}}>"
}
]
},
{{/webhookData.mergedType}}
{{^webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Checkout*\n{{webhookData.data.targetcheckout}}"
}
]
},
{{/webhookData.mergedType}}
{{/webhookType}}
{{/ciMaterials}}
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Docker Image*\n`{{dockerImg}}`"
}
},
{
"type": "actions",
"elements": [{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Pipeline",
"emoji": true
}
{{#deploymentHistoryLink}}
,
"url": "{{& deploymentHistoryLink}}"
{{/deploymentHistoryLink}}
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "App details",
"emoji": true
}
{{#appDetailsLink}}
,
"url": "{{& appDetailsLink}}"
{{/appDetailsLink}}
}
]
}
]
}'
where channel_type = 'slack'
and node_type = 'CD'
and event_type_id = 1;
---- update notification template for CD success stack
UPDATE notification_templates
set template_payload = '{
"text": ":tada: Deployment pipeline Successful | {{#ciMaterials}} Branch > {{branch}} {{/ciMaterials}} | Application > {{appName}}",
"blocks": [{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "\n"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":tada: *Deployment Pipeline successful on {{envName}}*\n{{eventTime}} \n by {{triggeredBy}}"
},
"accessory": {
"type": "image",
"image_url":"https://github.com/devtron-labs/notifier/assets/image/img_deployment_notification.png",
"alt_text": "calendar thumbnail"
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [{
"type": "mrkdwn",
"text": "*Application*\n{{appName}}\n*Pipeline*\n{{pipelineName}}"
},
{
"type": "mrkdwn",
"text": "*Environment*\n{{envName}}\n*Stage*\n{{stage}}"
}
]
},
{{#ciMaterials}}
{{^webhookType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Branch*\n`{{appName}}/{{branch}}`"
},
{
"type": "mrkdwn",
"text": "*Commit*\n<{{& commitLink}}|{{commit}}>"
}
]
},
{{/webhookType}}
{{#webhookType}}
{{#webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Title*\n{{webhookData.data.title}}"
},
{
"type": "mrkdwn",
"text": "*Git URL*\n<{{& webhookData.data.giturl}}|View>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Source Branch*\n{{webhookData.data.sourcebranchname}}"
},
{
"type": "mrkdwn",
"text": "*Source Commit*\n<{{& webhookData.data.sourcecheckoutlink}}|{{webhookData.data.sourcecheckout}}>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Branch*\n{{webhookData.data.targetbranchname}}"
},
{
"type": "mrkdwn",
"text": "*Target Commit*\n<{{& webhookData.data.targetcheckoutlink}}|{{webhookData.data.targetcheckout}}>"
}
]
},
{{/webhookData.mergedType}}
{{^webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Checkout*\n{{webhookData.data.targetcheckout}}"
}
]
},
{{/webhookData.mergedType}}
{{/webhookType}}
{{/ciMaterials}}
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Docker Image*\n`{{dockerImg}}`"
}
},
{
"type": "actions",
"elements": [{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Pipeline",
"emoji": true
}
{{#deploymentHistoryLink}}
,
"url": "{{& deploymentHistoryLink}}"
{{/deploymentHistoryLink}}
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "App details",
"emoji": true
}
{{#appDetailsLink}}
,
"url": "{{& appDetailsLink}}"
{{/appDetailsLink}}
}
]
}
]
}'
where channel_type = 'slack'
and node_type = 'CD'
and event_type_id = 2;
---- update notification template for CD fail stack
UPDATE notification_templates
set template_payload = '{
"text": ":x: Deployment pipeline Failed | {{#ciMaterials}} Branch > {{branch}} {{/ciMaterials}} | Application > {{appName}}",
"blocks": [{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "\n"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":x: *Deployment Pipeline failed on {{envName}}*\n{{eventTime}} \n by {{triggeredBy}}"
},
"accessory": {
"type": "image",
"image_url":"https://github.com/devtron-labs/notifier/assets/image/img_deployment_notification.png",
"alt_text": "calendar thumbnail"
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [{
"type": "mrkdwn",
"text": "*Application*\n{{appName}}\n*Pipeline*\n{{pipelineName}}"
},
{
"type": "mrkdwn",
"text": "*Environment*\n{{envName}}\n*Stage*\n{{stage}}"
}
]
},
{{#ciMaterials}}
{{^webhookType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Branch*\n`{{appName}}/{{branch}}`"
},
{
"type": "mrkdwn",
"text": "*Commit*\n<{{& commitLink}}|{{commit}}>"
}
]
},
{{/webhookType}}
{{#webhookType}}
{{#webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Title*\n{{webhookData.data.title}}"
},
{
"type": "mrkdwn",
"text": "*Git URL*\n<{{& webhookData.data.giturl}}|View>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Source Branch*\n{{webhookData.data.sourcebranchname}}"
},
{
"type": "mrkdwn",
"text": "*Source Commit*\n<{{& webhookData.data.sourcecheckoutlink}}|{{webhookData.data.sourcecheckout}}>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Branch*\n{{webhookData.data.targetbranchname}}"
},
{
"type": "mrkdwn",
"text": "*Target Commit*\n<{{& webhookData.data.targetcheckoutlink}}|{{webhookData.data.targetcheckout}}>"
}
]
},
{{/webhookData.mergedType}}
{{^webhookData.mergedType}}
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Target Checkout*\n{{webhookData.data.targetcheckout}}"
}
]
},
{{/webhookData.mergedType}}
{{/webhookType}}
{{/ciMaterials}}
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Docker Image*\n`{{dockerImg}}`"
}
},
{
"type": "actions",
"elements": [{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Pipeline",
"emoji": true
}
{{#deploymentHistoryLink}}
,
"url": "{{& deploymentHistoryLink}}"
{{/deploymentHistoryLink}}
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "App details",
"emoji": true
}
{{#appDetailsLink}}
,
"url": "{{& appDetailsLink}}"
{{/appDetailsLink}}
}
]
}
]
}'
where channel_type = 'slack'
and node_type = 'CD'
and event_type_id = 3; | the_stack |
--####################################################################
--Peter Magnusson provided the script to create SqlLite version of the Northwind test DB - thanks!
--####################################################################
CREATE TABLE IF NOT EXISTS [Regions] (
[RegionID] INTEGER PRIMARY KEY NOT NULL,
[RegionDescription] VARCHAR(50) NOT NULL
);
CREATE TABLE IF NOT EXISTS [Territories] (
[TerritoryID] VARCHAR(20) NOT NULL,
[TerritoryDescription] VARCHAR(50) NOT NULL,
[RegionID] INTEGER NOT NULL REFERENCES Regions(RegionID),
PRIMARY KEY([TerritoryID])
);
--####################################################################
CREATE TABLE IF NOT EXISTS [Categories] (
[CategoryID] INTEGER NOT NULL ,
[CategoryName] VARCHAR(15) NOT NULL,
[Description] TEXT NULL,
[Picture] BLOB NULL,
PRIMARY KEY([CategoryID])
);
CREATE TABLE IF NOT EXISTS [Suppliers] (
[SupplierID] INTEGER NOT NULL ,
[CompanyName] VARCHAR(40) NOT NULL DEFAULT '',
[ContactName] VARCHAR(30) NULL,
[ContactTitle] VARCHAR(30) NULL,
[Address] VARCHAR(60) NULL,
[City] VARCHAR(15) NULL,
[Region] VARCHAR(15) NULL,
[PostalCode] VARCHAR(10) NULL,
[Country] VARCHAR(15) NULL,
[Phone] VARCHAR(24) NULL,
[Fax] VARCHAR(24) NULL,
PRIMARY KEY([SupplierID])
);
--####################################################################
CREATE TABLE IF NOT EXISTS [Products] (
[ProductID] INTEGER NOT NULL ,
[ProductName] VARCHAR(40) NOT NULL DEFAULT '' COLLATE NOCASE,
[SupplierID] INTEGER NULL REFERENCES Suppliers(SupplierID),
[CategoryID] INTEGER NULL,
[QuantityPerUnit] VARCHAR(20) NULL,
[UnitPrice] DECIMAL NULL,
[UnitsInStock] SMALLINT NULL,
[UnitsOnOrder] SMALLINT NULL,
[ReorderLevel] SMALLINT NULL,
[Discontinued] BIT NOT NULL,
PRIMARY KEY([ProductID])
);
--####################################################################
CREATE TABLE IF NOT EXISTS [Customers] (
[CustomerID] VARCHAR(5) NOT NULL,
[CompanyName] VARCHAR(40) NOT NULL DEFAULT '',
[ContactName] VARCHAR(30) NULL,
[ContactTitle] VARCHAR(30) NULL,
[Address] VARCHAR(60) NULL,
[City] VARCHAR(15) NULL,
[Region] VARCHAR(15) NULL,
[PostalCode] VARCHAR(10) NULL,
[Country] VARCHAR(15) NULL,
[Phone] VARCHAR(24) NULL,
[Fax] VARCHAR(24) NULL,
PRIMARY KEY([CustomerID])
);
--####################################################################
CREATE TABLE IF NOT EXISTS [Shippers] (
[ShipperID] INTEGER NOT NULL ,
[CompanyName] VARCHAR(40) NOT NULL,
[Phone] VARCHAR(24) NULL,
PRIMARY KEY([ShipperID])
);
--####################################################################
CREATE TABLE IF NOT EXISTS [Employees] (
[EmployeeID] INTEGER NOT NULL ,
[LastName] VARCHAR(20) NOT NULL,
[FirstName] VARCHAR(10) NOT NULL,
[Title] VARCHAR(30) NULL,
[BirthDate] DATETIME NULL,
[HireDate] DATETIME NULL,
[Address] VARCHAR(60) NULL,
[City] VARCHAR(15) NULL,
[Region] VARCHAR(15) NULL,
[PostalCode] VARCHAR(10) NULL,
[Country] VARCHAR(15) NULL,
[HomePhone] VARCHAR(24) NULL,
[Photo] BLOB NULL,
[Notes] TEXT NULL,
[TitleOfCourtesy] VARCHAR(25) NULL,
[PhotoPath] VARCHAR (255) NULL,
[Extension] VARCHAR(5) NULL,
[ReportsTo] INTEGER NULL REFERENCES Employees(EmployeeID),
PRIMARY KEY([EmployeeID])
);
--####################################################################
CREATE TABLE IF NOT EXISTS [EmployeeTerritories] (
[EmployeeID] INTEGER NOT NULL REFERENCES Employees(EmployeeID),
[TerritoryID] VARCHAR(20) NOT NULL REFERENCES Territories(TerritoryID),
PRIMARY KEY([EmployeeID],[TerritoryID])
);
--####################################################################
CREATE TABLE IF NOT EXISTS [Orders] (
[OrderID] INTEGER NOT NULL ,
[CustomerID] VARCHAR(5) NULL CONSTRAINT fk_customer_id REFERENCES Customers(CustomerID),
[EmployeeID] INTEGER NULL CONSTRAINT fk_employee_id REFERENCES Employees(EmployeeID),
[OrderDate] DATETIME NULL,
[RequiredDate] DATETIME NULL,
[ShippedDate] DATETIME NULL,
[ShipVia] INT NULL,
[Freight] DECIMAL NULL,
[ShipName] VARCHAR(40) NULL,
[ShipAddress] VARCHAR(60) NULL,
[ShipCity] VARCHAR(15) NULL,
[ShipRegion] VARCHAR(15) NULL,
[ShipPostalCode] VARCHAR(10) NULL,
[ShipCountry] VARCHAR(15) NULL,
PRIMARY KEY([OrderID])
);
-- Foreign Key Preventing insert
CREATE TRIGGER IF NOT EXISTS fki_Orders_CustomerID_Customers_CustomerID
BEFORE INSERT ON [Orders]
FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'insert on table "Orders" violates foreign key constraint "fki_Orders_CustomerID_Customers_CustomerID"')
WHERE NEW.CustomerID IS NOT NULL AND (SELECT [CustomerID] FROM [Customers] WHERE [CustomerID] = NEW.CustomerID) IS NULL;
END;
-- Foreign key preventing update
CREATE TRIGGER IF NOT EXISTS fku_Orders_CustomerID_Customers_CustomerID
BEFORE UPDATE ON [Orders]
FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'update on table "Orders" violates foreign key constraint "fku_Orders_CustomerID_Customers_CustomerID"')
WHERE NEW.CustomerID IS NOT NULL AND (SELECT [CustomerID] FROM [Customers] WHERE [CustomerID] = NEW.CustomerID) IS NULL;
END;
-- Foreign key preventing delete
CREATE TRIGGER IF NOT EXISTS fkd_Orders_CustomerID_Customers_CustomerID
BEFORE DELETE ON [Customers]
FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'delete on table "[Customers]" violates foreign key constraint "fkd_Orders_CustomerID_Customers_CustomerID"')
WHERE (SELECT CustomerID FROM Orders WHERE CustomerID = OLD.[CustomerID]) IS NOT NULL;
END;
-- Foreign Key Preventing insert
CREATE TRIGGER IF NOT EXISTS fki_Orders_EmployeeID_Employees_EmployeeID
BEFORE INSERT ON [Orders]
FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'insert on table "Orders" violates foreign key constraint "fki_Orders_EmployeeID_Employees_EmployeeID"')
WHERE NEW.EmployeeID IS NOT NULL AND (SELECT [EmployeeID] FROM [Employees] WHERE [EmployeeID] = NEW.EmployeeID) IS NULL;
END;
-- Foreign key preventing update
CREATE TRIGGER IF NOT EXISTS fku_Orders_EmployeeID_Employees_EmployeeID
BEFORE UPDATE ON [Orders]
FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'update on table "Orders" violates foreign key constraint "fku_Orders_EmployeeID_Employees_EmployeeID"')
WHERE NEW.EmployeeID IS NOT NULL AND (SELECT [EmployeeID] FROM [Employees] WHERE [EmployeeID] = NEW.EmployeeID) IS NULL;
END;
-- Foreign key preventing delete
CREATE TRIGGER IF NOT EXISTS fkd_Orders_EmployeeID_Employees_EmployeeID
BEFORE DELETE ON [Employees]
FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'delete on table "[Employees]" violates foreign key constraint "fkd_Orders_EmployeeID_Employees_EmployeeID"')
WHERE (SELECT EmployeeID FROM Orders WHERE EmployeeID = OLD.[EmployeeID]) IS NOT NULL;
END;
--####################################################################
CREATE TABLE IF NOT EXISTS [Order Details] (
[OrderID] INTEGER NOT NULL REFERENCES Orders (OrderID),
[ProductID] INTEGER NOT NULL REFERENCES Products (ProductID),
[UnitPrice] DECIMAL NOT NULL,
[Quantity] SMALLINT NOT NULL,
[Discount] FLOAT NOT NULL,
PRIMARY KEY([OrderID],[ProductID])
);
--####################################################################
--## populate tables with seed data
--####################################################################
DELETE FROM [Categories];
Insert INTO [Categories] (CategoryName,Description)
values ('Beverages', 'Soft drinks, coffees, teas, beers, and ales');
Insert INTO [Categories] (CategoryName,Description)
values ('Condiments','Sweet and savory sauces, relishes, spreads, and seasonings');
Insert INTO [Categories] (CategoryName,Description)
values ('Seafood','Seaweed and fish');
INSERT INTO Regions (RegionDescription) VALUES ('North America');
INSERT INTO Regions (RegionDescription) VALUES ('Europe');
DELETE FROM EmployeeTerritories; -- must be truncated before Territories
DELETE FROM Territories;
INSERT INTO Territories (TerritoryID,TerritoryDescription, RegionID) VALUES ('US.Northwest', 'Northwest', 1);
DELETE FROM [Orders]; -- must be truncated before Customer
DELETE FROM [Customers];
insert INTO [Customers] (CustomerID, CompanyName,ContactName,Country,PostalCode,City)
values ('AIRBU', 'airbus','jacques','France','10000','Paris');
insert INTO [Customers] (CustomerID, CompanyName,ContactName,Country,PostalCode,City)
values ('BT___','BT','graeme','U.K.','E14','London');
insert INTO [Customers] (CustomerID, CompanyName,ContactName,Country,PostalCode,City)
values ('ATT__','ATT','bob','USA','10021','New York');
insert INTO [Customers] (CustomerID, CompanyName,ContactName,Country,PostalCode,City)
values ('UKMOD', 'MOD','(secret)','U.K.','E14','London');
insert INTO [Customers] (CustomerID, CompanyName,ContactName, ContactTitle, Country,PostalCode,City, Phone)
values ('ALFKI', 'Alfreds Futterkiste','Maria Anders','Sales Representative','Germany','12209','Berlin','030-0074321');
insert INTO [Customers] (CustomerID, CompanyName,ContactName, ContactTitle, Country,PostalCode,Address,City, Phone, Fax)
values ('BONAP', 'Bon app''','Laurence Lebihan','Owner','France','13008','12, rue des Bouchers','Marseille','91.24.45.40', '91.24.45.41');
insert INTO [Customers] (CustomerID, CompanyName,ContactName, ContactTitle, Country,PostalCode,City, Phone)
values ('WARTH', 'Wartian Herkku','Pirkko Koskitalo','Accounting Manager','Finland','90110','Oulu','981-443655');
DELETE FROM [Orders]; -- must be truncated before Products
DELETE FROM [Products];
DELETE FROM [Suppliers];
insert INTO Suppliers (CompanyName, ContactName, ContactTitle, Address, City, Region, Country)
VALUES ('alles AG', 'Harald Reitmeyer', 'Prof', 'Fischergasse 8', 'Heidelberg', 'B-W', 'Germany');
insert INTO Suppliers (CompanyName, ContactName, ContactTitle, Address, City, Region, Country)
VALUES ('Microsoft', 'Mr Allen', 'Monopolist', '1 MS', 'Redmond', 'WA', 'USA');
INSERT INTO Suppliers (CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax)
VALUES ('Pavlova, Ltd.', 'Ian Devling', 'Marketing Manager', '74 Rose St. Moonie Ponds', 'Melbourne', 'Victoria', '3058', 'Australia', '(03) 444-2343', '(03) 444-6588');
--## (OLD WARNING: this actually inserts two 'Pen' rows into Products.)
--## could someone with knowledge of MySQL resolve this?
--## Answer: upgrade to newer version of MySql Query Browser - the problem will go away
insert INTO [Products] (ProductName,SupplierID, QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Pen',1, 10, 12, 2, 0);
insert INTO [Products] (ProductName,SupplierID, QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Bicycle',1, 1, 6, 0, 0);
insert INTO [Products] (ProductName,QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Phone',3, 7, 0, 0);
insert INTO [Products] (ProductName,QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('SAM',1, 51, 11, 0);
insert INTO [Products] (ProductName,QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('iPod',0, 11, 0, 0);
insert INTO [Products] (ProductName,QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Toilet Paper',2, 0, 3, 1);
insert INTO [Products] (ProductName,QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Fork',5, 111, 0, 0);
insert INTO [Products] (ProductName,SupplierID, QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Linq Book',2, 1, 0, 26, 0);
INSERT INTO [Products] (ProductName,SupplierID, QuantityPerUnit,UnitPrice, UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Carnarvon Tigers', 3,'16 kg pkg.',62.50, 42, 0, 0);
DELETE FROM [Employees];
insert INTO [Employees] (LastName,FirstName,Title,BirthDate,HireDate,Address,City,ReportsTo,Country,HomePhone)
VALUES ('Fuller','Andrew','Vice President, Sales','19540101','19890101', '908 W. Capital Way','Tacoma',NULL,'USA','(111)222333');
insert INTO [Employees] (LastName,FirstName,Title,BirthDate,HireDate,Address,City,ReportsTo,Country,HomePhone)
VALUES ('Davolio','Nancy','Sales Representative','19640101','19940101','507 - 20th Ave. E. Apt. 2A','Seattle',1,'USA','(444)555666');
insert INTO [Employees] (LastName,FirstName,Title,BirthDate,HireDate,Address,City,ReportsTo,Country,HomePhone)
VALUES ('Builder','Bob','Handyman','19640101','19940101','666 dark street','Seattle',2,'USA','(777)888999');
insert into employeeTerritories (EmployeeID,TerritoryID)
values (2,'US.Northwest');
--####################################################################
DELETE FROM [Orders];
insert INTO [Orders] (CustomerID, EmployeeID, OrderDate, Freight)
Values ('AIRBU', 1, '2007-12-14', 21.3);
insert INTO [Orders] (CustomerID, EmployeeID, OrderDate, Freight)
Values ('BT___', 1, '2007-12-15', 11.1);
insert INTO [Orders] (CustomerID, EmployeeID, OrderDate, Freight)
Values ('BT___', 1, '2007-12-16', 11.5);
insert INTO [Orders] (CustomerID, EmployeeID, OrderDate, Freight)
Values ('UKMOD', 1, '2007-12-17', 32.5);
insert INTO [Orders] (CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, Freight, ShipName, ShipAddress, ShipCity, ShipCountry)
Values ('BONAP', 1, '1996-10-16', '1996-11-27', '1996-10-21', 10.21, 'Bon app''', '12, rue des Bouchers', 'Marseille', 'France' );
INSERT INTO [Order Details] (OrderID, ProductID, UnitPrice, Quantity, Discount)
VALUES (1,2, 33, 5, 11);
INSERT INTO [Order Details] (OrderID, ProductID, UnitPrice, Quantity, Discount)
VALUES (5,9, 50, 20, 0.05); --## CanarvonTigers for customer BONAP | the_stack |
-- 2017-10-18T10:26:53.695
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_RelationType (AD_Client_ID,AD_Org_ID,AD_Reference_Source_ID,AD_Reference_Target_ID,AD_RelationType_ID,Created,CreatedBy,EntityType,IsActive,IsDirected,Name,Updated,UpdatedBy) VALUES (0,0,540676,540677,540191,TO_TIMESTAMP('2017-10-18 10:26:53','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','Y','C_Order -> C_Flatrate_Term',TO_TIMESTAMP('2017-10-18 10:26:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-18T10:28:06.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540754,TO_TIMESTAMP('2017-10-18 10:28:06','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','N','C_Order_C_Flatrate_Term',TO_TIMESTAMP('2017-10-18 10:28:06','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 2017-10-18T10:28:06.838
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540754 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-10-18T10:29:18.106
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,2169,2161,0,540754,259,143,TO_TIMESTAMP('2017-10-18 10:29:18','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','N',TO_TIMESTAMP('2017-10-18 10:29:18','YYYY-MM-DD HH24:MI:SS'),100,'IsSOTrx = ''Y''')
;
-- 2017-10-18T10:29:30.246
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Source_ID=540754,Updated=TO_TIMESTAMP('2017-10-18 10:29:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540191
;
-- 2017-10-18T10:30:43.414
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540755,TO_TIMESTAMP('2017-10-18 10:30:43','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','N','C_Flatrate_Term_For_C_Order',TO_TIMESTAMP('2017-10-18 10:30:43','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 2017-10-18T10:30:43.418
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540755 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-10-18T10:35:40.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy) VALUES (0,557170,545802,0,540755,540320,540359,TO_TIMESTAMP('2017-10-18 10:35:40','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','N',TO_TIMESTAMP('2017-10-18 10:35:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-18T10:50:49.560
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='exists(
SELECT 1
FROM C_Flatrate_Term ft
JOIN C_OrderLine ol on ft.C_OrderLine_Term_ID = ol.C_OrderLine_ID
JOIN C_Order o on ol.C_Order_ID = o.C_Order_ID
WHERE
o.C_Order_ID = @C_Order_ID/-1@
)',Updated=TO_TIMESTAMP('2017-10-18 10:50:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540755
;
-- 2017-10-18T10:51:00.183
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Target_ID=540755,Updated=TO_TIMESTAMP('2017-10-18 10:51:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540191
;
-- 2017-10-18T10:51:06.621
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET Name='C_Order <-> C_Flatrate_Term',Updated=TO_TIMESTAMP('2017-10-18 10:51:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540191
;
-- 2017-10-18T10:52:46.028
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET Name='C_Order -> C_Flatrate_Term',Updated=TO_TIMESTAMP('2017-10-18 10:52:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540191
;
-- 2017-10-18T10:57:34.711
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='exists(
SELECT 1
FROM C_Flatrate_Term ft
JOIN C_OrderLine ol on ft.C_OrderLine_Term_ID = ol.C_OrderLine_ID
JOIN C_Order o on ol.C_Order_ID = o.C_Order_ID
WHERE
o.C_Order_ID = @C_Order_ID/-1@
and AND ft.C_Flatrate_Term_ID = C_Flatrate_Term.C_Flatrate_Term_ID
)',Updated=TO_TIMESTAMP('2017-10-18 10:57:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540755
;
-- 2017-10-18T10:59:01.309
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='exists(
SELECT 1
FROM C_Flatrate_Term ft
JOIN C_OrderLine ol on ft.C_OrderLine_Term_ID = ol.C_OrderLine_ID
JOIN C_Order o on ol.C_Order_ID = o.C_Order_ID
WHERE
o.C_Order_ID = @C_Order_ID/-1@
AND ft.C_Flatrate_Term_ID = C_Flatrate_Term.C_Flatrate_Term_ID
)',Updated=TO_TIMESTAMP('2017-10-18 10:59:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540755
;
---------------------------------------------
-- 2017-10-18T16:24:34.611
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_RelationType (AD_Client_ID,AD_Org_ID,AD_Reference_Source_ID,AD_Reference_Target_ID,AD_RelationType_ID,Created,CreatedBy,EntityType,IsActive,IsDirected,Name,Updated,UpdatedBy) VALUES (0,0,540754,540755,540192,TO_TIMESTAMP('2017-10-18 16:24:34','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','Y','C_BPartner -> C_Flatrate_Term',TO_TIMESTAMP('2017-10-18 16:24:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-18T16:25:12.206
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540756,TO_TIMESTAMP('2017-10-18 16:25:12','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','N','C_BPartner_C_Flatrate_Term',TO_TIMESTAMP('2017-10-18 16:25:12','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 2017-10-18T16:25:12.210
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540756 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-10-18T16:26:06.107
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy) VALUES (0,2893,0,540756,291,123,TO_TIMESTAMP('2017-10-18 16:26:06','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','N',TO_TIMESTAMP('2017-10-18 16:26:06','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-18T16:26:14.448
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Source_ID=540756,Updated=TO_TIMESTAMP('2017-10-18 16:26:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540192
;
-- 2017-10-18T16:26:29.040
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540757,TO_TIMESTAMP('2017-10-18 16:26:28','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','N','C_Flatrate_Term_For_C_BPartner',TO_TIMESTAMP('2017-10-18 16:26:28','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 2017-10-18T16:26:29.044
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540757 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-10-18T16:26:57.444
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy) VALUES (0,557170,545802,0,540757,540320,TO_TIMESTAMP('2017-10-18 16:26:57','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts','Y','N',TO_TIMESTAMP('2017-10-18 16:26:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-18T16:27:02.830
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Window_ID=540359,Updated=TO_TIMESTAMP('2017-10-18 16:27:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540757
;
-- 2017-10-18T16:28:13.113
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='exists(
SELECT 1
FROM C_Flatrate_Term ft
WHERE true
ft.C_BPartner_ID = @C_BPartner_ID/-1@
AND ft.C_Flatrate_Term_ID = C_Flatrate_Term.C_Flatrate_Term_ID
)',Updated=TO_TIMESTAMP('2017-10-18 16:28:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540757
;
-- 2017-10-18T16:28:22.999
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Target_ID=540757,Updated=TO_TIMESTAMP('2017-10-18 16:28:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540192
;
-- 2017-10-18T16:31:05.687
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='exists(
SELECT 1
FROM C_Flatrate_Term ft
WHERE true
AND ft.Bill_BPartner_ID = @C_BPartner_ID/-1@
AND ft.C_Flatrate_Term_ID = C_Flatrate_Term.C_Flatrate_Term_ID
)',Updated=TO_TIMESTAMP('2017-10-18 16:31:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540757
; | the_stack |
-- 2017-10-02T12:41:09.350
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy,Value) VALUES (0,0,540424,540512,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'main')
;
-- 2017-10-02T12:41:09.354
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section_Trl (AD_Language,AD_UI_Section_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_UI_Section_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_UI_Section t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_UI_Section_ID=540512 AND NOT EXISTS (SELECT 1 FROM AD_UI_Section_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_UI_Section_ID=t.AD_UI_Section_ID)
;
-- 2017-10-02T12:41:09.410
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540684,540512,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.443
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540685,540512,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.480
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540684,541191,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.539
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550585,0,540424,541191,548963,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Organisatorische Einheit des Mandanten','Eine Organisation ist ein Bereich ihres Mandanten - z.B. Laden oder Abteilung. Sie können Daten über Organisationen hinweg gemeinsam verwenden.','Y','N','Y','Y','N','Sektion',10,10,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.567
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550582,0,540424,541191,548964,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Mahndatensatz-ID',20,20,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.599
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550574,0,540424,541191,548965,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Direct internal record ID','The Record ID is the internal unique identifier of a record. Please note that zooming to the record may not be successful for Orders, Invoices and Shipment/Receipts as sometimes the Sales Order type is not known.','Y','N','Y','Y','N','Datensatz-ID',30,30,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.631
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550575,0,540424,541191,548966,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Database Table information','The Database Table provides the information of the table definition','Y','N','Y','Y','N','DB-Tabelle',40,40,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.661
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550591,0,540424,541191,548967,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Mahnstufe',50,50,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.697
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,557045,0,540424,541191,548968,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Document sequence number of the document','The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>".
If the document type of your document has no automatic document sequence defined, the field is empty if you create a new document. This is for documents which usually have an external number (like vendor invoice). If you leave the field empty, the system will generate a document number for you. The document sequence used for this fallback number is defined in the "Maintain Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table (e.g. C_Order).','Y','N','Y','Y','N','Nr.',60,60,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.743
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550655,0,540424,541191,548969,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Date of Dunning','Y','N','Y','Y','N','Dunning Date',70,70,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.780
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,551735,0,540424,541191,548970,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Effective Date of Dunning','Y','N','Y','Y','N','Dunning Date Effective',80,80,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.820
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550579,0,540424,541191,548971,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Bezeichnet einen Geschäftspartner','Ein Geschäftspartner ist jemand, mit dem Sie interagieren. Dies kann Lieferanten, Kunden, Mitarbeiter oder Handelsvertreter umfassen.','Y','N','Y','Y','N','Geschäftspartner',90,90,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.877
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,550806,0,540214,548971,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.917
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550581,0,540424,541191,548972,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Mahnkontakt',100,100,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.953
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550656,0,540424,541191,548973,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Datum, zu dem Zahlung fällig wird','Datum, zu dem Zahlung ohne Abzüge oder Rabattierung fällig wird.','Y','N','Y','Y','N','Datum Fälligkeit',110,110,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:09.990
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550587,0,540424,541191,548974,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Anzahl der Tage der Fälligkeit (negativ: Fällig in Anzahl Tagen)','Y','N','Y','Y','N','Tage fällig',120,120,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:10.024
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550698,0,540424,541191,548975,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100,'Die Währung für diesen Eintrag','Bezeichnet die auf Dokumenten oder Berichten verwendete Währung','Y','N','Y','Y','N','Währung',130,130,0,TO_TIMESTAMP('2017-10-02 12:41:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:10.058
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550580,0,540424,541191,548976,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100,'Prozentualer Anteil der offenen Summe, der als zusätzliche Mahngebühr ausgewiesen wird.','Y','N','Y','Y','N','Mahnzins',140,140,0,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:10.095
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550578,0,540424,541191,548977,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100,'Pauschale Mahngebühr','The Fee Amount indicates the charge amount on a dunning letter for overdue invoices. This field will only display if the charge fee checkbox has been selected.','Y','N','Y','Y','N','Mahnpauschale',150,150,0,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:10.134
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550584,0,540424,541191,548978,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Offener Betrag',160,160,0,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:10.169
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550588,0,540424,541191,548979,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Gesamtbetrag',170,170,0,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:10.203
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550805,0,540424,541191,548980,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Mahnkarenz',180,180,0,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:10.240
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550589,0,540424,541191,548981,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100,'Checkbox sagt aus, ob der Beleg verarbeitet wurde. ','Verarbeitete Belege dürfen in der Regel nich mehr geändert werden.','Y','N','Y','Y','N','Verarbeitet',190,190,0,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:41:10.277
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550810,0,540424,541191,548982,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','IsDunningDocProcessed',200,200,0,TO_TIMESTAMP('2017-10-02 12:41:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:44:15.813
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540684,541192,TO_TIMESTAMP('2017-10-02 12:44:15','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-10-02 12:44:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:44:36.426
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET Name='advanced edit', SeqNo=90,Updated=TO_TIMESTAMP('2017-10-02 12:44:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=541191
;
-- 2017-10-02T12:46:18.632
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550579,0,540424,541192,548983,'F',TO_TIMESTAMP('2017-10-02 12:46:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Geschäftspartner',10,0,0,TO_TIMESTAMP('2017-10-02 12:46:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:46:25.451
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,550806,0,540215,548983,TO_TIMESTAMP('2017-10-02 12:46:25','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-10-02 12:46:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:46:35.911
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,550581,0,540216,548983,TO_TIMESTAMP('2017-10-02 12:46:35','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-10-02 12:46:35','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:48:33.733
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540685,541193,TO_TIMESTAMP('2017-10-02 12:48:33','YYYY-MM-DD HH24:MI:SS'),100,'Y','flags',10,TO_TIMESTAMP('2017-10-02 12:48:33','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:48:46.175
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550589,0,540424,541193,548984,'F',TO_TIMESTAMP('2017-10-02 12:48:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Verarbeitet',10,0,0,TO_TIMESTAMP('2017-10-02 12:48:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:48:56.885
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550810,0,540424,541193,548985,'F',TO_TIMESTAMP('2017-10-02 12:48:56','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mahnung erstellt',20,0,0,TO_TIMESTAMP('2017-10-02 12:48:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:51:34.616
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,557045,0,540424,541192,548986,'F',TO_TIMESTAMP('2017-10-02 12:51:34','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Nr.',20,0,0,TO_TIMESTAMP('2017-10-02 12:51:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:52:02.765
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550575,0,540424,541192,548987,'F',TO_TIMESTAMP('2017-10-02 12:52:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Tabelle',30,0,0,TO_TIMESTAMP('2017-10-02 12:52:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:52:11.903
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550574,0,540424,541192,548988,'F',TO_TIMESTAMP('2017-10-02 12:52:11','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Datensatz',40,0,0,TO_TIMESTAMP('2017-10-02 12:52:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:52:47.199
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540684,541194,TO_TIMESTAMP('2017-10-02 12:52:47','YYYY-MM-DD HH24:MI:SS'),100,'Y','dunning',20,TO_TIMESTAMP('2017-10-02 12:52:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:53:03.581
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550584,0,540424,541194,548989,'F',TO_TIMESTAMP('2017-10-02 12:53:03','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Offener Betrag',10,0,0,TO_TIMESTAMP('2017-10-02 12:53:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:53:16.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550580,0,540424,541194,548990,'F',TO_TIMESTAMP('2017-10-02 12:53:16','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mahnzins',20,0,0,TO_TIMESTAMP('2017-10-02 12:53:16','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:53:28.187
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550805,0,540424,541194,548991,'F',TO_TIMESTAMP('2017-10-02 12:53:28','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mahnkarenz',30,0,0,TO_TIMESTAMP('2017-10-02 12:53:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:53:43.189
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550588,0,540424,541194,548992,'F',TO_TIMESTAMP('2017-10-02 12:53:43','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Gesamtbetrag',40,0,0,TO_TIMESTAMP('2017-10-02 12:53:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:53:55.258
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550698,0,540424,541194,548993,'F',TO_TIMESTAMP('2017-10-02 12:53:55','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Währung',50,0,0,TO_TIMESTAMP('2017-10-02 12:53:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:54:27.417
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550591,0,540424,541192,548994,'F',TO_TIMESTAMP('2017-10-02 12:54:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mahnstufe',50,0,0,TO_TIMESTAMP('2017-10-02 12:54:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:54:50.611
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540685,541195,TO_TIMESTAMP('2017-10-02 12:54:50','YYYY-MM-DD HH24:MI:SS'),100,'Y','org',30,TO_TIMESTAMP('2017-10-02 12:54:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:55:03.355
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550585,0,540424,541195,548995,'F',TO_TIMESTAMP('2017-10-02 12:55:03','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2017-10-02 12:55:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:55:15.714
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,550583,0,540424,541195,548996,'F',TO_TIMESTAMP('2017-10-02 12:55:15','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',20,0,0,TO_TIMESTAMP('2017-10-02 12:55:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:56:54.089
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548963
;
-- 2017-10-02T12:56:54.128
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548964
;
-- 2017-10-02T12:56:54.143
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548965
;
-- 2017-10-02T12:56:54.155
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548966
;
-- 2017-10-02T12:56:54.170
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548967
;
-- 2017-10-02T12:56:54.181
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548968
;
-- 2017-10-02T12:57:27.972
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548975
;
-- 2017-10-02T12:57:27.983
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548976
;
-- 2017-10-02T12:57:44.949
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548972
;
-- 2017-10-02T12:57:50.898
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548978
;
-- 2017-10-02T12:57:50.911
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548979
;
-- 2017-10-02T12:58:06.802
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548977
;
-- 2017-10-02T12:58:06.812
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548980
;
-- 2017-10-02T12:58:06.830
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548981
;
-- 2017-10-02T12:58:06.841
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548982
;
-- 2017-10-02T12:58:12.688
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementField WHERE AD_UI_ElementField_ID=540214
;
-- 2017-10-02T12:58:16.431
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548971
;
-- 2017-10-02T12:58:44.981
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540685,541196,TO_TIMESTAMP('2017-10-02 12:58:44','YYYY-MM-DD HH24:MI:SS'),100,'Y','dates',20,TO_TIMESTAMP('2017-10-02 12:58:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-10-02T12:59:05.951
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541196, SeqNo=10,Updated=TO_TIMESTAMP('2017-10-02 12:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548973
;
-- 2017-10-02T12:59:23.783
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541194, SeqNo=60,Updated=TO_TIMESTAMP('2017-10-02 12:59:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548974
;
-- 2017-10-02T12:59:34.280
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541196, SeqNo=20,Updated=TO_TIMESTAMP('2017-10-02 12:59:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548970
;
-- 2017-10-02T12:59:42.435
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541196, SeqNo=30,Updated=TO_TIMESTAMP('2017-10-02 12:59:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548969
;
-- 2017-10-02T12:59:46.970
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=541191
;
-- 2017-10-02T13:01:20.196
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541196, SeqNo=40,Updated=TO_TIMESTAMP('2017-10-02 13:01:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548991
;
-- 2017-10-02T13:45:07.060
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-10-02 13:45:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=547399
;
-- 2017-10-02T13:45:09.865
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2017-10-02 13:45:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=547399
;
-- 2017-10-02T13:48:32.582
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-02 13:48:32','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Business Partner',Description='',Help='' WHERE AD_Field_ID=550579 AND AD_Language='en_US'
;
-- 2017-10-02T13:48:51.269
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-02 13:48:51','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Dunning Level' WHERE AD_Field_ID=550591 AND AD_Language='en_US'
;
-- 2017-10-02T13:49:08.037
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-02 13:49:08','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Open Amount' WHERE AD_Field_ID=550584 AND AD_Language='en_US'
;
-- 2017-10-02T13:49:20.853
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-02 13:49:20','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Total Amount' WHERE AD_Field_ID=550588 AND AD_Language='en_US'
;
-- 2017-10-02T13:49:40.701
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-02 13:49:40','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Days Due',Description='' WHERE AD_Field_ID=550587 AND AD_Language='en_US'
;
-- 2017-10-02T13:50:00.030
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-02 13:50:00','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Currency',Description='',Help='' WHERE AD_Field_ID=550698 AND AD_Language='en_US'
;
-- 2017-10-02T13:50:26.942
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-02 13:50:26','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Dunning Interest Amount',Description='' WHERE AD_Field_ID=550580 AND AD_Language='en_US'
;
-- 2017-10-02T13:50:49.791
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-02 13:50:49','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Processed',Description='',Help='' WHERE AD_Field_ID=550589 AND AD_Language='en_US'
;
-- 2017-10-02T13:51:03.919
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Mahnung erstellt',Updated=TO_TIMESTAMP('2017-10-02 13:51:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=550810
;
-- 2017-10-02T13:51:14.095
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-02 13:51:14','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Dunning processed' WHERE AD_Field_ID=550810 AND AD_Language='en_US'
;
-- 2017-10-02T13:51:32.864
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-02 13:51:32','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Due Date',Description='',Help='' WHERE AD_Field_ID=550656 AND AD_Language='en_US'
;
-- 2017-10-02T13:52:19.024
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-02 13:52:19','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Dunning Grace' WHERE AD_Field_ID=550805 AND AD_Language='en_US'
;
-- 2017-10-02T13:53:40.480
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Mahn Datum Effektiv',Updated=TO_TIMESTAMP('2017-10-02 13:53:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551735
;
-- 2017-10-02T13:53:50.186
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Mahn Datum',Updated=TO_TIMESTAMP('2017-10-02 13:53:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=550655
;
-- 2017-10-02T13:54:12.514
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Mahn Datum effektiv',Updated=TO_TIMESTAMP('2017-10-02 13:54:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551735
;
-- 2017-10-02T13:54:22.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Mahndatum effektiv',Updated=TO_TIMESTAMP('2017-10-02 13:54:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551735
;
-- 2017-10-02T13:54:26.747
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Mahndatum',Updated=TO_TIMESTAMP('2017-10-02 13:54:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=550655
;
-- 2017-10-02T13:56:50.933
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548983
;
-- 2017-10-02T13:56:50.935
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548986
;
-- 2017-10-02T13:56:50.938
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548987
;
-- 2017-10-02T13:56:50.940
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548988
;
-- 2017-10-02T13:56:50.941
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548994
;
-- 2017-10-02T13:56:50.943
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548989
;
-- 2017-10-02T13:56:50.945
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548990
;
-- 2017-10-02T13:56:50.948
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548992
;
-- 2017-10-02T13:56:50.950
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548993
;
-- 2017-10-02T13:56:50.951
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548974
;
-- 2017-10-02T13:56:50.952
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548984
;
-- 2017-10-02T13:56:50.954
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548985
;
-- 2017-10-02T13:56:50.955
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548973
;
-- 2017-10-02T13:56:50.956
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548970
;
-- 2017-10-02T13:56:50.957
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548969
;
-- 2017-10-02T13:56:50.959
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548991
;
-- 2017-10-02T13:56:50.960
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=170,Updated=TO_TIMESTAMP('2017-10-02 13:56:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548995
;
-- 2017-10-02T13:57:05.773
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=10,Updated=TO_TIMESTAMP('2017-10-02 13:57:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548983
;
-- 2017-10-02T13:57:05.774
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=20,Updated=TO_TIMESTAMP('2017-10-02 13:57:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548986
;
-- 2017-10-02T13:57:05.775
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=30,Updated=TO_TIMESTAMP('2017-10-02 13:57:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548987
;
-- 2017-10-02T13:57:05.777
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=40,Updated=TO_TIMESTAMP('2017-10-02 13:57:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548995
;
-- 2017-10-02T14:03:32.834
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=20,Updated=TO_TIMESTAMP('2017-10-02 14:03:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=547345
;
-- 2017-10-02T14:03:32.843
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=30,Updated=TO_TIMESTAMP('2017-10-02 14:03:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=554811
;
-- 2017-10-02T14:03:32.847
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=40,Updated=TO_TIMESTAMP('2017-10-02 14:03:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=547608
;
-- 2017-10-02T14:03:32.852
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=50,Updated=TO_TIMESTAMP('2017-10-02 14:03:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=548501
;
-- 2017-10-02T14:03:32.856
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=60,Updated=TO_TIMESTAMP('2017-10-02 14:03:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=547341
;
-- 2017-10-02T14:03:32.860
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=70,Updated=TO_TIMESTAMP('2017-10-02 14:03:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=547325
;
-- 2017-10-02T14:03:56.227
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-10-02 14:03:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=548764
; | the_stack |
-----------------------------------------------------------------------
-- GRANT https://msdn.microsoft.com/en-us/library/ms187965.aspx
-- GRANT ALL
GRANT ALL TO pax_writer;
-- Execute the following as a database owner
GRANT EXECUTE ON TestProc TO TesterRole WITH GRANT OPTION;
EXEC sp_addrolemember TesterRole, User1;
-- Execute the following as User1
-- The following fails because User1 does not have the permission as the User1
GRANT EXECUTE ON TestMe TO User2;
-- The following succeeds because User1 invokes the TesterRole membership
GRANT EXECUTE ON TestMe TO User2 AS TesterRole;
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Asymmetric Key Permissions
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Availability Group Permissions
-- Granting VIEW DEFINITION permission on an availability group
-- USE master;
-- GRANT VIEW DEFINITION ON AVAILABILITY GROUP::MyAg TO ZArifin;
-- GO
-- Granting TAKE OWNERSHIP permission with the GRANT OPTION
-- USE master;
-- GRANT TAKE OWNERSHIP ON AVAILABILITY GROUP::MyAg TO PKomosinski
-- WITH GRANT OPTION;
-- GO
-- Granting CONTROL permission on an availability group
-- USE master;
-- GRANT CONTROL ON AVAILABILITY GROUP::MyAg TO PKomosinski;
-- GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Certificate Permissions https://msdn.microsoft.com/en-us/library/ms186278.aspx
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Database Permissions https://msdn.microsoft.com/en-us/library/ms178569.aspx
-- Granting permission to create tables
USE AdventureWorks;
GRANT CREATE TABLE TO MelanieK;
GO
-- Granting SHOWPLAN permission to an application role
USE AdventureWorks2012;
GRANT SHOWPLAN TO AuditMonitor;
GO
-- Granting CREATE VIEW with GRANT OPTION
USE AdventureWorks2012;
GRANT CREATE VIEW TO CarmineEs WITH GRANT OPTION;
GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Database Principal Permissions https://msdn.microsoft.com/en-us/library/ms173848.aspx
-- Granting CONTROL permission on a user to another user
-- USE AdventureWorks2012;
-- GRANT CONTROL ON USER::Wanida TO RolandX;
-- GO
-- Granting VIEW DEFINITION permission on a role to a user with GRANT OPTION
-- USE AdventureWorks2012;
-- GRANT VIEW DEFINITION ON ROLE::SammamishParking
-- TO JinghaoLiu WITH GRANT OPTION;
-- GO
-- Granting IMPERSONATE permission on a user to an application role
-- USE AdventureWorks2012;
-- GRANT IMPERSONATE ON USER::HamithaL TO AccountsPayable17;
-- GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Endpoint Permissions https://msdn.microsoft.com/en-us/library/ms187811.aspx
-- Granting VIEW DEFINITION permission on an endpoint
-- USE master;
-- GRANT VIEW DEFINITION ON ENDPOINT::Mirror7 TO ZArifin;
-- GO
-- Granting TAKE OWNERSHIP permission with the GRANT OPTION
-- USE master;
-- GRANT TAKE OWNERSHIP ON ENDPOINT::Shipping83 TO PKomosinski
-- WITH GRANT OPTION;
-- GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Full-Text Permissions https://msdn.microsoft.com/en-us/library/ms190502.aspx
-- Granting permissions to a full-text catalog
-- GRANT CONTROL
-- ON FULLTEXT CATALOG :: ProductCatalog
-- TO Ted ;
-- Granting permissions to a stoplist
-- GRANT VIEW DEFINITION
-- ON FULLTEXT STOPLIST :: ProductStoplist
-- TO Mary ;
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Object Permissions https://msdn.microsoft.com/en-us/library/ms188371.aspx
-- Granting SELECT permission on a table
-- USE AdventureWorks2012;
-- GRANT SELECT ON OBJECT::Person.Address TO RosaQdM;
-- GO
-- Granting EXECUTE permission on a stored procedure
-- USE AdventureWorks2012;
-- GRANT EXECUTE ON OBJECT::HumanResources.uspUpdateEmployeeHireInfo
-- TO Recruiting11;
-- GO
-- Granting REFERENCES permission on a view with GRANT OPTION
-- USE AdventureWorks2012;
-- GRANT REFERENCES (BusinessEntityID) ON OBJECT::HumanResources.vEmployee
-- TO Wanida WITH GRANT OPTION;
-- GO
-- Granting SELECT permission on a table without using the OBJECT phrase
USE AdventureWorks2012;
GRANT SELECT ON Person.Address TO RosaQdM;
GO
-- Granting SELECT permission on a table to a domain account
USE AdventureWorks2012;
GRANT SELECT ON Person.Address TO [AdventureWorks2012\RosaQdM];
GO
-- Granting EXECUTE permission on a procedure to a role
USE AdventureWorks2012;
--CREATE ROLE newrole ;
GRANT EXECUTE ON dbo.uspGetBillOfMaterials TO newrole ;
GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Schema Permissions https://msdn.microsoft.com/en-us/library/ms187940.aspx
-- Granting INSERT permission on schema HumanResources to guest
-- GRANT INSERT ON SCHEMA :: HumanResources TO guest;
-- Granting SELECT permission on schema Person to database user WilJo
-- GRANT SELECT ON SCHEMA :: Person TO WilJo WITH GRANT OPTION;
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Search Property List Permissions
-- GRANT VIEW DEFINITION
-- ON SEARCH PROPERTY LIST :: DocumentTablePropertyList
-- TO Mary ;
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Server Permissions https://msdn.microsoft.com/en-us/library/ms186717.aspx
-- Granting a permission to a login
USE master;
GRANT CONTROL SERVER TO TerryEminhizer;
GO
-- Granting a permission that has GRANT permission
-- USE master;
-- GRANT ALTER ANY EVENT NOTIFICATION TO JanethEsteves WITH GRANT OPTION;
-- GO
-- Granting a permission to a server role
USE master;
--CREATE SERVER ROLE ITDevAdmin ;
--CREATE SERVER ROLE ITDevelopers ;
GRANT ALTER ANY DATABASE TO ITDevAdmin WITH GRANT OPTION ;
GRANT ALTER ANY DATABASE TO ITDevelopers AS ITDevAdmin ;
GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Server Principal Permissions https://msdn.microsoft.com/en-us/library/ms178640.aspx
-- Granting IMPERSONATE permission on a login
-- USE master;
-- GRANT IMPERSONATE ON LOGIN::WanidaBenshoof to [AdvWorks\YoonM];
-- GO
-- Granting IMPERSONATE permission on a login
-- Granting VIEW DEFINITION permission with GRANT OPTION
-- USE master;
-- GRANT VIEW DEFINITION ON LOGIN::EricKurjan TO RMeyyappan
-- WITH GRANT OPTION;
-- GO
-- Granting VIEW DEFINITION permission on a server role
-- USE master;
-- GRANT VIEW DEFINITION ON SERVER ROLE::Sales TO Auditors ;
-- GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Service Broker Permissions https://msdn.microsoft.com/en-us/library/ms188798.aspx
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Symmetric Key Permissions https://msdn.microsoft.com/en-us/library/ms179887.aspx
-- USE AdventureWorks2012;
-- GRANT ALTER ON SYMMETRIC KEY::SamInventory42 TO HamidS;
-- GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT System Object Permissions https://msdn.microsoft.com/en-us/library/ms187797.aspx
-- GRANT { SELECT | EXECUTE } ON [ sys.]system_object TO principal
-- Granting SELECT permission on a view
USE AdventureWorks2012;
GRANT SELECT ON sys.sql_logins TO Sylvester1;
--GRANT VIEW SERVER STATE to Sylvester1;
GO
-- Granting EXECUTE permission on an extended stored procedure
GRANT EXECUTE ON xp_readmail TO Sylvester1;
GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT Type Permissions https://msdn.microsoft.com/en-us/library/ms174346.aspx
-- GRANT VIEW DEFINITION ON TYPE::Telemarketing.PhoneNumber
-- TO KhalidR WITH GRANT OPTION;
-- GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- GRANT XML Schema Collection Permissions https://msdn.microsoft.com/en-us/library/ms179867.aspx
-- USE AdventureWorks2012;
-- GRANT EXECUTE ON XML SCHEMA COLLECTION::Sales.Invoices4 TO Wanida;
-- GO
--Test if the security_statement can accept Public as target
--Also tests if it can accepts multiple targets
--ref: https://msdn.microsoft.com/en-us/library/ms187965.aspx
GRANT EXECUTE ON [dbo].[closeLead] to Public,XYZPublic
--Test empty statements
;;;
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Declare XML Schema (https://docs.microsoft.com/en-us/sql/relational-databases/xml/create-xml-data-type-variables-and-columns)
DECLARE @x xml (Sales.StoreSurveySchemaCollection)
-- Decrypts a symmetric key and makes it available for use
OPEN SYMMETRIC KEY SomeKeyName DECRYPTION
BY CERTIFICATE SomeCertificateName;
GO;
-- Closing a symmetric key
CLOSE SYMMETRIC KEY SomeKeyName;
GO;
-- Closing all symmetric keys
CLOSE ALL SYMMETRIC KEYS;
GO
-- Conversation timer
BEGIN CONVERSATION TIMER (@dialog_handle)
TIMEOUT = 120;
GO;
-- Beginning a conversation dialog
DECLARE @dialog_handle UNIQUEIDENTIFIER;
BEGIN DIALOG CONVERSATION @dialog_handle
FROM SERVICE [//Adventure-Works.com/ExpenseClient]
TO SERVICE '//Adventure-Works.com/Expenses'
ON CONTRACT [//Adventure-Works.com/Expenses/ExpenseSubmission];
GO;
-- Begin a dialog with an explicit lifetime
DECLARE @dialog_handle UNIQUEIDENTIFIER;
BEGIN DIALOG CONVERSATION @dialog_handle
FROM SERVICE [//Adventure-Works.com/ExpenseClient]
TO SERVICE '//Adventure-Works.com/Expenses'
ON CONTRACT [//Adventure-Works.com/Expenses/ExpenseSubmission]
WITH LIFETIME = 60;
GO;
-- Begin a dialog with a specific broker instance
DECLARE @dialog_handle UNIQUEIDENTIFIER;
BEGIN DIALOG CONVERSATION @dialog_handle
FROM SERVICE [//Adventure-Works.com/ExpenseClient]
TO SERVICE '//Adventure-Works.com/Expenses',
'a326e034-d4cf-4e8b-8d98-4d7e1926c904'
ON CONTRACT [//Adventure-Works.com/Expenses/ExpenseSubmission];
GO;
-- Begin a dialog, and relating it to an existing conversation group
DECLARE @dialog_handle UNIQUEIDENTIFIER;
DECLARE @conversation_group_id UNIQUEIDENTIFIER;
BEGIN DIALOG CONVERSATION @dialog_handle
FROM SERVICE [//Adventure-Works.com/ExpenseClient]
TO SERVICE '//Adventure-Works.com/Expenses'
ON CONTRACT [//Adventure-Works.com/Expenses/ExpenseSubmission]
WITH RELATED_CONVERSATION_GROUP = @conversation_group_id;
GO;
-- Begin a dialog with an explicit lifetime, and relating the dialog to an existing conversation
DECLARE @dialog_handle UNIQUEIDENTIFIER
DECLARE @existing_conversation_handle UNIQUEIDENTIFIER
BEGIN DIALOG CONVERSATION @dialog_handle
FROM SERVICE [//Adventure-Works.com/ExpenseClient]
TO SERVICE '//Adventure-Works.com/Expenses'
ON CONTRACT [//Adventure-Works.com/Expenses/ExpenseSubmission]
WITH RELATED_CONVERSATION = @existing_conversation_handle
LIFETIME = 600;
GO;
-- Begin a dialog with optional encryption
DECLARE @dialog_handle UNIQUEIDENTIFIER
BEGIN DIALOG CONVERSATION @dialog_handle
FROM SERVICE [//Adventure-Works.com/ExpenseClient]
TO SERVICE '//Adventure-Works.com/Expenses'
ON CONTRACT [//Adventure-Works.com/Expenses/ExpenseSubmission]
WITH ENCRYPTION = OFF;
GO;
-- Ending a conversation
END CONVERSATION @dialog_handle;
GO;
-- Ending a conversation with an error
DECLARE @dialog_handle UNIQUEIDENTIFIER,
@ErrorSave INT,
@ErrorDesc NVARCHAR(100) ;
BEGIN TRANSACTION ;
SET @ErrorSave = @@ERROR ;
IF (@ErrorSave <> 0)
BEGIN
ROLLBACK TRANSACTION ;
SET @ErrorDesc = N'An error has occurred.' ;
END CONVERSATION @dialog_handle
WITH ERROR = @ErrorSave DESCRIPTION = @ErrorDesc ;
END
ELSE
COMMIT TRANSACTION ;
GO;
-- Cleaning up a conversation that cannot complete normally
END CONVERSATION @dialog_handle WITH CLEANUP;
GO;
-- Getting a conversation group, waiting indefinitely
DECLARE @conversation_group_id UNIQUEIDENTIFIER ;
WAITFOR (
GET CONVERSATION GROUP @conversation_group_id
FROM ExpenseQueue
);
GO;
-- Getting a conversation group, waiting one minute
DECLARE @conversation_group_id UNIQUEIDENTIFIER
WAITFOR (
GET CONVERSATION GROUP @conversation_group_id
FROM ExpenseQueue ),
TIMEOUT 60000 ;
GO;
-- Getting a conversation group, returning immediately
DECLARE @conversation_group_id UNIQUEIDENTIFIER;
GET CONVERSATION GROUP @conversation_group_id
FROM AdventureWorks.dbo.ExpenseQueue;
GO;
-- Starts a dialog and sends an XML message on the dialog
DECLARE @dialog_handle UNIQUEIDENTIFIER,
@ExpenseReport XML;
SET @ExpenseReport = '<document/>';
BEGIN DIALOG @dialog_handle
FROM SERVICE [//Adventure-Works.com/Expenses/ExpenseClient]
TO SERVICE '//Adventure-Works.com/Expenses'
ON CONTRACT [//Adventure-Works.com/Expenses/ExpenseProcessing] ;
SEND ON CONVERSATION @dialog_handle
MESSAGE TYPE [//Adventure-Works.com/Expenses/SubmitExpense]
(@ExpenseReport) ;
GO;
-- Starts a dialog and sends an XML message on the dialog using local vars without message body
DECLARE @dialog_handle UNIQUEIDENTIFIER,
@ExpenseReport XML;
SET @ExpenseReport = '<document/>';
BEGIN DIALOG @dialog_handle
FROM SERVICE @from_service
TO SERVICE @to_service
ON CONTRACT @contract;
SEND ON CONVERSATION @dialog_handle
MESSAGE TYPE @MessageType
GO;
-- Create Master Key
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'password';
GO;
-- Open Master Key
OPEN MASTER KEY DECRYPTION BY PASSWORD = 'password';
GO;
-- Close Master Key
CLOSE MASTER KEY;
GO;
-- Creating a self-signed certificate
USE AdventureWorks2012;
CREATE CERTIFICATE Shipping04
ENCRYPTION BY PASSWORD = 'pGFD4bb925DGvbd2439587y'
WITH SUBJECT = 'Sammamish Shipping Records',
EXPIRY_DATE = '20201031';
GO;
-- Creating a certificate from a file
USE AdventureWorks2012;
CREATE CERTIFICATE Shipping11
FROM FILE = 'c:\Shipping\Certs\Shipping11.cer'
WITH PRIVATE KEY (FILE = 'c:\Shipping\Certs\Shipping11.pvk',
DECRYPTION BY PASSWORD = 'sldkflk34et6gs%53#v00');
GO;
-- Creating a certificate from a signed executable file
USE AdventureWorks2012;
CREATE CERTIFICATE Shipping19
FROM EXECUTABLE FILE = 'c:\Shipping\Certs\Shipping19.dll';
GO;
-- Creating a symmetric key
CREATE SYMMETRIC KEY JanainaKey09
WITH ALGORITHM = AES_256
ENCRYPTION BY CERTIFICATE Shipping04;
GO;
-- Creating a temporary symmetric key
CREATE SYMMETRIC KEY #MarketingXXV
WITH ALGORITHM = AES_128,
KEY_SOURCE
= 'The square of the hypotenuse is equal to the sum of the squares of the sides',
IDENTITY_VALUE = 'Pythagoras'
ENCRYPTION BY CERTIFICATE Marketing25;
GO;
-- Creating a symmetric key using an Extensible Key Management (EKM) device
CREATE SYMMETRIC KEY MySymKey
AUTHORIZATION User1
FROM PROVIDER EKMProvider
WITH
PROVIDER_KEY_NAME='KeyForSensitiveData',
CREATION_DISPOSITION=OPEN_EXISTING;
GO;
-- Creating a message type for an empty message
CREATE MESSAGE TYPE
[//Adventure-Works.com/Expenses/SubmitExpense]
VALIDATION = EMPTY;
GO;
-- Creating a message type containing binary data
CREATE MESSAGE TYPE
[//Adventure-Works.com/Expenses/ReceiptImage]
VALIDATION = NONE;
GO;
-- Create Contract
CREATE MESSAGE TYPE
[//Adventure-Works.com/Expenses/SubmitExpense]
VALIDATION = WELL_FORMED_XML ;
CREATE MESSAGE TYPE
[//Adventure-Works.com/Expenses/ExpenseApprovedOrDenied]
VALIDATION = WELL_FORMED_XML ;
CREATE MESSAGE TYPE
[//Adventure-Works.com/Expenses/ExpenseReimbursed]
VALIDATION= WELL_FORMED_XML ;
CREATE CONTRACT
[//Adventure-Works.com/Expenses/ExpenseSubmission]
( [//Adventure-Works.com/Expenses/SubmitExpense]
SENT BY INITIATOR,
[//Adventure-Works.com/Expenses/ExpenseApprovedOrDenied]
SENT BY TARGET,
[//Adventure-Works.com/Expenses/ExpenseReimbursed]
SENT BY TARGET
) ;
GO;
-- Creating a queue with no parameters
CREATE QUEUE ExpenseQueue ;
GO;
-- Creating an unavailable queue
CREATE QUEUE ExpenseQueue WITH STATUS=OFF ;
GO;
-- Creating a queue and specify internal activation information
CREATE QUEUE ExpenseQueue
WITH STATUS=ON,
ACTIVATION (
PROCEDURE_NAME = expense_procedure,
MAX_QUEUE_READERS = 5,
EXECUTE AS 'ExpenseUser' ) ;
GO;
-- Creating a queue on a specific filegroup
CREATE QUEUE ExpenseQueue
ON ExpenseWorkFileGroup ;
GO;
-- Creating a queue with multiple parameters
CREATE QUEUE ExpenseQueue
WITH STATUS = OFF,
RETENTION = ON,
ACTIVATION (
PROCEDURE_NAME = AdventureWorks2012.dbo.expense_procedure,
MAX_QUEUE_READERS = 10,
EXECUTE AS SELF )
ON [DEFAULT] ;
GO;
-- Making a queue unavailable
ALTER QUEUE ExpenseQueue WITH STATUS = OFF ;
GO;
-- Changing the activation stored procedure
ALTER QUEUE ExpenseQueue
WITH ACTIVATION (
PROCEDURE_NAME = new_stored_proc,
EXECUTE AS SELF) ;
GO;
-- Changing the number of queue readers
ALTER QUEUE ExpenseQueue WITH ACTIVATION (MAX_QUEUE_READERS = 7) ;
GO;
-- Changing the activation stored procedure and the EXECUTE AS account
ALTER QUEUE ExpenseQueue
WITH ACTIVATION (
PROCEDURE_NAME = AdventureWorks2012.dbo.new_stored_proc ,
EXECUTE AS 'SecurityAccount') ;
GO;
-- Setting the queue to retain messages
ALTER QUEUE ExpenseQueue WITH RETENTION = ON ;
GO;
-- Removing activation from a queue
ALTER QUEUE ExpenseQueue WITH ACTIVATION (DROP) ;
GO;
-- Rebuilding queue indexes
ALTER QUEUE ExpenseQueue REBUILD WITH (MAXDOP = 2)
GO;
-- Reorganizing queue indexes
ALTER QUEUE ExpenseQueue REORGANIZE
GO;
-- Moving queue internal table to another filegroup
ALTER QUEUE ExpenseQueue MOVE TO [NewFilegroup]
GO; | the_stack |
-- Jira Ticket Number(s): DEV-5343
--
-- This script copies submissions and their matching File A/B/C records from a source fiscal
-- period into a destination fiscal period.
--
-- Expected CLI:
--
-- None. Execution is controlled by a supporting Python script.
--
-- Purpose:
--
-- This script generates or participates in the generation of sample CARES Act data for testing
-- and development purposes. It generates these data from existing data by duplicating and
-- modifying existing submissions and File A/B/C records. Data points are adjusted in an attempt
-- to make them seem realistic and true to their actual source submissions.
--
-- These data will not be perfect, obviously, but they should be sufficient for testing.
--
-- Life expectancy:
--
-- This file should live until CARES Act features have gone live.
--
-- Be sure to delete all files/directories associated with this ticket:
-- - job_archive/management/commands/generate_cares_act_test_copy_submissions.py
-- - job_archive/management/commands/generate_cares_act_test_def_codes.py
-- - job_archive/management/commands/generate_cares_act_test_helpers.py
-- - job_archive/management/commands/generate_cares_act_test_monthly_submissions.py
-- - job_archive/management/commands/generate_cares_act_test_data_sqls
-- LOG: Copy submission_attributes from FY{source_fiscal_year}P{source_fiscal_period} to FY{destination_fiscal_year}P{destination_fiscal_period}
insert into submission_attributes (
submission_id,
certified_date,
toptier_code,
reporting_period_start,
reporting_period_end,
reporting_fiscal_year,
reporting_fiscal_quarter,
reporting_fiscal_period,
quarter_format_flag,
create_date,
update_date,
reporting_agency_name,
published_date,
is_final_balances_for_fy,
submission_window_id,
_base_submission_id
)
select
_base_submission_id + {submission_id_shift}, -- to prevent id collisions
null, --certified_date - I'm not going to try to guess at certified dates and I don't think anything's using them right now
toptier_code,
case
when toptier_code::int % 3 != 0 then '{reporting_period_start}'::date
else '{quarter_reporting_period_start}'::date
end, -- reporting_period_start
'{reporting_period_end}'::date,
{destination_fiscal_year},
{destination_fiscal_quarter},
{destination_fiscal_period},
case
when toptier_code::int % 3 != 0 then False
else True
end, -- quarter_format_flag
'{reporting_period_end}'::date + interval '1 days', -- create_date
'{reporting_period_end}'::date + interval '1 days', -- update_date
reporting_agency_name,
'{reporting_period_end}'::date, -- published_date
is_final_balances_for_fy,
(SELECT id FROM dabs_submission_window_schedule dsws WHERE dsws.submission_fiscal_year = {destination_fiscal_year} AND dsws.submission_fiscal_month = {destination_fiscal_period} AND dsws.is_quarter = FALSE) AS submission_window_id,
_base_submission_id
from
submission_attributes
where
reporting_fiscal_year = {source_fiscal_year} and
reporting_fiscal_period = {source_fiscal_period} and (
{destination_fiscal_period} % 3 = 0 or -- we're copying to a quarterly period or
toptier_code::int % 3 != 0 -- we're copying a monthly
);
-- SPLIT --
-- LOG: Copy appropriation_account_balances from FY{source_fiscal_year}P{source_fiscal_period} to FY{destination_fiscal_year}P{destination_fiscal_period}
insert into appropriation_account_balances (
data_source,
budget_authority_unobligated_balance_brought_forward_fyb,
adjustments_to_unobligated_balance_brought_forward_cpe,
budget_authority_appropriated_amount_cpe,
borrowing_authority_amount_total_cpe,
contract_authority_amount_total_cpe,
spending_authority_from_offsetting_collections_amount_cpe,
other_budgetary_resources_amount_cpe,
total_budgetary_resources_amount_cpe,
gross_outlay_amount_by_tas_cpe,
deobligations_recoveries_refunds_by_tas_cpe,
unobligated_balance_cpe,
status_of_budgetary_resources_total_cpe,
obligations_incurred_total_by_tas_cpe,
reporting_period_start,
reporting_period_end,
create_date,
update_date,
final_of_fy,
submission_id,
treasury_account_identifier
)
select
abb.data_source,
abb.budget_authority_unobligated_balance_brought_forward_fyb,
abb.adjustments_to_unobligated_balance_brought_forward_cpe,
abb.budget_authority_appropriated_amount_cpe,
abb.borrowing_authority_amount_total_cpe,
abb.contract_authority_amount_total_cpe,
abb.spending_authority_from_offsetting_collections_amount_cpe,
abb.other_budgetary_resources_amount_cpe,
abb.total_budgetary_resources_amount_cpe,
abb.gross_outlay_amount_by_tas_cpe,
abb.deobligations_recoveries_refunds_by_tas_cpe,
abb.unobligated_balance_cpe,
abb.status_of_budgetary_resources_total_cpe,
abb.obligations_incurred_total_by_tas_cpe,
'{reporting_period_start}'::date,
'{reporting_period_end}'::date,
'{reporting_period_end}'::date + interval '1 days', -- create_date
'{reporting_period_end}'::date + interval '1 days', -- update_date
false, -- final_of_fy,
sa._base_submission_id + {submission_id_shift}, -- to match submission shift
abb.treasury_account_identifier
from
appropriation_account_balances as abb
inner join submission_attributes as sa on sa.submission_id = abb.submission_id
where
sa.reporting_fiscal_year = {source_fiscal_year} and
sa.reporting_fiscal_period = {source_fiscal_period} and (
{destination_fiscal_period} % 3 = 0 or -- we're copying to a quarterly period or
sa.toptier_code::int % 3 != 0 -- we're copying a monthly
);
-- SPLIT --
-- LOG: Copy financial_accounts_by_program_activity_object_class from FY{source_fiscal_year}P{source_fiscal_period} to FY{destination_fiscal_year}P{destination_fiscal_period}
insert into financial_accounts_by_program_activity_object_class (
ussgl480100_undelivered_orders_obligations_unpaid_fyb,
ussgl480100_undelivered_orders_obligations_unpaid_cpe,
ussgl483100_undelivered_orders_oblig_transferred_unpaid_cpe,
ussgl488100_upward_adjust_pri_undeliv_order_oblig_unpaid_cpe,
ussgl490100_delivered_orders_obligations_unpaid_fyb,
ussgl490100_delivered_orders_obligations_unpaid_cpe,
ussgl493100_delivered_orders_oblig_transferred_unpaid_cpe,
ussgl498100_upward_adjust_pri_deliv_orders_oblig_unpaid_cpe,
ussgl480200_undelivered_orders_oblig_prepaid_advanced_fyb,
ussgl480200_undelivered_orders_oblig_prepaid_advanced_cpe,
ussgl483200_undeliv_orders_oblig_transferred_prepaid_adv_cpe,
ussgl488200_up_adjust_pri_undeliv_order_oblig_ppaid_adv_cpe,
ussgl490200_delivered_orders_obligations_paid_cpe,
ussgl490800_authority_outlayed_not_yet_disbursed_fyb,
ussgl490800_authority_outlayed_not_yet_disbursed_cpe,
ussgl498200_upward_adjust_pri_deliv_orders_oblig_paid_cpe,
obligations_undelivered_orders_unpaid_total_fyb,
obligations_undelivered_orders_unpaid_total_cpe,
obligations_delivered_orders_unpaid_total_fyb,
obligations_delivered_orders_unpaid_total_cpe,
gross_outlays_undelivered_orders_prepaid_total_fyb,
gross_outlays_undelivered_orders_prepaid_total_cpe,
gross_outlays_delivered_orders_paid_total_fyb,
gross_outlays_delivered_orders_paid_total_cpe,
gross_outlay_amount_by_program_object_class_fyb,
gross_outlay_amount_by_program_object_class_cpe,
obligations_incurred_by_program_object_class_cpe,
ussgl487100_down_adj_pri_unpaid_undel_orders_oblig_recov_cpe,
ussgl497100_down_adj_pri_unpaid_deliv_orders_oblig_recov_cpe,
ussgl487200_down_adj_pri_ppaid_undel_orders_oblig_refund_cpe,
ussgl497200_down_adj_pri_paid_deliv_orders_oblig_refund_cpe,
deobligations_recoveries_refund_pri_program_object_class_cpe,
reporting_period_start,
reporting_period_end,
create_date,
update_date,
final_of_fy,
object_class_id,
program_activity_id,
submission_id,
treasury_account_id,
disaster_emergency_fund_code
)
select
f.ussgl480100_undelivered_orders_obligations_unpaid_fyb,
f.ussgl480100_undelivered_orders_obligations_unpaid_cpe,
f.ussgl483100_undelivered_orders_oblig_transferred_unpaid_cpe,
f.ussgl488100_upward_adjust_pri_undeliv_order_oblig_unpaid_cpe,
f.ussgl490100_delivered_orders_obligations_unpaid_fyb,
f.ussgl490100_delivered_orders_obligations_unpaid_cpe,
f.ussgl493100_delivered_orders_oblig_transferred_unpaid_cpe,
f.ussgl498100_upward_adjust_pri_deliv_orders_oblig_unpaid_cpe,
f.ussgl480200_undelivered_orders_oblig_prepaid_advanced_fyb,
f.ussgl480200_undelivered_orders_oblig_prepaid_advanced_cpe,
f.ussgl483200_undeliv_orders_oblig_transferred_prepaid_adv_cpe,
f.ussgl488200_up_adjust_pri_undeliv_order_oblig_ppaid_adv_cpe,
f.ussgl490200_delivered_orders_obligations_paid_cpe,
f.ussgl490800_authority_outlayed_not_yet_disbursed_fyb,
f.ussgl490800_authority_outlayed_not_yet_disbursed_cpe,
f.ussgl498200_upward_adjust_pri_deliv_orders_oblig_paid_cpe,
f.obligations_undelivered_orders_unpaid_total_fyb,
f.obligations_undelivered_orders_unpaid_total_cpe,
f.obligations_delivered_orders_unpaid_total_fyb,
f.obligations_delivered_orders_unpaid_total_cpe,
f.gross_outlays_undelivered_orders_prepaid_total_fyb,
f.gross_outlays_undelivered_orders_prepaid_total_cpe,
f.gross_outlays_delivered_orders_paid_total_fyb,
f.gross_outlays_delivered_orders_paid_total_cpe,
f.gross_outlay_amount_by_program_object_class_fyb,
f.gross_outlay_amount_by_program_object_class_cpe,
f.obligations_incurred_by_program_object_class_cpe,
f.ussgl487100_down_adj_pri_unpaid_undel_orders_oblig_recov_cpe,
f.ussgl497100_down_adj_pri_unpaid_deliv_orders_oblig_recov_cpe,
f.ussgl487200_down_adj_pri_ppaid_undel_orders_oblig_refund_cpe,
f.ussgl497200_down_adj_pri_paid_deliv_orders_oblig_refund_cpe,
f.deobligations_recoveries_refund_pri_program_object_class_cpe,
'{reporting_period_start}'::date,
'{reporting_period_end}'::date,
'{reporting_period_end}'::date + interval '1 days', -- create_date
'{reporting_period_end}'::date + interval '1 days', -- update_date
false, -- f.final_of_fy
f.object_class_id,
f.program_activity_id,
sa._base_submission_id + {submission_id_shift}, -- to match submission shift
f.treasury_account_id,
f.disaster_emergency_fund_code
from
financial_accounts_by_program_activity_object_class as f
inner join submission_attributes as sa on sa.submission_id = f.submission_id
where
sa.reporting_fiscal_year = {source_fiscal_year} and
sa.reporting_fiscal_period = {source_fiscal_period} and (
{destination_fiscal_period} % 3 = 0 or -- we're copying to a quarterly period or
sa.toptier_code::int % 3 != 0 -- we're copying a monthly
);
-- SPLIT --
-- LOG: Copy financial_accounts_by_awards from FY{source_fiscal_year}P{source_fiscal_period} to FY{destination_fiscal_year}P{destination_fiscal_period}
insert into financial_accounts_by_awards (
data_source,
piid,
parent_award_id,
fain,
uri,
ussgl480100_undelivered_orders_obligations_unpaid_fyb,
ussgl480100_undelivered_orders_obligations_unpaid_cpe,
ussgl483100_undelivered_orders_oblig_transferred_unpaid_cpe,
ussgl488100_upward_adjust_pri_undeliv_order_oblig_unpaid_cpe,
ussgl490100_delivered_orders_obligations_unpaid_fyb,
ussgl490100_delivered_orders_obligations_unpaid_cpe,
ussgl493100_delivered_orders_oblig_transferred_unpaid_cpe,
ussgl498100_upward_adjust_pri_deliv_orders_oblig_unpaid_cpe,
ussgl480200_undelivered_orders_oblig_prepaid_advanced_fyb,
ussgl480200_undelivered_orders_oblig_prepaid_advanced_cpe,
ussgl483200_undeliv_orders_oblig_transferred_prepaid_adv_cpe,
ussgl488200_up_adjust_pri_undeliv_order_oblig_ppaid_adv_cpe,
ussgl490200_delivered_orders_obligations_paid_cpe,
ussgl490800_authority_outlayed_not_yet_disbursed_fyb,
ussgl490800_authority_outlayed_not_yet_disbursed_cpe,
ussgl498200_upward_adjust_pri_deliv_orders_oblig_paid_cpe,
obligations_undelivered_orders_unpaid_total_cpe,
obligations_delivered_orders_unpaid_total_fyb,
obligations_delivered_orders_unpaid_total_cpe,
gross_outlays_undelivered_orders_prepaid_total_fyb,
gross_outlays_undelivered_orders_prepaid_total_cpe,
gross_outlays_delivered_orders_paid_total_fyb,
gross_outlay_amount_by_award_fyb,
gross_outlay_amount_by_award_cpe,
obligations_incurred_total_by_award_cpe,
ussgl487100_down_adj_pri_unpaid_undel_orders_oblig_recov_cpe,
ussgl497100_down_adj_pri_unpaid_deliv_orders_oblig_recov_cpe,
ussgl487200_down_adj_pri_ppaid_undel_orders_oblig_refund_cpe,
ussgl497200_down_adj_pri_paid_deliv_orders_oblig_refund_cpe,
deobligations_recoveries_refunds_of_prior_year_by_award_cpe,
obligations_undelivered_orders_unpaid_total_fyb,
gross_outlays_delivered_orders_paid_total_cpe,
transaction_obligated_amount,
reporting_period_start,
reporting_period_end,
create_date,
update_date,
award_id,
object_class_id,
program_activity_id,
submission_id,
treasury_account_id,
disaster_emergency_fund_code,
distinct_award_key
)
select
f.data_source,
f.piid,
f.parent_award_id,
f.fain,
f.uri,
f.ussgl480100_undelivered_orders_obligations_unpaid_fyb,
f.ussgl480100_undelivered_orders_obligations_unpaid_cpe,
f.ussgl483100_undelivered_orders_oblig_transferred_unpaid_cpe,
f.ussgl488100_upward_adjust_pri_undeliv_order_oblig_unpaid_cpe,
f.ussgl490100_delivered_orders_obligations_unpaid_fyb,
f.ussgl490100_delivered_orders_obligations_unpaid_cpe,
f.ussgl493100_delivered_orders_oblig_transferred_unpaid_cpe,
f.ussgl498100_upward_adjust_pri_deliv_orders_oblig_unpaid_cpe,
f.ussgl480200_undelivered_orders_oblig_prepaid_advanced_fyb,
f.ussgl480200_undelivered_orders_oblig_prepaid_advanced_cpe,
f.ussgl483200_undeliv_orders_oblig_transferred_prepaid_adv_cpe,
f.ussgl488200_up_adjust_pri_undeliv_order_oblig_ppaid_adv_cpe,
f.ussgl490200_delivered_orders_obligations_paid_cpe,
f.ussgl490800_authority_outlayed_not_yet_disbursed_fyb,
f.ussgl490800_authority_outlayed_not_yet_disbursed_cpe,
f.ussgl498200_upward_adjust_pri_deliv_orders_oblig_paid_cpe,
f.obligations_undelivered_orders_unpaid_total_cpe,
f.obligations_delivered_orders_unpaid_total_fyb,
f.obligations_delivered_orders_unpaid_total_cpe,
f.gross_outlays_undelivered_orders_prepaid_total_fyb,
f.gross_outlays_undelivered_orders_prepaid_total_cpe,
f.gross_outlays_delivered_orders_paid_total_fyb,
f.gross_outlay_amount_by_award_fyb,
f.gross_outlay_amount_by_award_cpe,
f.obligations_incurred_total_by_award_cpe,
f.ussgl487100_down_adj_pri_unpaid_undel_orders_oblig_recov_cpe,
f.ussgl497100_down_adj_pri_unpaid_deliv_orders_oblig_recov_cpe,
f.ussgl487200_down_adj_pri_ppaid_undel_orders_oblig_refund_cpe,
f.ussgl497200_down_adj_pri_paid_deliv_orders_oblig_refund_cpe,
f.deobligations_recoveries_refunds_of_prior_year_by_award_cpe,
f.obligations_undelivered_orders_unpaid_total_fyb,
f.gross_outlays_delivered_orders_paid_total_cpe,
f.transaction_obligated_amount,
'{reporting_period_start}'::date,
'{reporting_period_end}'::date,
'{reporting_period_end}'::date + interval '1 days', -- create_date
'{reporting_period_end}'::date + interval '1 days', -- update_date
f.award_id,
f.object_class_id,
f.program_activity_id,
sa._base_submission_id + {submission_id_shift}, -- to match submission shift
f.treasury_account_id,
f.disaster_emergency_fund_code,
UPPER(CONCAT(piid, '|', parent_award_id, '|', fain, '|', uri))
from
financial_accounts_by_awards as f
inner join submission_attributes as sa on sa.submission_id = f.submission_id
where
sa.reporting_fiscal_year = {source_fiscal_year} and
sa.reporting_fiscal_period = {source_fiscal_period} and (
{destination_fiscal_period} % 3 = 0 or -- we're copying to a quarterly period or
sa.toptier_code::int % 3 != 0 -- we're copying a monthly
);
-- SPLIT --
-- LOG: Recalculate final_of_fy for appropriation_account_balances
with cte as (
select distinct on (aab.treasury_account_identifier)
aab.treasury_account_identifier,
sa.submission_id
from
submission_attributes as sa
inner join appropriation_account_balances aab on aab.submission_id = sa.submission_id
where
sa.reporting_fiscal_year = {destination_fiscal_year}
order by
aab.treasury_account_identifier,
sa.reporting_period_start desc
)
update appropriation_account_balances as aab
set final_of_fy = exists(
select
from cte
where cte.submission_id = aab.submission_id and
cte.treasury_account_identifier = aab.treasury_account_identifier
)
from submission_attributes as sa
where aab.submission_id = sa.submission_id and
sa.reporting_fiscal_year = {destination_fiscal_year} and
aab.final_of_fy is distinct from exists(
select
from cte
where cte.submission_id = aab.submission_id and
cte.treasury_account_identifier = aab.treasury_account_identifier
);
-- SPLIT --
-- LOG: Recalculate final_of_fy for financial_accounts_by_program_activity_object_class
with cte as (
select distinct on (f.treasury_account_id)
f.treasury_account_id,
sa.submission_id
from
submission_attributes as sa
inner join financial_accounts_by_program_activity_object_class f on f.submission_id = sa.submission_id
where
sa.reporting_fiscal_year = {destination_fiscal_year}
order by
f.treasury_account_id,
sa.reporting_period_start desc
)
update financial_accounts_by_program_activity_object_class as f
set final_of_fy = exists(
select
from cte
where cte.submission_id = f.submission_id and
cte.treasury_account_id = f.treasury_account_id
)
from submission_attributes as sa
where f.submission_id = sa.submission_id and
sa.reporting_fiscal_year = {destination_fiscal_year} and
f.final_of_fy is distinct from exists(
select
from cte
where cte.submission_id = f.submission_id and
cte.treasury_account_id = f.treasury_account_id
); | the_stack |
create or replace function journal.refresh_journal_trigger(
p_source_schema_name in varchar,
p_source_table_name in varchar,
p_target_schema_name in varchar = 'journal',
p_target_table_name in varchar = null
) returns varchar language plpgsql as $$
declare
v_insert_trigger_name text;
v_delete_trigger_name text;
begin
v_insert_trigger_name := journal.refresh_journal_insert_trigger(p_source_schema_name, p_source_table_name, p_target_schema_name, coalesce(p_target_table_name, p_source_table_name));
v_delete_trigger_name := journal.refresh_journal_delete_trigger(p_source_schema_name, p_source_table_name, p_target_schema_name, coalesce(p_target_table_name, p_source_table_name));
return v_insert_trigger_name || ' ' || v_delete_trigger_name;
end;
$$;
create or replace function journal.refresh_journal_delete_trigger(
p_source_schema_name in varchar, p_source_table_name in varchar,
p_target_schema_name in varchar, p_target_table_name in varchar
) returns varchar language plpgsql as $$
declare
row record;
v_journal_name text;
v_source_name text;
v_trigger_name text;
v_sql text;
v_target_sql text;
begin
v_journal_name = p_target_schema_name || '.' || p_target_table_name;
v_source_name = p_source_schema_name || '.' || p_source_table_name;
v_trigger_name = p_target_table_name || '_journal_delete_trigger';
-- create the function
v_sql = 'create or replace function ' || v_journal_name || '_delete() returns trigger language plpgsql as ''';
v_sql := v_sql || ' begin ';
v_sql := v_sql || ' insert into ' || v_journal_name || ' (journal_operation';
v_target_sql = 'TG_OP';
for row in (select column_name from information_schema.columns where table_schema = p_source_schema_name and table_name = p_source_table_name order by ordinal_position) loop
v_sql := v_sql || ', ' || row.column_name;
v_target_sql := v_target_sql || ', old.' || row.column_name;
end loop;
v_sql := v_sql || ') values (' || v_target_sql || '); ';
v_sql := v_sql || ' return null; end; ''';
execute v_sql;
-- create the trigger
v_sql = 'drop trigger if exists ' || v_trigger_name || ' on ' || v_source_name || '; ' ||
'create trigger ' || v_trigger_name || ' after delete on ' || v_source_name ||
' for each row execute procedure ' || v_journal_name || '_delete()';
execute v_sql;
return v_trigger_name;
end;
$$;
create or replace function journal.refresh_journal_insert_trigger(
p_source_schema_name in varchar, p_source_table_name in varchar,
p_target_schema_name in varchar, p_target_table_name in varchar
) returns varchar language plpgsql as $$
declare
row record;
v_journal_name text;
v_source_name text;
v_trigger_name text;
v_first boolean;
v_sql text;
v_target_sql text;
v_name text;
begin
v_journal_name = p_target_schema_name || '.' || p_target_table_name;
v_source_name = p_source_schema_name || '.' || p_source_table_name;
v_trigger_name = p_target_table_name || '_journal_insert_trigger';
-- create the function
v_sql = 'create or replace function ' || v_journal_name || '_insert() returns trigger language plpgsql as ''';
v_sql := v_sql || ' begin ';
for v_name in (select * from journal.primary_key_columns(p_source_schema_name, p_source_table_name)) loop
v_sql := v_sql || ' if (TG_OP=''''UPDATE'''' and (old.' || v_name || ' != new.' || v_name || ')) then';
v_sql := v_sql || ' raise exception ''''Table[' || v_source_name || '] is journaled. Updates to primary key column[' || v_name || '] are not supported as this would make it impossible to follow the history of this row in the journal table[' || v_journal_name || ']'''';';
v_sql := v_sql || ' end if;';
end loop;
v_sql := v_sql || ' insert into ' || v_journal_name || ' (journal_operation';
v_target_sql = 'TG_OP';
for row in (select column_name from information_schema.columns where table_schema = p_source_schema_name and table_name = p_source_table_name order by ordinal_position) loop
v_sql := v_sql || ', ' || row.column_name;
v_target_sql := v_target_sql || ', new.' || row.column_name;
end loop;
v_sql := v_sql || ') values (' || v_target_sql || '); ';
v_sql := v_sql || ' return null; end; ''';
execute v_sql;
-- create the trigger
v_sql = 'drop trigger if exists ' || v_trigger_name || ' on ' || v_source_name || '; ' ||
'create trigger ' || v_trigger_name || ' after insert or update on ' || v_source_name ||
' for each row execute procedure ' || v_journal_name || '_insert()';
execute v_sql;
return v_trigger_name;
end;
$$;
create or replace function journal.get_data_type_string(
p_column information_schema.columns
) returns varchar language plpgsql as $$
declare
journal_data_type text;
begin
IF p_column.data_type = 'numeric' THEN
IF p_column.numeric_precision IS NOT NULL AND p_column.numeric_scale IS NOT NULL THEN
journal_data_type := p_column.data_type || '(' || p_column.numeric_precision::varchar || ',' || p_column.numeric_scale::varchar || ')';
ELSE
journal_data_type := p_column.data_type;
END IF;
ELSEIF p_column.data_type IN ('character', 'character varying', '"char"') THEN
journal_data_type := 'text';
ELSE
journal_data_type := p_column.data_type;
END IF;
return journal_data_type;
end;
$$;
create or replace function journal.primary_key_columns(
p_schema_name in varchar,
p_table_name in varchar
) returns setof text language plpgsql AS $$
declare
row record;
begin
for row in (
select key_column_usage.column_name
from information_schema.table_constraints
join information_schema.key_column_usage
on key_column_usage.table_name = table_constraints.table_name
and key_column_usage.table_schema = table_constraints.table_schema
and key_column_usage.constraint_name = table_constraints.constraint_name
where table_constraints.constraint_type = 'PRIMARY KEY'
and table_constraints.table_schema = p_schema_name
and table_constraints.table_name = p_table_name
order by coalesce(key_column_usage.position_in_unique_constraint, 0),
coalesce(key_column_usage.ordinal_position, 0),
key_column_usage.column_name
) loop
return next row.column_name;
end loop;
end;
$$;
create or replace function journal.add_primary_key_data(
p_source_schema_name in varchar, p_source_table_name in varchar,
p_target_schema_name in varchar, p_target_table_name in varchar
) returns void language plpgsql as $$
declare
v_name text;
v_columns character varying := '';
begin
for v_name in (select * from journal.primary_key_columns(p_source_schema_name, p_source_table_name)) loop
if v_columns != '' then
v_columns := v_columns || ', ';
end if;
v_columns := v_columns || v_name;
execute 'alter table ' || p_target_schema_name || '.' || p_target_table_name || ' alter column ' || v_name || ' set not null';
end loop;
if v_columns != '' then
execute 'create index on ' || p_target_schema_name || '.' || p_target_table_name || '(' || v_columns || ')';
end if;
end;
$$;
create or replace function journal.refresh_journaling(
p_source_schema_name in varchar, p_source_table_name in varchar,
p_target_schema_name in varchar, p_target_table_name in varchar
) returns varchar language plpgsql as $$
declare
row record;
v_journal_name text;
v_data_type character varying;
begin
v_journal_name = p_target_schema_name || '.' || p_target_table_name;
if exists(select 1 from information_schema.tables where table_schema = p_target_schema_name and table_name = p_target_table_name) then
for row in (select column_name, journal.get_data_type_string(information_schema.columns.*) as data_type from information_schema.columns where table_schema = p_source_schema_name and table_name = p_source_table_name order by ordinal_position) loop
-- NB: Specifically choosing to not drop deleted columns from the journal table, to preserve the data.
-- There are no constraints (other than not null on primary key columns) on the journaling table
-- columns anyway, so leaving it populated with null will be fine.
select journal.get_data_type_string(information_schema.columns.*) into v_data_type from information_schema.columns where table_schema = p_target_schema_name and table_name = p_target_table_name and column_name = row.column_name;
if not found then
execute 'alter table ' || v_journal_name || ' add ' || row.column_name || ' ' || row.data_type;
elsif (row.data_type != v_data_type) then
execute 'alter table ' || v_journal_name || ' alter column ' || row.column_name || ' type ' || row.data_type;
end if;
end loop;
else
execute 'create table ' || v_journal_name || ' as select * from ' || p_source_schema_name || '.' || p_source_table_name || ' limit 0';
execute 'alter table ' || v_journal_name || ' add journal_timestamp timestamp with time zone not null default now() ';
execute 'alter table ' || v_journal_name || ' add journal_operation text not null ';
execute 'alter table ' || v_journal_name || ' add journal_id bigserial primary key ';
execute 'comment on table ' || v_journal_name || ' is ''Created by plsql function refresh_journaling to shadow all inserts and updates on the table ' || p_source_schema_name || '.' || p_source_table_name || '''';
perform journal.add_primary_key_data(p_source_schema_name, p_source_table_name, p_target_schema_name, p_target_table_name);
end if;
perform journal.refresh_journal_trigger(p_source_schema_name, p_source_table_name, p_target_schema_name, p_target_table_name);
return v_journal_name;
end;
$$;
--note: creating event_triggers requires superuser privileges
create or replace function journal.create_event_trigger(
p_source_schema_name in varchar, p_source_table_name in varchar,
p_target_schema_name in varchar, p_target_table_name in varchar
) returns void language plpgsql as $$
declare
v_journal_name text;
v_source_name text;
v_function_sql text;
v_trigger_sql text;
begin
v_journal_name = p_target_schema_name || '.' || p_target_table_name;
v_source_name = p_source_schema_name || '.' || p_source_table_name;
if exists(select 1 from information_schema.tables where table_schema = p_target_schema_name and table_name = p_target_table_name) then
v_function_sql = 'CREATE OR REPLACE FUNCTION refresh_' || p_source_table_name || '_journal() RETURNS event_trigger AS ''';
v_function_sql := v_function_sql || ' declare ';
v_function_sql := v_function_sql || ' r RECORD; ';
v_function_sql := v_function_sql || ' func_exists boolean; ';
v_function_sql := v_function_sql || 'BEGIN ';
--for postgres 9.4 compatability, so we don't throw errors
v_function_sql := v_function_sql || 'select exists(select * from pg_proc where proname = ''pg_event_trigger_ddl_commands'') into func_exists; ';
v_function_sql := v_function_sql || 'IF func_exists THEN ';
v_function_sql := v_function_sql || ' FOR r IN SELECT * FROM pg_event_trigger_ddl_commands() LOOP ';
v_function_sql := v_function_sql || ' IF r.object_identity = ''' || v_source_name || ''' THEN ';
v_function_sql := v_function_sql || ' perform journal.refresh_journaling(''' || p_source_schema_name || ''', ''' || p_source_table_name || ''', ''' || p_target_schema_name || ''', ''' || p_target_table_name ||'''); ';
v_function_sql := v_function_sql || ' END IF; ';
v_function_sql := v_function_sql || ' END LOOP; ';
v_function_sql := v_function_sql || 'END IF; ';
v_function_sql := v_function_sql || 'END; ';
v_function_sql := v_function_sql || '''';
v_function_sql := v_function_sql || 'LANGUAGE plpgsql;';
v_trigger_sql = 'CREATE EVENT TRIGGER tr_refresh_' || p_source_table_name || 'journal ';
v_trigger_sql := v_trigger_sql || 'ON ddl_command_end WHEN TAG IN (''ALTER TABLE'') ';
v_trigger_sql := v_trigger_sql || 'EXECUTE PROCEDURE refresh_' || p_source_table_name || '_journal(); ';
perform v_function_sql;
perform v_trigger_sql;
else
raise exception 'Unable to create journal event trigger for table without journaling. Use journal.create_journaling instead';
end if;
end;
$$;
--note this requires superuser privileges
create or replace function journal.create_journaling(
p_source_schema_name in varchar, p_source_table_name in varchar,
p_target_schema_name in varchar, p_target_table_name in varchar
) returns varchar language plpgsql as $$
declare
v_journal_name varchar;
begin
select journal.refresh_journaling(p_source_schema_name, p_source_table_name, p_target_schema_name, p_target_table_name) into v_journal_name;
perform journal.create_event_trigger(p_source_schema_name, p_source_table_name, p_target_schema_name, p_target_table_name);
return v_journal_name;
end;
$$; | the_stack |
----------------------------------------------------------------------------
-- Licensed Materials - Property of IBM
-- Governed under the terms of the IBM Public License
--
-- (C) COPYRIGHT International Business Machines Corp. 2999 - 2010
-- All Rights Reserved.
--
-- US Government Users Restricted Rights - Use, duplication or
-- disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
----------------------------------------------------------------------------
--
-- Product Name: DB2 Spatial Extender v10.0
--
-- Source File Name: seBankDemoTableData.db2
--
-- Version: 10.0.0
--
-- Description:
--
--
--
-- For more information about the DB2 Spatial Extender Bank Demo scripts,
-- see the seBankDemoREADME.txt file.
--
-- For more information about DB2 SE, see the "DB2 Spatial Extender User Guide".
--
-- For the latest information on DB2 Spatial Extender and the Bank Demo
-- refer to the DB2 Spatial Extender website at
-- http://www.software.ibm.com/software/data/spatial/db2spatial
----------------------------------------------------------------------------
--==========================================================================
-- BRANCH DATA
--==========================================================================
INSERT INTO se_demo.branches(
BRANCH_ID, SE_ROW_ID, NAME, MANAGER, STREET, CITY, STATE, ZIP,LATITUDE,LONGITUDE) VALUES
(1, 1, 'Meridian', 'Francisco Villa', '1670 Meridian Ave', 'San Jose', 'CA','95125',37.31164,-121.91451),
(2, 2, 'San Carlos ','Stacey Nguyen', '580 San Carlos St', 'San Jose', 'CA','95112',37.33729,-121.87508);
-- end of BRANCH DATA
--==========================================================================
-- CUSTOMER DATA
--==========================================================================
INSERT INTO se_demo.customers(
CUSTOMER_ID, SE_ROW_ID, NAME, STREET, CITY, STATE, ZIP,CUSTOMER_TYPE,LATITUDE,LONGITUDE) VALUES
( 124, 1,'James T.Kirk ',' 855 Garden Dr ',' San Jose ','CA','95126','NORMAL',37.33253, -121.93148),
( 125, 2,'Leonard McCoy ',' 815 Garden Dr ',' San Jose ','CA','95126','NORMAL',37.33187, -121.93069),
( 126, 3,'Hikaru Sulu ','1849 University Ave',' San Jose ','CA','95126','NORMAL',37.33126, -121.93243),
( 127, 4,'Michelle Nichols ','1649 University Way',' San Jose ','CA','95126','NORMAL',37.33333, -121.93044),
( 135, 5,'Montgomery Scott ','2024 University Ave',' San Jose ','CA','95128','NORMAL',37.33006, -121.93432),
( 136, 6,'Pavel Chekov ',' 725 Bascom Ave',' San Jose ','CA','95128','NORMAL',37.33013, -121.93367),
( 138, 8,'Deforest Kelly ',' 725 Garden Dr ',' San Jose ','CA','95126','NORMAL',37.33060, -121.92919),
( 139, 9,'Walter Koenig ','1779 Naglee Ave',' San Jose ','CA','95126','NORMAL',37.32925, -121.93012),
( 156, 10,'James Lenard ','2236 Central Park Dr ',' San Jose ','CA','95008','NORMAL',37.27586, -121.93877),
( 157, 11,'Leonard Nimoy ',' 805 Sweetbriar Dr ',' San Jose ','CA','95008','NORMAL',37.27553, -121.93867),
( 158, 12,'George Takei ',' 575 Cambrian Dr ',' San Jose ','CA','95008','NORMAL',37.27524, -121.93921),
( 159, 13,'Jean Luc Picard ',' 905 Sweetbriar Dr ',' San Jose ','CA','95008','NORMAL',37.27445, -121.93867),
( 160, 14,'Willian Riker ',' 515 Dallas Dr ',' San Jose ','CA','95008','NORMAL',37.27371, -121.94057),
( 176, 15,'Patrick Stewart ','1899 Cabana Dr ',' San Jose ','CA','95125','NORMAL',37.28738, -121.92073),
( 177, 16,'Jonathan Frakes ','2031 Hurst Ave',' San Jose ','CA','95125','NORMAL',37.28691, -121.91827),
( 178, 17,'Bervely Crusher ','2078 Hurst Ave',' San Jose ','CA','95125','NORMAL',37.28613, -121.91827),
( 179, 18,'Diana Troi ','1699 Cabana Dr ',' San Jose ','CA','95125','NORMAL',37.28770, -121.91677),
( 180, 19,'Whesley Crusher ','1974 Kocher Dr ',' San Jose ','CA','95125','NORMAL',37.28754, -121.91480),
( 262, 21,'James Cisko ','2435 Aragon Way',' San Jose ','CA','95125','NORMAL',37.27970, -121.90986),
( 263, 22,'Julian Bashir ','1690 Curtner Ave',' San Jose ','CA','95125','NORMAL',37.28147, -121.90946),
( 264, 23,'Jadzia Dax ','2349 La Mirada Dr ',' San Jose ','CA','95125','NORMAL',37.28128, -121.90878),
( 265, 24,'Katryn Janeway ','1749 Sweetbriar Dr ',' San Jose ','CA','95125','NORMAL',37.28202, -121.91039),
( 266, 25,'Bellana Torres ','2326 Briarwood Dr ',' San Jose ','CA','95125','NORMAL',37.28239, -121.90843),
( 267, 26,'Tom Parris ','1682 Curtner Ave',' San Jose ','CA','95125','NORMAL',37.28184, -121.90859),
( 368, 27,'Naomi Wilderman ','1933 Georgetta Dr ',' San Jose ','CA','95125','NORMAL',37.28537, -121.90861),
( 369, 28,'Zeffren Cockrane ','1874 Cherry Ave',' San Jose ','CA','95125','NORMAL',37.29144, -121.90176),
( 370, 29,'Jonh Sheridan ','1800 Nomark Ct ',' San Jose ','CA','95125','NORMAL',37.29228, -121.90326),
( 371, 30,'Michael Garibaldi','1974 Booksin Ave',' San Jose ','CA','95125','NORMAL',37.28708, -121.90645),
( 372, 31,'Ben Franklin ','1999 James Pl ',' San Jose ','CA','95125','NORMAL',37.28618, -121.90716),
( 373, 32,'Talia de Winters ','1832 Georgetta Dr ',' San Jose ','CA','95125','NORMAL',37.28630, -121.90652),
( 1007, 33,'Kosh Neranek ',' 399 Mayellen Ave',' San Jose ','CA','95126','NORMAL',37.32155, -121.92056),
( 1008, 34,'Zack Allan ',' 304 Buena Vista Ave',' San Jose ','CA','95126','NORMAL',37.32315, -121.91896),
( 1009, 35,'Lita Alexander ','1587 Scott St ',' San Jose ','CA','95126','NORMAL',37.31969, -121.92012),
( 1010, 36,'Susan Ivanova ',' 549 Mayellen Ave',' San Jose ','CA','95126','NORMAL',37.31893, -121.92056),
( 1011, 37,'Michael Bester ','1567 Scott St ',' San Jose ','CA','95126','NORMAL',37.31971, -121.91941),
( 1012, 38,'Fox Mulder ','1554 Scott St ',' San Jose ','CA','95126','NORMAL',37.31973, -121.91872),
( 1041, 39,'David Duchovny ',' 524 Julian St ',' San Jose ','CA','95110','NORMAL',37.33571, -121.90304),
( 1042, 40,'Danna Scully ',' 250 Autumn St ',' San Jose ','CA','95110','NORMAL',37.33560, -121.90212),
( 1043, 41,'David Skinner ',' 575 Santa Clara St ',' San Jose ','CA','95113','NORMAL',37.33196, -121.90182),
( 1044, 42,'Willian Boonne ',' 150 Autumn St ',' San Jose ','CA','95110','NORMAL',37.32836, -121.90033),
( 2127, 43,'Lilly Marquete ',' 849 Vine St ',' San Jose ','CA','95110','NORMAL',37.32102, -121.88525),
( 2128, 44,'James Sandoval ',' 224 West Virginia St ',' San Jose ','CA','95110','NORMAL',37.32189, -121.88520),
( 2129, 45,'Lian Kinkaid ',' 829 Almaden Ave',' San Jose ','CA','95110','NORMAL',37.32173, -121.88438),
( 2130, 46,'Samantha Carter ',' 149 West Virginia St ',' San Jose ','CA','95110','NORMAL',37.32258, -121.88397),
( 2131, 47,'Angela Cartwright',' 149 Sutter St ',' San Jose ','CA','95110','NORMAL',37.32194, -121.88341),
( 2132, 48,'June Lockhart ',' 274 Oak St ',' San Jose ','CA','95110','NORMAL',37.32008, -121.88525),
( 2154, 56,'Marcia Wallace ',' 500 Phelan Ave',' San Jose ','CA','95112','NORMAL',37.31710, -121.86046),
( 2155, 57,'Meggie Smith ','1718 Senter Rd ',' San Jose ','CA','95112','NORMAL',37.31816, -121.85821),
( 2156, 58,'Hank Azaria ',' 623 Nordale Ave',' San Jose ','CA','95112','NORMAL',37.31810, -121.85750),
( 2157, 59,'Paul Buchman ','1799 Welch Ave',' San Jose ','CA','95112','NORMAL',37.31771, -121.85643),
( 2158, 60,'Derek Whitestar ','1665 10th St ',' San Jose ','CA','95112','NORMAL',37.31624, -121.86285),
( 2159, 61,'Dorothy Lane ',' 375 Phelan Ave',' San Jose ','CA','95112','NORMAL',37.31526, -121.86319),
( 2160, 62,'Hemmet Brown ','1799 10th St ',' San Jose ','CA','95112','NORMAL',37.31422, -121.86088),
( 2161, 63,'Andrea Neal ','1803 Senter Rd ',' San Jose ','CA','95112','NORMAL',37.31710, -121.85720),
( 2162, 64,'James Oconor ',' 500 Needles Dr ',' San Jose ','CA','95112','NORMAL',37.31444, -121.85976),
( 2223, 49,'Billy Mummy ','1999 Senter Rd ',' San Jose ','CA','95112','NORMAL',37.31268, -121.85282),
( 2224, 50,'James Darren ',' 649 Palm St ',' San Jose ','CA','95110','NORMAL',37.32254, -121.88907),
( 2225, 51,'David Colbert ','1949 10th St ',' San Jose ','CA','95112','NORMAL',37.31275, -121.85934),
( 2226, 52,'Agnes Moghead ','1791 Monterey Hwy',' San Jose ','CA','95111','NORMAL',37.30961, -121.86740),
( 2227, 53,'Liz Montgomery ','1100 Algiers Ave',' San Jose ','CA','95122','NORMAL',37.32715, -121.84979),
( 2228, 54,'Dan Castanella ','1286 Clemence Ave',' San Jose ','CA','95122','NORMAL',37.32892, -121.85323),
( 2229, 55,'Nancy Cartwright ','1050 Walnut Woods Dr ',' San Jose ','CA','95122','NORMAL',37.32914, -121.85249),
( 3034, 65,'Idek Go ',' 350 7th St ',' San Jose ','CA','95112','NORMAL',37.33347, -121.88007),
( 3035, 66,'Kuai Chang Kaine ',' 225 Washington St ',' San Jose ','CA','95112','NORMAL',37.34497, -121.89078),
( 3036, 67,'Max Power ',' 350 6th St ',' San Jose ','CA','95112','NORMAL',37.34418, -121.88946),
( 3037, 68,'Homer Simpson ',' 375 Empire St ',' San Jose ','CA','95112','NORMAL',37.34856, -121.88916),
( 3038, 69,'Margie Simpson ',' 450 9th St ',' San Jose ','CA','95112','NORMAL',37.33337, -121.87709),
( 3039, 70,'Lisa Simpson ',' 425 Empire St ',' San Jose ','CA','95112','NORMAL',37.34904, -121.88811),
( 3084, 71,'Bart Simpson ',' 50 28th St ',' San Jose ','CA','95116','NORMAL',37.34791, -121.86358),
( 3085, 72,'Rafael Coss ','1337 Santa Clara St ',' San Jose ','CA','95116','NORMAL',37.34868, -121.86437),
( 3086, 73,'Bryan Patterson ',' 25 28th St ',' San Jose ','CA','95116','NORMAL',37.34835, -121.86390),
( 3087, 74,'Jean Ho ','1312 Santa Clara St ',' San Jose ','CA','95116','NORMAL',37.34856, -121.86464),
( 3088, 75,'Knut Stolze ','1329 Shortridge Ave',' San Jose ','CA','95116','NORMAL',37.34785, -121.86376),
( 4030, 76,'Claire Suttle ',' 949 Asbury St ',' San Jose ','CA','95126','NORMAL',37.33933, -121.91755),
( 4031, 77,'Andre Braga ',' 725 Elm St ',' San Jose ','CA','95126','NORMAL',37.33928, -121.91641),
( 4032, 78,'Tony Leung ','1074 Taylor St ',' San Jose ','CA','95126','NORMAL',37.33730, -121.91804),
( 4033, 79,'Cheung-Yuk ','1024 Taylor St ',' San Jose ','CA','95126','NORMAL',37.33779, -121.91734),
( 4034, 80,'Y. Morimoto ',' 650 Myrtle St ',' San Jose ','CA','95126','NORMAL',37.33755, -121.91671),
( 4035, 81,'Gery Mueckenbauer',' 849 Asbury St ',' San Jose ','CA','95126','NORMAL',37.34023, -121.91630),
( 4036, 82,'David Adler ',' 725 Laurel St ',' San Jose ','CA','95126','NORMAL',37.34017, -121.91515),
( 4037, 83,'Bob Shoberg ',' 849 Taylor St ',' San Jose ','CA','95126','NORMAL',37.33924, -121.91523),
( 4038, 84,'Laura Stewart ',' 949 Taylor St ',' San Jose ','CA','95126','NORMAL',37.33837, -121.91650),
( 4039, 85,'Soraia Alves ',' 650 Elm St ',' San Jose ','CA','95126','NORMAL',37.33842, -121.91548),
( 4097, 86,'Graziela Kunde ','1169 Vanessa Dr ',' San Jose ','CA','95126','NORMAL',37.30292, -121.91820),
( 4099, 88,'Nelson Mattos ','1824 Willow St ',' San Jose ','CA','95125','NORMAL',37.30075, -121.91869),
( 4100, 89,'Marilene Noronha ','1788 Isabel Dr ',' San Jose ','CA','95125','NORMAL',37.30080, -121.91825),
( 4101, 90,'Carla Nunes ','1416 Saint Francis Dr ',' San Jose ','CA','95125','NORMAL',37.30036, -121.91787),
( 4102, 91,'G.Sauaressig ','1699 Santa Barbara Dr ',' San Jose ','CA','95125','NORMAL',37.29984, -121.91567),
( 4430, 93,'Steven Elliott ','1258 Willowhaven Dr ',' San Jose ','CA','95126','NORMAL',37.30593, -121.91860),
( 4431, 94,'James Taylor ',' 942 St Elizabeth Dr ',' San Jose ','CA','95126','NORMAL',37.30721, -121.91648),
( 4432, 95,'Al Jarreau ','2323 Gunar Dr ',' San Jose ','CA','95124','NORMAL',37.27923, -121.92646),
( 4433, 96,'Diana Krall ',' 766 Malone Rd ',' San Jose ','CA','95125','NORMAL',37.29723, -121.88158),
( 4434, 97,'Gari Robinson ','2049 Delbarr Ct ',' San Jose ','CA','95125','NORMAL',37.29725, -121.88131),
( 4436, 99,'Angela Dima ',' 359 Shadow Run Dr ',' San Jose ','CA','95110','NORMAL',37.31034, -121.88066),
( 4437, 100,'Shannon Fargusson','1225 Willowhaven Dr ',' San Jose ','CA','95126','NORMAL',37.30593, -121.91802)
;
-- end of CUSTOMER DATA
--==========================================================================
-- ACCOUNT DATA
--==========================================================================
INSERT INTO se_demo.accounts(
ACCOUNT_ID, CUSTOMER_ID, BRANCH_ID, TYPE, BALANCE, ROUTING_NUMBER) VALUES
( 100, 124,1,'Checking', 2363.255132,1100),
( 101, 125,2,'Checking', 2885.789723,1101),
( 102, 126,1,'Checking', 863.7858514,1102),
( 103, 127,1,'Checking', 376.3056556,1103),
( 104, 135,1,'Checking', 1335.755385,1104),
( 105, 136,1,'Checking', 1522.425684,1105),
( 107, 138,1,'Checking', 1285.902569,1107),
( 108, 139,1,'Checking', 3260.161556,1108),
( 109, 156,1,'Checking', 2919.795841,1109),
( 110, 157,1,'Checking', 1073.549577,1110),
( 111, 158,1,'Checking', 1225.286351,1111),
( 112, 159,1,'Checking', 389.7738339,1112),
( 113, 160,1,'Checking', 182.9277962,1113),
( 114, 176,2,'Checking', 812.2161706,1114),
( 115, 177,1,'Checking', 2329.205387,1115),
( 116, 178,2,'Checking', 332.32188,1116),
( 117, 179,2,'Checking', 2718.337876,1117),
( 118, 180,1,'Checking', 1188.955105,1118),
( 120, 262,1,'Checking', 2427.166818,1120),
( 121, 263,1,'Checking', 1933.819423,1121),
( 122, 264,1,'Checking', 549.3841173,1122),
( 123, 265,1,'Checking', 2429.47217,1123),
( 124, 266,1,'Checking', 1940.300551,1124),
( 125, 267,1,'Checking', 1683.467949,1125),
( 126, 368,1,'Checking', 1206.174575,1126),
( 127, 369,1,'Checking', 768.6893814,1127),
( 128, 370,2,'Checking', 1129.363835,1128),
( 129, 371,1,'Checking', 1418.82726,1129),
( 130, 372,1,'Checking', 1674.021154,1130),
( 131, 373,1,'Checking', 2477.973427,1131),
( 132,1007,1,'Checking', 370.7056947,1132),
( 133,1008,1,'Checking', 116.1817531,1133),
( 134,1009,1,'Checking', 520.6105051,1134),
( 135,1010,1,'Checking', 195.6016937,1135),
( 136,1011,1,'Checking', 106.0564091,1136),
( 138,1041,1,'Checking', 539.2325158,1138),
( 139,1042,1,'Checking', 101.1402553,1139),
( 140,1043,1,'Checking', 950.7055043,1140),
( 141,1044,1,'Checking', 575.4253339,1141),
( 142,2127,1,'Checking', 345.6576006,1142),
( 143,2128,2,'Checking', 235.6670355,1143),
( 144,2129,2,'Checking', 345.3365138,1144),
( 145,2130,2,'Checking', 137.687037,1145),
( 146,2131,1,'Checking', 100.7461097,1146),
( 147,2132,1,'Checking', 686.8912253,1147),
( 148,2223,2,'Checking', 57.94033953,1148),
( 149,2224,2,'Checking', 209.6814143,1149),
( 150,2225,2,'Checking', 272.993464,1150),
( 151,2226,1,'Checking', 273.1754423,1151),
( 152,2227,2,'Checking', 155.3547925,1152),
( 153,2228,1,'Checking', 269.5428597,1153),
( 154,2229,1,'Checking', 151.1208164,1154),
( 155,2154,2,'Checking', 8.275955916,1155),
( 156,2155,2,'Checking', 227.8439034,1156),
( 157,2156,2,'Checking', 351.6053223,1157),
( 158,2157,2,'Checking', 175.8251799,1158),
( 159,2158,2,'Checking', 636.3168721,1159),
( 160,2159,2,'Checking', 808.5135018,1160),
( 161,2160,2,'Checking', 322.3511567,1161),
( 162,2161,1,'Checking', 113.6516125,1162),
( 163,2162,2,'Checking', 634.4714832,1163),
( 164,3034,2,'Checking', 803.0728587,1164),
( 165,3035,2,'Checking', 1374.49218,1165),
( 166,3036,2,'Checking', 737.7980341,1166),
( 167,3037,1,'Checking', 880.1150966,1167),
( 168,3038,2,'Checking', 1714.550973,1168),
( 169,3039,1,'Checking', 1296.540013,1169),
( 170,3084,2,'Checking', 935.6609093,1170),
( 171,3085,2,'Checking', 534.2058106,1171),
( 172,3086,2,'Checking', 416.365382,1172),
( 173,3087,2,'Checking', 1222.481322,1173),
( 174,3088,2,'Checking', 1234.423716,1174),
( 175,4030,1,'Checking', 342.3687716,1175),
( 176,4031,1,'Checking', 219.8221082,1176),
( 177,4032,1,'Checking', 821.8153705,1177),
( 178,4033,1,'Checking', 333.0223163,1178),
( 179,4034,1,'Checking', 78.67911241,1179),
( 180,4035,1,'Checking', 692.0828828,1180),
( 181,4036,1,'Checking', 1465.075807,1181),
( 182,4037,1,'Checking', 1823.983833,1182),
( 183,4038,1,'Checking', 733.0881632,1183),
( 184,4039,1,'Checking', 1100.820315,1184),
( 185,4097,1,'Checking', 38.94935605,1185),
( 186,4099,1,'Checking', 150.0550955,1186),
( 187,4100,1,'Checking', 159.8017401,1187),
( 188,4101,1,'Checking', 363.2827794,1188),
( 189,4102,1,'Checking', 1242.323194,1189),
( 191,4430,1,'Checking', 240.9412472,1191),
( 192,4431,1,'Checking', 393.6994475,1192),
( 193,4432,1,'Checking', 873.6447408,1193),
( 194,4433,1,'Checking', 849.881861,1194),
( 195,4434,1,'Checking', 920.8499389,1195),
( 197,4436,1,'Checking', 769.2452027,1197),
( 198,4437,1,'Checking', 203.4685531,1198),
( 199, 124,1,'Saving', 25947.23173,1199),
( 200, 125,2,'Saving', 204755.0108,1200),
( 201, 126,1,'Saving', 114390.855,1201),
( 202, 127,1,'Saving', 202659.7704,1202),
( 203, 135,1,'Saving', 105370.5459,1203),
( 204, 136,1,'Saving', 16331.64918,1204),
( 206, 138,1,'Saving', 77485.47104,1206),
( 207, 139,1,'Saving', 101003.4193,1207),
( 208, 156,1,'Saving', 30627.54354,1208),
( 209, 157,1,'Saving', 84310.68934,1209),
( 210, 158,1,'Saving', 95724.16915,1210),
( 211, 159,1,'Saving', 58738.6481,1211),
( 212, 160,1,'Saving', 33947.76889,1212),
( 213, 176,2,'Saving', 50009.22738,1213),
( 214, 177,1,'Saving', 53839.09653,1214),
( 215, 178,2,'Saving', 37252.65724,1215),
( 216, 179,2,'Saving', 38832.03591,1216),
( 217, 180,1,'Saving', 157923.6088,1217),
( 219, 262,1,'Saving', 161690.7533,1219),
( 220, 263,1,'Saving', 60963.05602,1220),
( 221, 264,1,'Saving', 129716.7982,1221),
( 222, 265,1,'Saving', 146258.3654,1222),
( 223, 266,1,'Saving', 189802.0553,1223),
( 224, 267,1,'Saving', 224976.7577,1224),
( 225, 368,1,'Saving', 39103.89544,1225),
( 226, 369,1,'Saving', 46182.78934,1226),
( 227, 370,2,'Saving', 45155.12824,1227),
( 228, 371,1,'Saving', 118843.0557,1228),
( 229, 372,1,'Saving', 146979.6841,1229),
( 230, 373,1,'Saving', 79742.70174,1230),
( 231,1007,1,'Saving', 18766.24436,1231),
( 232,1008,1,'Saving', 56978.37152,1232),
( 233,1009,1,'Saving', 39892.98345,1233),
( 234,1010,1,'Saving', 14340.12927,1234),
( 235,1011,1,'Saving', 24524.27683,1235),
( 236,1012,2,'Saving', 30944.41188,1236),
( 237,1041,1,'Saving', 39186.16525,1237),
( 238,1042,1,'Saving', 17185.41623,1238),
( 239,1043,1,'Saving', 59682.25556,1239),
( 240,1044,1,'Saving', 7648.203145,1240),
( 241,2127,1,'Saving', 13560.58125,1241),
( 242,2128,2,'Saving', 14369.43733,1242),
( 243,2129,2,'Saving', 36340.46654,1243),
( 244,2130,2,'Saving', 14979.87798,1244),
( 245,2131,1,'Saving', 14515.74201,1245),
( 246,2132,1,'Saving', 305.3633823,1246),
( 247,2223,2,'Saving', 12417.23338,1247),
( 248,2224,2,'Saving', 39457.64595,1248),
( 249,2225,2,'Saving', 23017.44714,1249),
( 250,2226,1,'Saving', 7742.484165,1250),
( 251,2227,2,'Saving', 17624.66363,1251),
( 252,2228,1,'Saving', 1535.394306,1252),
( 253,2229,1,'Saving', 1226.676885,1253),
( 254,2154,2,'Saving', 22547.57602,1254),
( 255,2155,2,'Saving', 12486.17339,1255),
( 256,2156,2,'Saving', 38364.90976,1256),
( 257,2157,2,'Saving', 1734.126161,1257),
( 258,2158,2,'Saving', 60251.94392,1258),
( 259,2159,2,'Saving', 46657.42166,1259),
( 260,2160,2,'Saving', 9505.175495,1260),
( 261,2161,1,'Saving', 32381.25655,1261),
( 262,2162,2,'Saving', 34863.35359,1262),
( 263,3034,2,'Saving', 48563.18138,1263),
( 264,3035,2,'Saving', 48493.01592,1264),
( 265,3036,2,'Saving', 173101.6616,1265),
( 266,3037,1,'Saving', 88026.78844,1266),
( 267,3038,2,'Saving', 143707.0279,1267),
( 268,3039,1,'Saving', 99494.98056,1268),
( 269,3084,2,'Saving', 88987.75075,1269),
( 270,3085,2,'Saving', 25567.8175,1270),
( 271,3086,2,'Saving', 112184.2155,1271),
( 272,3087,2,'Saving', 168562.1903,1272),
( 273,3088,2,'Saving', 185847.5828,1273),
( 274,4030,1,'Saving', 44559.8743,1274),
( 275,4031,1,'Saving', 26054.6617,1275),
( 276,4032,1,'Saving', 58280.98421,1276),
( 277,4033,1,'Saving', 33446.0035,1277),
( 278,4034,1,'Saving', 88012.34913,1278),
( 279,4035,1,'Saving', 84526.49687,1279),
( 280,4036,1,'Saving', 78822.73393,1280),
( 281,4037,1,'Saving', 10788.06735,1281),
( 282,4038,1,'Saving', 101492.5752,1282),
( 283,4039,1,'Saving', 21233.41511,1283),
( 284,4097,1,'Saving', 77413.15157,1284),
( 285,4099,1,'Saving', 84883.84174,1285),
( 286,4100,1,'Saving', 69186.40003,1286),
( 287,4101,1,'Saving', 28291.18589,1287),
( 288,4102,1,'Saving', 21900.57646,1288),
( 290,4430,1,'Saving', 22028.39868,1290),
( 291,4431,1,'Saving', 69694.60985,1291),
( 292,4432,1,'Saving', 70770.24328,1292),
( 293,4433,1,'Saving', 52412.67197,1293),
( 294,4434,1,'Saving', 61382.88758,1294),
( 296,4436,1,'Saving', 46565.86445,1296),
( 297,4437,1,'Saving', 78073.61351,1297);
-- end of ACCOUNT DATA
--==========================================================================
-- TRANSACTION DATA
--==========================================================================
INSERT INTO se_demo.transactions(
TRANSACTION_ID, TRANSACTION_DATE, ACCOUNT_ID, AMOUNT) VALUES
( 200,'6/9/1999', 100,410.0649),
( 203,'3/16/1999', 101,134.6683),
( 206,'5/8/2000', 102,128.8427),
( 209,'2/14/1999', 103,55.29605),
( 212,'5/24/2000', 104, 246.328),
( 215,'1/20/2000', 105,217.8844),
( 221,'6/15/2000', 107,249.6642),
( 224,'6/2/1999', 108,120.8983),
( 227,'2/27/1999', 109,116.1058),
( 230,'2/6/1999', 110,187.5347),
( 233,'6/23/2000', 111,48.13646),
( 236,'5/27/1999', 112,26.88456),
( 239,'4/4/1999', 113,7.963927),
( 242,'12/14/1999', 114,6.796708),
( 245,'6/17/2000', 115,59.15062),
( 248,'1/20/2000', 116,16.10502),
( 251,'10/3/1999', 117,513.2409),
( 254,'10/4/1999', 118,136.2889),
( 260,'6/28/2000', 120,421.2396),
( 263,'5/10/1999', 121,186.4202),
( 266,'5/23/2000', 122,102.4402),
( 269,'12/19/1999', 123, 248.581),
( 272,'7/22/1999', 124, 226.448),
( 275,'11/2/2000', 125,48.19283),
( 278,'8/20/1999', 126, 228.173),
( 281,'10/3/1999', 127,68.18768),
( 284,'1/3/1999', 128,31.63948),
( 287,'6/22/1999', 129,256.2542),
( 290,'11/28/1999', 130,19.16289),
( 293,'11/16/2000', 131,162.1792),
( 296,'7/26/1999', 132,3.779025),
( 299,'2/17/1999', 133,18.46187),
( 302,'4/24/2000', 134,25.31652),
( 305,'1/1/2000', 135,4.483854),
( 308,'7/2/2000', 136,18.33536),
( 314,'10/17/1999', 138,21.03512),
( 317,'1/21/1999', 139,15.50602),
( 320,'7/20/1999', 140, 114.246),
( 323,'11/8/2000', 141,16.60923),
( 326,'8/24/1999', 142,40.86036),
( 329,'5/22/1999', 143,44.24424),
( 332,'4/1/1999', 144,14.28121),
( 335,'11/6/2000', 145,25.39269),
( 338,'11/28/2000', 146,6.341318),
( 341,'1/10/2000', 147,7.487512),
( 344,'9/12/1999', 148,5.611813),
( 347,'2/1/1999', 149,11.63708),
( 350,'4/13/1999', 150,26.33636),
( 353,'1/19/1999', 151, 26.9734),
( 356,'9/18/1999', 152, 26.3779),
( 359,'10/26/1999', 153,44.01659),
( 362,'2/20/1999', 154,3.055476),
( 365,'6/4/2000', 155,0.088982),
( 368,'11/27/2000', 156,8.333825),
( 371,'5/6/2000', 157,22.51631),
( 374,'3/21/1999', 158,29.04578),
( 377,'1/23/2000', 159,26.38774),
( 380,'10/18/1999', 160,92.33102),
( 383,'12/24/1999', 161,59.83667),
( 386,'2/8/1999', 162,8.266304),
( 389,'3/17/2000', 163,101.5791),
( 392,'11/5/2000', 164,150.8449),
( 395,'9/25/1999', 165,228.3387),
( 398,'7/24/2000', 166,121.3898),
( 401,'4/16/1999', 167,78.65684),
( 404,'7/19/2000', 168,266.9651),
( 407,'2/7/2000', 169,34.14283),
( 410,'2/4/1999', 170,62.29798),
( 413,'4/11/2000', 171,75.89482),
( 416,'8/5/2000', 172,48.03834),
( 419,'2/11/1999', 173,176.7392),
( 422,'3/15/2000', 174,129.5668),
( 425,'12/6/1999', 175,23.25297),
( 428,'8/20/2000', 176,14.07896),
( 431,'7/12/2000', 177,39.66607),
( 434,'5/9/1999', 178, 22.162),
( 437,'12/9/2000', 179,0.869688),
( 440,'9/12/1999', 180,138.2647),
( 446,'7/24/1999', 182,225.1657),
( 449,'5/7/2000', 183,12.54472),
( 452,'2/18/1999', 184,110.9305),
( 455,'5/12/2000', 185,4.345138),
( 458,'8/27/1999', 186,8.993184),
( 461,'6/16/2000', 187, 6.36054),
( 464,'5/25/2000', 188,52.51078),
( 467,'7/22/2000', 189,25.45362),
( 473,'11/2/2000', 191,40.43505),
( 476,'8/20/1999', 192,5.576618),
( 479,'11/13/1999', 193,133.9944),
( 482,'9/20/2000', 194,109.4392),
( 485,'7/4/2000', 195,84.65599),
( 491,'2/6/1999', 197,16.62518),
( 494,'8/9/2000', 198, 19.734),
( 497,'7/1/1999', 199,4172.654),
( 500,'5/14/1999', 200,38353.48),
( 503,'4/12/1999', 201,6068.544),
( 506,'4/16/1999', 202,11277.34),
( 509,'12/12/1999', 203,15628.58),
( 512,'5/23/2000', 204,1544.129),
( 518,'1/24/2000', 206, 134.573),
( 521,'12/25/1999', 207,9989.299),
( 524,'3/10/2000', 208,4443.906),
( 527,'4/2/1999', 209,1784.336),
( 530,'2/20/1999', 210, 8814.86),
( 533,'4/3/2000', 211,1133.963),
( 536,'12/4/2000', 212,1321.064),
( 539,'12/2/1999', 213,1134.468),
( 542,'9/11/2000', 214,1791.388),
( 545,'5/22/2000', 215,611.6733),
( 548,'3/1/2000', 216,3846.393),
( 551,'1/14/1999', 217,5136.206),
( 557,'4/14/1999', 219,1806.315),
( 560,'11/27/2000', 220,9556.921),
( 563,'9/7/2000', 221,5052.018),
( 566,'8/24/2000', 222,19897.25),
( 569,'8/10/1999', 223,20643.46),
( 572,'5/19/1999', 224,1010.197),
( 575,'7/26/1999', 225,5505.485),
( 578,'2/4/2000', 226,7053.833),
( 581,'9/14/1999', 227,3386.158),
( 584,'7/24/1999', 228,13494.65),
( 587,'12/21/1999', 229,2740.613),
( 590,'4/25/1999', 230, 13284.4),
( 593,'3/24/1999', 231,2445.456),
( 596,'9/23/1999', 232,1760.232),
( 599,'12/5/2000', 233,1687.219),
( 602,'7/11/2000', 234,115.0738),
( 605,'2/8/2000', 235,1271.798),
( 608,'11/20/1999', 236,4541.155),
( 611,'4/15/1999', 237, 3677.7),
( 614,'1/17/1999', 238,2795.182),
( 617,'5/17/2000', 239,774.5752),
( 620,'4/20/2000', 240,782.5478),
( 623,'2/18/1999', 241,1436.765),
( 626,'1/1/2000', 242,2771.544),
( 629,'11/19/1999', 243,3420.935),
( 632,'1/7/2000', 244,2231.038),
( 635,'9/9/1999', 245,2025.772),
( 638,'10/25/2000', 246,9.387454),
( 641,'12/18/2000', 247,1969.252),
( 644,'3/15/1999', 248,6195.007),
( 647,'10/1/2000', 249,4103.657),
( 650,'11/9/1999', 250,1359.439),
( 653,'4/17/1999', 251,530.9645),
( 656,'5/28/2000', 252,171.7705),
( 659,'3/25/2000', 253,190.8625),
( 662,'1/22/2000', 254,2765.804),
( 665,'10/7/2000', 255, 1720.33),
( 668,'2/11/1999', 256,6441.007),
( 671,'6/23/1999', 257,121.6101),
( 674,'7/24/1999', 258,9957.765),
( 677,'10/5/1999', 259,6853.639),
( 680,'4/28/1999', 260,726.6378),
( 683,'11/9/2000', 261, 769.309),
( 686,'2/7/1999', 262,5860.827),
( 689,'5/5/2000', 263,1754.494),
( 692,'3/17/2000', 264,2713.556),
( 695,'12/19/1999', 265,417.2778),
( 698,'7/20/1999', 266, 10273.4),
( 701,'8/11/1999', 267,4018.836),
( 704,'8/24/2000', 268,9078.658),
( 707,'3/21/2000', 269,16283.33),
( 710,'12/8/1999', 270, 3269.45),
( 713,'6/14/1999', 271,10040.68),
( 716,'11/24/2000', 272,6451.387),
( 719,'11/17/1999', 273,22634.37),
( 722,'12/22/2000', 274,6310.148),
( 725,'5/17/1999', 275,5195.875),
( 728,'12/22/1999', 276, 9716.49),
( 731,'11/21/2000', 277,6015.548),
( 734,'9/8/2000', 278,2858.153),
( 737,'12/21/1999', 279,14701.36),
( 740,'4/17/1999', 280,13436.15),
( 743,'12/4/2000', 281,1437.694),
( 746,'9/2/2000', 282,5929.765),
( 749,'9/28/2000', 283,851.2012),
( 752,'10/18/1999', 284,11199.08),
( 755,'7/6/2000', 285,867.0179),
( 758,'12/3/2000', 286,10766.49),
( 761,'9/4/2000', 287,4060.866),
( 764,'11/10/1999', 288,2868.957),
( 770,'6/13/1999', 290,3921.282),
( 773,'6/6/1999', 291,5691.669),
( 776,'10/22/2000', 292,5842.467),
( 779,'8/8/2000', 293,995.6348),
( 782,'10/19/1999', 294,164.2341),
( 788,'10/6/1999', 296,3120.884),
( 791,'5/24/2000', 297,4215.467),
( 794,'10/16/1999', 100,265.6453),
( 797,'8/19/1999', 101,539.0321),
( 800,'11/13/1999', 102,78.76525),
( 803,'11/9/2000', 103,68.03113),
( 806,'11/21/1999', 104,200.9549),
( 809,'3/24/1999', 105,215.4605),
( 815,'5/2/1999', 107,66.71727),
( 818,'6/9/2000', 108,623.4824),
( 821,'5/6/1999', 109,109.9385),
( 824,'6/24/2000', 110,32.86801),
( 827,'8/26/2000', 111,151.9085),
( 830,'1/26/2000', 112,11.68539),
( 833,'4/19/1999', 113,13.75836),
( 836,'10/6/2000', 114,80.53244),
( 839,'6/26/1999', 115, 20.9271),
( 842,'4/1/2000', 116,26.76104),
( 845,'1/16/2000', 117,278.6843),
( 848,'12/19/1999', 118,109.5831),
( 854,'9/8/2000', 120,161.5764),
( 857,'4/20/1999', 121,49.81852),
( 860,'11/7/1999', 122, 26.4448),
( 863,'10/27/2000', 123, 436.118),
( 866,'4/11/2000', 124,46.06044),
( 869,'4/23/2000', 125,305.0076),
( 872,'10/9/1999', 126,232.3231),
( 875,'8/2/1999', 127, 61.2963),
( 878,'3/14/2000', 128,205.2637),
( 881,'9/19/2000', 129,34.73888),
( 884,'1/14/2000', 130,170.3945),
( 887,'1/19/1999', 131,241.7908),
( 890,'1/9/2000', 132,50.60082),
( 893,'11/14/1999', 133,22.68992),
( 896,'2/6/2000', 134, 26.9585),
( 899,'8/7/1999', 135,38.72871),
( 902,'6/26/1999', 136,18.99279),
( 908,'5/1/1999', 138,95.14236),
( 911,'10/4/2000', 139,6.336616),
( 914,'11/9/2000', 140,138.0959),
( 917,'2/26/2000', 141,2.088899),
( 920,'6/12/2000', 142,32.59317),
( 923,'2/5/1999', 143, 22.6203),
( 926,'4/11/1999', 144, 35.478),
( 929,'6/21/2000', 145,27.32847),
( 932,'7/19/1999', 146,14.01379),
( 935,'1/11/1999', 147,98.60913),
( 938,'10/1/2000', 148,7.594179),
( 941,'4/17/1999', 149,14.74927),
( 944,'9/14/1999', 150,17.64516),
( 947,'10/21/2000', 151,8.414119),
( 950,'2/3/2000', 152,21.81273),
( 953,'5/24/2000', 153,45.43275),
( 956,'3/28/2000', 154,2.890876),
( 959,'5/27/1999', 155,0.941372),
( 962,'1/8/1999', 156,36.43327),
( 965,'4/19/2000', 157,22.75757),
( 968,'4/23/1999', 158, 18.3028),
( 971,'6/8/1999', 159,111.2169),
( 974,'8/25/2000', 160,144.8827),
( 977,'12/3/2000', 161,41.74191),
( 980,'12/3/2000', 162,20.86361),
( 983,'8/10/2000', 163,84.66857),
( 986,'2/9/2000', 164, 23.4569),
( 989,'10/21/1999', 165,141.7547),
( 992,'7/23/1999', 166,77.80529),
( 995,'12/24/2000', 167,111.2804),
( 998,'10/26/1999', 168,333.6068),
(1001,'2/6/2000', 169,197.2564),
(1004,'6/15/1999', 170,14.14601),
(1007,'9/16/1999', 171,65.91726),
(1010,'1/10/1999', 172,35.38287),
(1013,'3/19/1999', 173,41.68522),
(1016,'2/5/1999', 174,157.0025),
(1019,'7/28/2000', 175,49.59643),
(1022,'1/13/2000', 176,30.31786),
(1025,'1/17/2000', 177,126.8564),
(1028,'6/22/2000', 178,7.913088),
(1031,'4/16/2000', 179,0.261574),
(1034,'10/23/1999', 180,64.25004),
(1040,'10/7/2000', 182,29.98905),
(1043,'8/1/2000', 183,83.81477),
(1046,'4/9/1999', 184,96.80246),
(1049,'9/23/1999', 185,2.654964),
(1052,'2/8/2000', 186,12.90884),
(1055,'3/22/2000', 187,18.68655),
(1058,'2/19/1999', 188,25.10699),
(1061,'4/12/1999', 189,230.6099),
(1067,'2/17/1999', 191,25.50788),
(1070,'10/15/2000', 192,66.20551),
(1073,'8/16/1999', 193,145.7211),
(1076,'9/6/1999', 194,129.9411),
(1079,'6/20/2000', 195,5.229966),
(1085,'7/22/1999', 197,110.2286),
(1088,'12/8/2000', 198,27.85117),
(1091,'1/22/1999', 199,4147.848),
(1094,'2/2/1999', 200,40630.21),
(1097,'3/26/2000', 201,6341.582),
(1100,'5/27/2000', 202,19718.14),
(1103,'1/7/2000', 203,20412.81),
(1106,'11/27/2000', 204,98.19314),
(1112,'1/11/1999', 206,9746.122),
(1115,'2/28/2000', 207,12884.93),
(1118,'6/21/1999', 208,3053.719),
(1121,'8/1/2000', 209,3781.076),
(1124,'11/22/2000', 210,8038.879),
(1127,'9/16/2000', 211, 354.355),
(1130,'12/19/2000', 212,3048.593),
(1133,'6/4/2000', 213,9616.066),
(1136,'8/1/2000', 214, 4383.46),
(1139,'9/18/2000', 215,1728.502),
(1142,'9/18/1999', 216,5088.025),
(1145,'8/23/1999', 217,8403.177),
(1151,'11/14/1999', 219, 7516.24),
(1154,'2/14/2000', 220,10618.38),
(1157,'3/7/1999', 221,4955.935),
(1160,'4/18/1999', 222,8996.822),
(1163,'1/4/1999', 223,31032.86),
(1166,'2/5/2000', 224,42096.04),
(1169,'5/12/1999', 225,3026.361),
(1172,'10/20/2000', 226,5415.512),
(1175,'2/6/2000', 227,3518.782),
(1178,'7/11/1999', 228,18853.91),
(1181,'8/26/2000', 229,14540.79),
(1184,'2/12/2000', 230,3190.184),
(1187,'12/25/1999', 231,2644.192),
(1190,'4/22/1999', 232,2037.797),
(1193,'9/11/2000', 233,3369.338),
(1196,'7/2/1999', 234,1695.653),
(1199,'10/3/2000', 235,3178.529),
(1202,'2/5/1999', 236,3617.337),
(1205,'11/12/1999', 237,3787.433),
(1208,'7/20/1999', 238,1108.258),
(1211,'2/13/2000', 239,10837.12),
(1214,'8/19/1999', 240,1089.209),
(1217,'10/16/1999', 241,1176.584),
(1220,'7/21/1999', 242,2316.119),
(1223,'11/17/1999', 243,991.6162),
(1226,'11/3/2000', 244, 393.124),
(1229,'5/8/2000', 245,2604.353),
(1232,'8/16/1999', 246,25.90977),
(1235,'12/2/1999', 247,1787.568),
(1238,'9/1/2000', 248, 2377.79),
(1241,'4/2/1999', 249,1698.527),
(1244,'8/23/2000', 250,1267.302),
(1247,'6/20/2000', 251,2808.839),
(1250,'1/3/1999', 252,20.07844),
(1253,'10/5/2000', 253,88.35182),
(1256,'9/8/1999', 254,69.99725),
(1259,'11/25/2000', 255,1633.452),
(1262,'12/5/2000', 256,1299.553),
(1265,'9/20/2000', 257,197.3139),
(1268,'9/22/2000', 258,6281.389),
(1271,'4/23/2000', 259,4748.887),
(1274,'11/15/1999', 260,414.1412),
(1277,'10/4/2000', 261,4661.834),
(1280,'10/4/1999', 262,4974.991),
(1283,'6/6/2000', 263,4678.143),
(1286,'1/22/2000', 264,5313.296),
(1289,'3/19/1999', 265,19422.03),
(1292,'9/26/1999', 266,14053.36),
(1295,'10/7/2000', 267,21816.82),
(1298,'3/11/2000', 268, 1338.64),
(1301,'12/25/1999', 269,15786.09),
(1304,'8/4/2000', 270,1279.132),
(1307,'3/12/2000', 271,19843.18),
(1310,'3/17/1999', 272,30949.97),
(1313,'11/27/1999', 273,17072.19),
(1316,'8/13/1999', 274,509.6888),
(1319,'8/13/2000', 275, 4630.61),
(1322,'12/5/2000', 276,5630.218),
(1325,'9/25/2000', 277,6595.324),
(1328,'6/7/1999', 278,6732.644),
(1331,'12/8/1999', 279,9735.542),
(1334,'12/26/1999', 280,15728.74),
(1337,'4/4/1999', 281,1957.673),
(1340,'8/7/1999', 282,2560.619),
(1343,'3/17/2000', 283,474.9938),
(1346,'6/19/1999', 284,10766.51),
(1349,'7/12/2000', 285,11223.75),
(1352,'10/3/2000', 286,1553.378),
(1355,'12/25/1999', 287,4076.504),
(1358,'11/26/2000', 288,3494.722),
(1364,'4/24/2000', 290,1376.821),
(1367,'8/14/2000', 291,5235.508),
(1370,'9/23/1999', 292,190.3102),
(1373,'6/26/2000', 293,2735.294),
(1376,'6/2/2000', 294,10877.28),
(1382,'4/7/1999', 296, 9086.92),
(1385,'2/26/2000', 297,9702.064),
(1388,'3/12/1999', 100,188.7422),
(1391,'12/26/2000', 101,576.3459),
(1394,'2/24/1999', 102,67.87226),
(1397,'11/27/1999', 103,49.16274),
(1400,'3/2/2000', 104,152.5284),
(1403,'8/22/1999', 105,138.3044),
(1409,'8/5/1999', 107,24.79981),
(1412,'6/25/2000', 108,160.5938),
(1415,'6/18/1999', 109,56.72258),
(1418,'8/20/1999', 110,36.32044),
(1421,'2/17/2000', 111,131.5891),
(1424,'2/19/2000', 112,64.13718),
(1427,'8/26/2000', 113,15.60056),
(1430,'12/21/1999', 114,2.275107),
(1433,'5/23/2000', 115,353.9784),
(1436,'4/2/2000', 116,59.10805),
(1439,'4/3/1999', 117,117.4123),
(1442,'10/20/2000', 118,44.62285),
(1448,'11/8/1999', 120,482.0618),
(1451,'12/1/2000', 121,0.158674),
(1454,'2/6/2000', 122,26.42557),
(1457,'8/15/2000', 123,86.99796),
(1460,'3/14/1999', 124,245.3788),
(1463,'2/15/1999', 125,81.07891),
(1466,'9/8/2000', 126,47.85189),
(1469,'2/16/2000', 127,50.21799),
(1472,'11/23/2000', 128, 47.351),
(1475,'6/22/2000', 129,12.46757),
(1478,'4/24/1999', 130,237.2425),
(1481,'3/25/2000', 131,186.9159),
(1484,'6/2/1999', 132,18.42853),
(1487,'8/27/1999', 133,7.432432),
(1490,'7/15/2000', 134,60.26388),
(1493,'8/10/2000', 135,16.37941),
(1496,'10/2/2000', 136,4.143121),
(1502,'10/8/1999', 138,7.242031),
(1505,'8/24/2000', 139,14.24114),
(1508,'8/9/2000', 140,91.99023),
(1511,'7/1/1999', 141, 70.151),
(1514,'3/13/2000', 142,46.92224),
(1517,'6/27/2000', 143,4.914297),
(1520,'9/14/2000', 144,12.68786),
(1523,'3/18/1999', 145,9.831023),
(1526,'12/14/2000', 146,7.424878),
(1529,'6/24/1999', 147,26.91243),
(1532,'4/14/2000', 148,1.705627),
(1535,'2/20/1999', 149, 31.3328),
(1538,'7/28/1999', 150, 54.4283),
(1541,'12/3/1999', 151,30.67218),
(1544,'10/11/1999', 152, 22.6467),
(1547,'3/18/2000', 153,24.05183),
(1550,'3/15/1999', 154, 28.5632),
(1553,'8/7/1999', 155,0.826164),
(1556,'11/23/1999', 156,9.920162),
(1559,'8/21/1999', 157,14.64077),
(1562,'3/17/1999', 158,32.81727),
(1565,'3/25/1999', 159,66.04171),
(1568,'6/24/1999', 160, 112.243),
(1571,'7/2/2000', 161,18.21168),
(1574,'4/27/2000', 162,10.61284),
(1577,'10/19/1999', 163,83.85694),
(1580,'12/10/2000', 164, 52.8986),
(1583,'12/28/2000', 165,211.4837),
(1586,'11/4/1999', 166,97.49797),
(1589,'10/20/1999', 167,53.01525),
(1592,'10/14/1999', 168,46.53771),
(1595,'5/22/1999', 169,15.11523),
(1598,'5/25/2000', 170,127.9403),
(1601,'5/25/1999', 171,77.36744),
(1604,'6/9/1999', 172,78.45289),
(1607,'9/8/1999', 173,178.9362),
(1610,'6/3/2000', 174,190.9741),
(1613,'7/22/2000', 175,6.944259),
(1616,'12/27/2000', 176, 9.10269),
(1619,'4/26/2000', 177,101.4788),
(1622,'6/11/2000', 178, 50.6176),
(1625,'11/19/2000', 179,14.27261),
(1628,'4/9/1999', 180,137.7139),
(1634,'11/1/1999', 182,101.6721),
(1637,'9/11/1999', 183, 60.1139),
(1640,'4/17/2000', 184,190.7395),
(1643,'5/11/1999', 185, 5.05994),
(1646,'8/21/1999', 186,14.38241),
(1649,'4/26/1999', 187,25.71961),
(1652,'4/3/1999', 188,37.35634),
(1655,'5/7/1999', 189,167.6363),
(1661,'5/13/1999', 191,12.41107),
(1664,'11/18/1999', 192,50.95264),
(1667,'8/2/2000', 193,67.62999),
(1670,'7/16/1999', 194,83.97284),
(1673,'1/9/2000', 195,8.462688),
(1679,'10/3/1999', 197, 77.3681),
(1682,'3/10/2000', 198,1.117515),
(1685,'9/20/1999', 199,4732.466),
(1688,'12/20/2000', 200,15504.25),
(1691,'9/18/1999', 201,11203.11),
(1694,'9/5/2000', 202,16689.98),
(1697,'10/4/1999', 203,4997.475),
(1700,'6/2/1999', 204,473.3774),
(1706,'4/10/2000', 206,4661.805),
(1709,'8/4/1999', 207,11006.09),
(1712,'5/28/2000', 208, 380.71),
(1715,'1/21/1999', 209,10150.82),
(1718,'4/7/2000', 210,6567.307),
(1721,'3/12/2000', 211,1610.885),
(1724,'7/27/1999', 212,6091.375),
(1727,'10/28/2000', 213,3054.828),
(1730,'4/6/1999', 214, 8658.91),
(1733,'1/11/1999', 215,5509.121),
(1736,'10/9/1999', 216, 926.55),
(1739,'7/21/2000', 217,27760.22),
(1745,'6/2/1999', 219,10328.86),
(1748,'7/1/2000', 220,679.4078),
(1751,'9/4/1999', 221,12090.48),
(1754,'2/12/1999', 222,3772.923),
(1757,'10/5/2000', 223,35608.31),
(1760,'10/9/2000', 224,30748.52),
(1763,'9/3/2000', 225,4682.998),
(1766,'5/7/1999', 226,8499.817),
(1769,'5/20/1999', 227,7709.753),
(1772,'12/2/1999', 228,8610.715),
(1775,'11/11/2000', 229, 2641.61),
(1778,'4/3/2000', 230,12071.88),
(1781,'6/2/2000', 231,3715.188),
(1784,'1/24/1999', 232,7048.929),
(1787,'7/28/1999', 233,853.6858),
(1790,'3/17/1999', 234,82.34863),
(1793,'10/25/2000', 235,972.5005),
(1796,'1/27/1999', 236,2789.688),
(1799,'6/20/2000', 237,829.3602),
(1802,'6/13/2000', 238,1718.027),
(1805,'12/11/2000', 239,2874.005),
(1808,'8/22/2000', 240,1326.661),
(1811,'8/2/1999', 241,2673.106),
(1814,'7/23/2000', 242,2727.875),
(1817,'10/18/2000', 243,1742.129),
(1820,'11/22/2000', 244,779.3618),
(1823,'8/20/2000', 245,26.86364),
(1826,'8/15/1999', 246,5.360506),
(1829,'5/4/1999', 247,560.6894),
(1832,'12/25/2000', 248,3984.985),
(1835,'12/2/1999', 249,2396.236),
(1838,'3/9/1999', 250,459.5467),
(1841,'9/12/2000', 251,2766.734),
(1844,'8/23/1999', 252,231.6356),
(1847,'8/18/1999', 253,94.30295),
(1850,'11/26/1999', 254,1104.924),
(1853,'12/16/1999', 255,1393.034),
(1856,'9/9/1999', 256,5095.222),
(1859,'3/10/1999', 257,283.8402),
(1862,'4/6/2000', 258, 8110.89),
(1865,'12/14/2000', 259,5057.524),
(1868,'4/20/1999', 260,87.03693),
(1871,'3/19/1999', 261, 5541.51),
(1874,'9/16/1999', 262,4953.092),
(1877,'12/12/2000', 263,6178.717),
(1880,'3/8/2000', 264,8376.747),
(1883,'1/23/1999', 265,23313.55),
(1886,'8/10/1999', 266,12911.57),
(1889,'4/4/2000', 267,23678.95),
(1892,'8/20/2000', 268,7156.746),
(1895,'5/5/1999', 269,6572.862),
(1898,'1/2/2000', 270,1186.186),
(1901,'9/25/1999', 271,8418.143),
(1904,'11/23/2000', 272,33049.09),
(1907,'2/7/2000', 273,35906.11),
(1910,'9/28/1999', 274,3484.518),
(1913,'12/19/2000', 275,787.9008),
(1916,'12/2/2000', 276,1880.011),
(1919,'8/26/1999', 277,1512.381),
(1922,'4/26/1999', 278,11789.42),
(1925,'10/17/2000', 279,15526.06),
(1928,'6/24/2000', 280,15046.52),
(1931,'5/23/1999', 281,1928.325),
(1934,'5/25/2000', 282,10937.21),
(1937,'1/23/1999', 283,4017.299),
(1940,'1/18/2000', 284,11313.78),
(1943,'11/27/1999', 285,13807.37),
(1946,'12/2/1999', 286,10054.29),
(1949,'12/18/2000', 287,1341.674),
(1952,'8/20/1999', 288,4182.189),
(1958,'3/13/1999', 290, 489.583),
(1961,'10/22/1999', 291,8001.026),
(1964,'11/4/2000', 292,7429.313),
(1967,'10/6/2000', 293, 1592.42),
(1970,'10/7/2000', 294,1674.686),
(1976,'12/28/1999', 296, 2713.18),
(1979,'5/14/1999', 297,5228.697),
(1982,'2/6/1999', 100,397.2972),
(1985,'5/8/1999', 101,270.0248),
(1988,'1/6/2000', 102,171.1764),
(1991,'8/28/1999', 103,25.89929),
(1994,'2/22/1999', 104,232.3206),
(1997,'5/6/1999', 105,235.2605),
(2003,'4/2/2000', 107,30.99789),
(2006,'11/10/1999', 108,608.7637),
(2009,'1/4/2000', 109,288.1529),
(2012,'2/8/2000', 110,76.10206),
(2015,'11/7/2000', 111,43.93914),
(2018,'12/28/1999', 112,10.25989),
(2021,'1/17/2000', 113,28.78546),
(2024,'1/18/1999', 114,58.15921),
(2027,'3/22/1999', 115, 187.817),
(2030,'12/11/2000', 116,54.81473),
(2033,'1/16/2000', 117,446.1077),
(2036,'1/5/1999', 118,203.5912),
(2042,'11/24/1999', 120,23.42961),
(2045,'5/22/1999', 121,87.14982),
(2048,'11/24/1999', 122, 20.3656),
(2051,'3/9/2000', 123,256.5047),
(2054,'2/17/1999', 124,286.4381),
(2057,'9/6/1999', 125,123.9119),
(2060,'12/9/2000', 126,142.6252),
(2063,'7/17/2000', 127,104.2036),
(2066,'9/8/1999', 128,201.5262),
(2069,'6/25/1999', 129,175.6191),
(2072,'4/6/1999', 130,104.4412),
(2075,'11/9/2000', 131,417.5754),
(2078,'9/22/1999', 132,9.971304),
(2081,'9/5/1999', 133,1.064763),
(2084,'11/15/1999', 134,25.05566),
(2087,'3/17/2000', 135,19.94687),
(2090,'3/14/2000', 136,16.79072),
(2096,'7/1/2000', 138,14.76112),
(2099,'2/26/1999', 139,8.636134),
(2102,'8/4/1999', 140,33.20779),
(2105,'11/12/1999', 141,49.57415),
(2108,'10/13/2000', 142,49.40475),
(2111,'11/9/1999', 143,36.55046),
(2114,'3/21/2000', 144,5.867452),
(2117,'9/5/2000', 145,14.63534),
(2120,'4/23/1999', 146,15.91529),
(2123,'3/26/1999', 147,73.85168),
(2126,'6/1/1999', 148,8.992213),
(2129,'3/26/2000', 149,8.362277),
(2132,'6/13/2000', 150,30.64562),
(2135,'6/16/2000', 151, 34.2395),
(2138,'6/9/1999', 152,30.33333),
(2141,'1/20/2000', 153,3.226211),
(2144,'1/14/1999', 154,28.97461),
(2147,'12/19/1999', 155, 0.30189),
(2150,'6/23/2000', 156, 21.0384),
(2153,'12/25/2000', 157,29.22727),
(2156,'6/22/1999', 158,2.647235),
(2159,'2/13/1999', 159,68.63482),
(2162,'4/19/2000', 160,130.3504),
(2165,'10/6/2000', 161,2.180321),
(2168,'7/16/1999', 162,7.910875),
(2171,'5/17/1999', 163,29.40676),
(2174,'7/3/2000', 164,24.30426),
(2177,'10/6/2000', 165,90.38355),
(2180,'3/2/2000', 166,36.46251),
(2183,'3/13/1999', 167,2.747963),
(2186,'2/6/2000', 168,182.0007),
(2189,'11/1/2000', 169, 191.417),
(2192,'1/19/1999', 170,171.5873),
(2195,'8/16/2000', 171,41.89359),
(2198,'8/6/1999', 172,11.04035),
(2201,'10/8/1999', 173,68.56703),
(2204,'4/10/2000', 174,106.7472),
(2207,'6/23/1999', 175,39.85807),
(2210,'6/18/2000', 176,41.44438),
(2213,'4/20/2000', 177,44.66734),
(2216,'8/13/1999', 178,11.21136),
(2219,'11/13/1999', 179,5.600994),
(2222,'5/11/2000', 180,123.0376),
(2228,'6/1/2000', 182,251.2471),
(2231,'11/27/1999', 183,35.94439),
(2234,'4/17/1999', 184,198.5348),
(2237,'7/3/2000', 185,2.967351),
(2240,'12/2/2000', 186,8.045825),
(2243,'7/21/2000', 187,5.728503),
(2246,'9/23/1999', 188,36.76644),
(2249,'10/26/2000', 189,232.8362),
(2255,'1/12/1999', 191,33.72641),
(2258,'10/3/2000', 192,64.46211),
(2261,'7/25/2000', 193,67.27182),
(2264,'6/24/1999', 194,61.60903),
(2267,'4/13/2000', 195,165.0446),
(2273,'4/11/1999', 197,113.3709),
(2276,'3/3/2000', 198,11.32904),
(2279,'11/14/1999', 199,1851.289),
(2282,'6/6/2000', 200,31405.72),
(2285,'7/13/2000', 201,716.3705),
(2288,'9/3/2000', 202,29606.56),
(2291,'7/25/2000', 203,20195.74),
(2294,'9/4/1999', 204,2842.049),
(2300,'1/7/2000', 206,5454.829),
(2303,'11/25/1999', 207,2206.141),
(2306,'1/28/2000', 208,4744.707),
(2309,'7/7/1999', 209, 6390.97),
(2312,'4/11/1999', 210,9539.196),
(2315,'12/24/2000', 211,7864.815),
(2318,'5/15/1999', 212, 872.542),
(2321,'1/7/2000', 213,3318.323),
(2324,'11/4/1999', 214,5763.722),
(2327,'6/9/1999', 215,944.3873),
(2330,'4/13/1999', 216,511.0076),
(2333,'6/28/1999', 217,12801.39),
(2339,'7/17/1999', 219,27869.35),
(2342,'3/11/2000', 220,623.9558),
(2345,'5/16/1999', 221,20758.23),
(2348,'4/8/1999', 222,10280.78),
(2351,'7/8/2000', 223,33963.38),
(2354,'4/7/1999', 224,4988.438),
(2357,'5/8/2000', 225,177.7306),
(2360,'4/4/1999', 226,3673.922),
(2363,'2/25/1999', 227,5418.243),
(2366,'12/6/2000', 228,9651.242),
(2369,'2/19/2000', 229,801.9194),
(2372,'8/12/2000', 230,2035.503),
(2375,'1/21/2000', 231,2476.122),
(2378,'1/9/1999', 232,4527.432),
(2381,'1/27/1999', 233,275.1983),
(2384,'8/24/1999', 234, 2747.21),
(2387,'8/22/2000', 235,2454.241),
(2390,'2/2/1999', 236,2111.672),
(2393,'8/9/1999', 237,1387.837),
(2396,'12/8/2000', 238, 1163),
(2399,'7/12/1999', 239,3890.431),
(2402,'4/21/2000', 240,239.6195),
(2405,'4/6/2000', 241,1842.653),
(2408,'8/20/1999', 242,2152.329),
(2411,'3/12/2000', 243,3005.124),
(2414,'8/2/1999', 244,2638.944),
(2417,'2/26/2000', 245,2431.208),
(2420,'5/23/2000', 246,42.41151),
(2423,'2/21/2000', 247,841.1042),
(2426,'7/17/2000', 248,3386.254),
(2429,'1/3/2000', 249,1843.864),
(2432,'10/11/2000', 250,1357.021),
(2435,'11/13/2000', 251,2883.029),
(2438,'4/13/2000', 252,236.1756),
(2441,'1/10/1999', 253,142.5996),
(2444,'7/15/1999', 254,2718.375),
(2447,'4/26/1999', 255,989.5613),
(2450,'4/27/2000', 256,6972.301),
(2453,'2/24/1999', 257,130.9576),
(2456,'11/10/1999', 258,6262.766),
(2459,'11/18/2000', 259,3086.867),
(2462,'10/28/2000', 260,20.02136),
(2465,'12/10/1999', 261,4172.872),
(2468,'12/10/2000', 262,1533.623),
(2471,'12/1/2000', 263,3092.681),
(2474,'10/9/2000', 264,3854.422),
(2477,'1/19/2000', 265,9572.416),
(2480,'12/15/1999', 266,12107.02),
(2483,'6/12/1999', 267,249.8177),
(2486,'3/8/1999', 268,11433.34),
(2489,'3/15/2000', 269,905.8667),
(2492,'5/15/2000', 270,431.7046),
(2495,'11/10/2000', 271,7490.943),
(2498,'7/4/2000', 272, 4332.43),
(2501,'3/20/1999', 273,11927.34),
(2504,'7/21/2000', 274,6024.322),
(2507,'9/20/1999', 275, 84.9894),
(2510,'5/15/2000', 276,4547.415),
(2513,'5/23/2000', 277,4440.402),
(2516,'9/28/1999', 278,9733.886),
(2519,'9/13/2000', 279,1155.452),
(2522,'10/20/2000', 280,7285.954),
(2525,'6/19/1999', 281,466.4518),
(2528,'11/1/1999', 282,8143.997),
(2531,'11/28/2000', 283,2163.073),
(2534,'10/22/1999', 284,9218.228),
(2537,'7/10/2000', 285,9369.708),
(2540,'6/28/2000', 286,7669.178),
(2543,'2/25/2000', 287,2292.681),
(2552,'10/21/1999', 290,3701.036),
(2555,'3/19/2000', 291,6146.988),
(2558,'2/16/1999', 292,3093.035),
(2561,'12/8/2000', 293, 3779.69),
(2564,'4/22/2000', 294,4568.839),
(2570,'4/23/2000', 296,8000.067),
(2573,'5/4/2000', 297, 7879.64);
-- end of TRANSACTION DATA | the_stack |
-- 2018-11-27T13:39:25.398
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2018-11-27 13:39:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53510
;
-- 2018-11-27T13:39:41.317
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2018-11-27 13:39:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53512
;
-- 2018-11-27T13:41:06.082
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53657
;
-- 2018-11-27T13:41:06.122
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53657
;
-- 2018-11-27T13:41:06.201
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607868
;
-- 2018-11-27T13:41:09.855
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53656
;
-- 2018-11-27T13:41:09.867
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53656
;
-- 2018-11-27T13:41:09.879
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607867
;
-- 2018-11-27T13:41:16.791
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53512
;
-- 2018-11-27T13:41:16.795
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53512
;
-- 2018-11-27T13:41:25.533
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53510
;
-- 2018-11-27T13:41:25.539
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53510
;
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists XPosition');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists YPosition');
-- 2018-11-27T13:44:00.182
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53673
;
-- 2018-11-27T13:44:00.189
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53673
;
-- 2018-11-27T13:44:00.194
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607884
;
-- 2018-11-27T13:44:07.813
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53478
;
-- 2018-11-27T13:44:07.819
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53478
;
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists IsCentrallyMaintained');
-- 2018-11-27T13:44:33.233
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53674
;
-- 2018-11-27T13:44:33.246
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53674
;
-- 2018-11-27T13:44:33.254
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607885
;
-- 2018-11-27T13:44:42.691
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53474
;
-- 2018-11-27T13:44:42.699
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53474
;
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists EntityType');
-- 2018-11-27T13:46:23.327
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53683
;
-- 2018-11-27T13:46:23.336
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53683
;
-- 2018-11-27T13:46:23.348
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607894
;
-- 2018-11-27T13:46:29.733
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53457
;
-- 2018-11-27T13:46:29.739
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53457
;
-- 2018-11-27T13:47:12.295
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53686
;
-- 2018-11-27T13:47:12.306
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53686
;
-- 2018-11-27T13:47:12.313
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607897
;
-- 2018-11-27T13:47:12.368
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53684
;
-- 2018-11-27T13:47:12.371
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53684
;
-- 2018-11-27T13:47:12.378
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607895
;
-- 2018-11-27T13:47:12.443
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53690
;
-- 2018-11-27T13:47:12.447
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53690
;
-- 2018-11-27T13:47:12.452
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607901
;
-- 2018-11-27T13:47:12.509
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53687
;
-- 2018-11-27T13:47:12.512
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53687
;
-- 2018-11-27T13:47:12.516
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607898
;
-- 2018-11-27T13:47:12.550
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53691
;
-- 2018-11-27T13:47:12.552
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53691
;
-- 2018-11-27T13:47:12.557
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607902
;
-- 2018-11-27T13:47:25.228
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53447
;
-- 2018-11-27T13:47:25.230
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53447
;
-- 2018-11-27T13:47:25.409
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53448
;
-- 2018-11-27T13:47:25.412
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53448
;
-- 2018-11-27T13:47:25.542
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53450
;
-- 2018-11-27T13:47:25.546
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53450
;
-- 2018-11-27T13:47:25.627
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53451
;
-- 2018-11-27T13:47:25.633
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53451
;
-- 2018-11-27T13:47:25.723
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53452
;
-- 2018-11-27T13:47:25.728
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53452
;
-- 2018-11-27T13:47:30.153
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53692
;
-- 2018-11-27T13:47:30.161
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53692
;
-- 2018-11-27T13:47:30.168
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607903
;
-- 2018-11-27T13:47:40.515
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53446
;
-- 2018-11-27T13:47:40.522
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53446
;
-- 2018-11-27T13:48:17.312
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53685
;
-- 2018-11-27T13:48:17.318
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53685
;
-- 2018-11-27T13:48:17.324
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607896
;
-- 2018-11-27T13:48:26.538
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53455
;
-- 2018-11-27T13:48:26.543
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53455
;
-- 2018-11-27T13:48:33.582
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53693
;
-- 2018-11-27T13:48:33.586
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53693
;
-- 2018-11-27T13:48:33.598
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607904
;
-- 2018-11-27T13:48:37.807
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53694
;
-- 2018-11-27T13:48:37.811
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53694
;
-- 2018-11-27T13:48:37.818
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607905
;
-- 2018-11-27T13:48:45.778
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53458
;
-- 2018-11-27T13:48:45.786
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53458
;
-- 2018-11-27T13:48:45.874
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53459
;
-- 2018-11-27T13:48:45.877
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53459
;
-- 2018-11-27T13:51:45.864
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53695
;
-- 2018-11-27T13:51:45.871
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53695
;
-- 2018-11-27T13:51:45.880
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607906
;
-- 2018-11-27T13:51:52.243
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53469
;
-- 2018-11-27T13:51:52.251
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53469
;
-- 2018-11-27T13:54:07.586
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53703
;
-- 2018-11-27T13:54:07.589
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53703
;
-- 2018-11-27T13:54:07.593
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607914
;
-- 2018-11-27T13:54:13.058
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53482
;
-- 2018-11-27T13:54:13.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53482
;
-- 2018-11-27T13:54:49.498
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53681
;
-- 2018-11-27T13:54:49.501
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53681
;
-- 2018-11-27T13:54:49.505
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607892
;
-- 2018-11-27T13:54:58.729
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53682
;
-- 2018-11-27T13:54:58.737
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53682
;
-- 2018-11-27T13:54:58.749
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607893
;
-- 2018-11-27T13:55:04.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53481
;
-- 2018-11-27T13:55:04.832
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53481
;
-- 2018-11-27T13:55:09.363
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53498
;
-- 2018-11-27T13:55:09.369
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53498
;
-- 2018-11-27T13:55:39.734
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53689
;
-- 2018-11-27T13:55:39.737
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53689
;
-- 2018-11-27T13:55:39.740
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607900
;
-- 2018-11-27T13:55:53.410
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53688
;
-- 2018-11-27T13:55:53.414
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53688
;
-- 2018-11-27T13:55:53.419
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607899
;
-- 2018-11-27T13:55:58.762
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53500
;
-- 2018-11-27T13:55:58.768
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53500
;
-- 2018-11-27T13:56:07.095
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53508
;
-- 2018-11-27T13:56:07.099
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53508
;
-- 2018-11-27T13:57:11.014
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53680
;
-- 2018-11-27T13:57:11.020
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53680
;
-- 2018-11-27T13:57:11.029
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607891
;
-- 2018-11-27T13:57:17.201
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53679
;
-- 2018-11-27T13:57:17.202
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53679
;
-- 2018-11-27T13:57:17.205
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607890
;
-- 2018-11-27T13:57:26.883
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53475
;
-- 2018-11-27T13:57:26.888
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53475
;
-- 2018-11-27T13:57:33.787
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53499
;
-- 2018-11-27T13:57:33.788
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53499
;
-- 2018-11-27T13:58:19.326
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53678
;
-- 2018-11-27T13:58:19.332
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53678
;
-- 2018-11-27T13:58:19.342
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607889
;
-- 2018-11-27T13:58:26.186
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53488
;
-- 2018-11-27T13:58:26.192
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53488
;
-- 2018-11-27T13:59:58.491
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53698
;
-- 2018-11-27T13:59:58.494
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53698
;
-- 2018-11-27T13:59:58.499
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607909
;
-- 2018-11-27T14:00:05.450
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53501
;
-- 2018-11-27T14:00:05.457
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53501
;
-- 2018-11-27T14:00:27.647
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53675
;
-- 2018-11-27T14:00:27.656
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53675
;
-- 2018-11-27T14:00:27.667
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607886
;
-- 2018-11-27T14:00:31.100
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53676
;
-- 2018-11-27T14:00:31.107
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53676
;
-- 2018-11-27T14:00:31.116
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607887
;
-- 2018-11-27T14:00:37.313
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53504
;
-- 2018-11-27T14:00:37.322
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53504
;
-- 2018-11-27T14:00:40.464
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53505
;
-- 2018-11-27T14:00:40.471
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53505
;
drop view if exists PP_Order_Node_v;
drop view if exists PP_Order_Node_vt;
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists Action');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists AD_Form_ID');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists AD_Task_ID');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists AD_WF_Block_ID');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists AD_Process_ID');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists AD_Column_ID');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists AD_Window_ID');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists AttributeName');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists AttributeValue');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists AD_Image_ID');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists DocAction');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists DurationLimit');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists JoinElement');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists SplitElement');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists SubflowExecution');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists Workflow_ID');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists Priority');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists StartMode');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists FinishMode');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists UnitsCycles');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists ValidFrom');
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists ValidTo');
-- 2018-11-27T14:02:54.292
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET DefaultValue='0',Updated=TO_TIMESTAMP('2018-11-27 14:02:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53461
;
-- 2018-11-27T14:02:58.160
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE PP_Order_Node SET Cost=0 WHERE Cost IS NULL
;
-- 2018-11-27T14:03:47.646
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53697
;
-- 2018-11-27T14:03:47.653
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53697
;
-- 2018-11-27T14:03:47.660
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607908
;
-- 2018-11-27T14:03:58.029
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53509
;
-- 2018-11-27T14:03:58.031
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53509
;
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists WorkingTime');
-- 2018-11-27T14:06:52.436
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53696
;
-- 2018-11-27T14:06:52.447
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53696
;
-- 2018-11-27T14:06:52.453
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607907
;
-- 2018-11-27T14:06:58.938
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53461
;
-- 2018-11-27T14:06:58.940
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53461
;
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists Cost');
-- 2018-11-27T14:09:04.749
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53665
;
-- 2018-11-27T14:09:04.755
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53665
;
-- 2018-11-27T14:09:04.761
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607876
;
-- 2018-11-27T14:09:15.504
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=53667
;
-- 2018-11-27T14:09:15.513
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=53667
;
-- 2018-11-27T14:09:15.520
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=607878
;
-- 2018-11-27T14:09:21.906
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53476
;
-- 2018-11-27T14:09:21.909
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53476
;
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists Help');
alter table PP_Order_Node_Trl drop column if exists Help;
-- 2018-11-27T14:12:09.587
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Display=NULL,Updated=TO_TIMESTAMP('2018-11-27 14:12:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=53232
;
-- 2018-11-27T14:12:16.268
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=53445
;
-- 2018-11-27T14:12:16.273
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=53445
;
drop view if exists rv_pp_order_workflow;
SELECT db_alter_table('PP_Order_Node', 'alter table PP_Order_Node drop column if exists Name');
alter table PP_Order_Node_Trl drop column if exists Name;
-- 2018-11-27T14:14:55.057
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56965
;
-- 2018-11-27T14:14:55.066
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56965
;
-- 2018-11-27T14:14:55.078
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610601
;
-- 2018-11-27T14:14:58.757
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56968
;
-- 2018-11-27T14:14:58.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56968
;
-- 2018-11-27T14:14:58.779
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610604
;
-- 2018-11-27T14:15:03.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=57208
;
-- 2018-11-27T14:15:03.699
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=57208
;
-- 2018-11-27T14:15:07.115
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=57211
;
-- 2018-11-27T14:15:07.119
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=57211
; | the_stack |
-- Generated by CompileSchemaScripts.pl from:
-- 20140308-ordering-columns-fk.sql
-- 20140312-dates-trigger.sql
-- 20140217-instrument-triggers.sql
-- 20140318-series-fks.sql
\set ON_ERROR_STOP 1
BEGIN;
--------------------------------------------------------------------------------
SELECT '20140308-ordering-columns-fk.sql';
ALTER TABLE area_alias_type
ADD CONSTRAINT area_alias_type_fk_parent
FOREIGN KEY (parent)
REFERENCES area_alias_type(id);
ALTER TABLE area_type
ADD CONSTRAINT area_type_fk_parent
FOREIGN KEY (parent)
REFERENCES area_type(id);
ALTER TABLE artist_type
ADD CONSTRAINT artist_type_fk_parent
FOREIGN KEY (parent)
REFERENCES artist_type(id);
ALTER TABLE artist_alias_type
ADD CONSTRAINT artist_alias_type_fk_parent
FOREIGN KEY (parent)
REFERENCES artist_alias_type(id);
ALTER TABLE gender
ADD CONSTRAINT gender_fk_parent
FOREIGN KEY (parent)
REFERENCES gender(id);
ALTER TABLE label_type
ADD CONSTRAINT label_type_fk_parent
FOREIGN KEY (parent)
REFERENCES label_type(id);
ALTER TABLE label_alias_type
ADD CONSTRAINT label_alias_type_fk_parent
FOREIGN KEY (parent)
REFERENCES label_alias_type(id);
ALTER TABLE place_type
ADD CONSTRAINT place_type_fk_parent
FOREIGN KEY (parent)
REFERENCES place_type(id);
ALTER TABLE place_alias_type
ADD CONSTRAINT place_alias_type_fk_parent
FOREIGN KEY (parent)
REFERENCES place_alias_type(id);
ALTER TABLE release_group_primary_type
ADD CONSTRAINT release_group_primary_type_fk_parent
FOREIGN KEY (parent)
REFERENCES release_group_primary_type(id);
ALTER TABLE release_group_secondary_type
ADD CONSTRAINT release_group_secondary_type_fk_parent
FOREIGN KEY (parent)
REFERENCES release_group_secondary_type(id);
ALTER TABLE release_packaging
ADD CONSTRAINT release_packaging_fk_parent
FOREIGN KEY (parent)
REFERENCES release_packaging(id);
ALTER TABLE release_status
ADD CONSTRAINT release_status_fk_parent
FOREIGN KEY (parent)
REFERENCES release_status(id);
ALTER TABLE work_alias_type
ADD CONSTRAINT work_alias_type_fk_parent
FOREIGN KEY (parent)
REFERENCES work_alias_type(id);
ALTER TABLE work_attribute_type
ADD CONSTRAINT work_attribute_type_fk_parent
FOREIGN KEY (parent)
REFERENCES work_attribute_type(id);
ALTER TABLE work_attribute_type_allowed_value
ADD CONSTRAINT work_attribute_type_allowed_value_fk_parent
FOREIGN KEY (parent)
REFERENCES work_attribute_type_allowed_value(id);
ALTER TABLE work_type
ADD CONSTRAINT work_type_fk_parent
FOREIGN KEY (parent)
REFERENCES work_type(id);
ALTER TABLE cover_art_archive.art_type
ADD CONSTRAINT art_type_fk_parent
FOREIGN KEY (parent)
REFERENCES cover_art_archive.art_type(id);
--------------------------------------------------------------------------------
SELECT '20140312-dates-trigger.sql';
CREATE OR REPLACE FUNCTION check_has_dates()
RETURNS trigger AS $$
BEGIN
IF (NEW.begin_date_year IS NOT NULL OR
NEW.begin_date_month IS NOT NULL OR
NEW.begin_date_day IS NOT NULL OR
NEW.end_date_year IS NOT NULL OR
NEW.end_date_month IS NOT NULL OR
NEW.end_date_day IS NOT NULL OR
NEW.ended = TRUE)
AND NOT (SELECT has_dates FROM link_type WHERE id = NEW.link_type)
THEN
RAISE EXCEPTION 'Attempt to add dates to a relationship type that does not support dates.';
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';
CREATE TRIGGER check_has_dates BEFORE UPDATE OR INSERT ON link
FOR EACH ROW EXECUTE PROCEDURE check_has_dates();
--------------------------------------------------------------------------------
SELECT '20140217-instrument-triggers.sql';
CREATE OR REPLACE FUNCTION a_ins_instrument() RETURNS TRIGGER AS $$
BEGIN
INSERT INTO link_attribute_type (parent, root, child_order, gid, name, description) VALUES (14, 14, 0, NEW.gid, NEW.name, NEW.description);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION a_upd_instrument() RETURNS trigger AS $$
BEGIN
UPDATE link_attribute_type SET name = NEW.name, description = NEW.description WHERE gid = NEW.gid;
IF NOT FOUND THEN
RAISE EXCEPTION 'no link_attribute_type found for instrument %', NEW.gid;
ELSE
RETURN NEW;
END IF;
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION a_del_instrument() RETURNS trigger AS $$
BEGIN
DELETE FROM link_attribute_type WHERE gid = OLD.gid;
IF NOT FOUND THEN
RAISE EXCEPTION 'no link_attribute_type found for instrument %', NEW.gid;
ELSE
RETURN NEW;
END IF;
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION unique_primary_instrument_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE instrument_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND instrument = NEW.instrument;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';
ALTER TABLE instrument ADD CHECK (controlled_for_whitespace(comment));
ALTER TABLE instrument
ADD CONSTRAINT control_for_whitespace CHECK (controlled_for_whitespace(name)),
ADD CONSTRAINT only_non_empty CHECK (name != '');
ALTER TABLE instrument_alias
ADD CONSTRAINT control_for_whitespace CHECK (controlled_for_whitespace(name)),
ADD CONSTRAINT only_non_empty CHECK (name != ''),
ADD CONSTRAINT control_for_whitespace_sort_name CHECK (controlled_for_whitespace(sort_name)),
ADD CONSTRAINT only_non_empty_sort_name CHECK (sort_name != '');
ALTER TABLE edit_instrument
ADD CONSTRAINT edit_instrument_fk_edit
FOREIGN KEY (edit)
REFERENCES edit(id);
ALTER TABLE edit_instrument
ADD CONSTRAINT edit_instrument_fk_instrument
FOREIGN KEY (instrument)
REFERENCES instrument(id)
ON DELETE CASCADE;
ALTER TABLE instrument
ADD CONSTRAINT instrument_fk_type
FOREIGN KEY (type)
REFERENCES instrument_type(id);
ALTER TABLE instrument_alias
ADD CONSTRAINT instrument_alias_fk_instrument
FOREIGN KEY (instrument)
REFERENCES instrument(id);
ALTER TABLE instrument_alias
ADD CONSTRAINT instrument_alias_fk_type
FOREIGN KEY (type)
REFERENCES instrument_alias_type(id);
ALTER TABLE instrument_annotation
ADD CONSTRAINT instrument_annotation_fk_instrument
FOREIGN KEY (instrument)
REFERENCES instrument(id);
ALTER TABLE instrument_annotation
ADD CONSTRAINT instrument_annotation_fk_annotation
FOREIGN KEY (annotation)
REFERENCES annotation(id);
ALTER TABLE instrument_gid_redirect
ADD CONSTRAINT instrument_gid_redirect_fk_new_id
FOREIGN KEY (new_id)
REFERENCES instrument(id);
ALTER TABLE l_area_instrument
ADD CONSTRAINT l_area_instrument_fk_link
FOREIGN KEY (link)
REFERENCES link(id);
ALTER TABLE l_area_instrument
ADD CONSTRAINT l_area_instrument_fk_entity0
FOREIGN KEY (entity0)
REFERENCES area(id);
ALTER TABLE l_area_instrument
ADD CONSTRAINT l_area_instrument_fk_entity1
FOREIGN KEY (entity1)
REFERENCES instrument(id);
ALTER TABLE l_artist_instrument
ADD CONSTRAINT l_artist_instrument_fk_link
FOREIGN KEY (link)
REFERENCES link(id);
ALTER TABLE l_artist_instrument
ADD CONSTRAINT l_artist_instrument_fk_entity0
FOREIGN KEY (entity0)
REFERENCES artist(id);
ALTER TABLE l_artist_instrument
ADD CONSTRAINT l_artist_instrument_fk_entity1
FOREIGN KEY (entity1)
REFERENCES instrument(id);
ALTER TABLE l_instrument_instrument
ADD CONSTRAINT l_instrument_instrument_fk_link
FOREIGN KEY (link)
REFERENCES link(id);
ALTER TABLE l_instrument_instrument
ADD CONSTRAINT l_instrument_instrument_fk_entity0
FOREIGN KEY (entity0)
REFERENCES instrument(id);
ALTER TABLE l_instrument_instrument
ADD CONSTRAINT l_instrument_instrument_fk_entity1
FOREIGN KEY (entity1)
REFERENCES instrument(id);
ALTER TABLE l_instrument_label
ADD CONSTRAINT l_instrument_label_fk_link
FOREIGN KEY (link)
REFERENCES link(id);
ALTER TABLE l_instrument_label
ADD CONSTRAINT l_instrument_label_fk_entity0
FOREIGN KEY (entity0)
REFERENCES instrument(id);
ALTER TABLE l_instrument_label
ADD CONSTRAINT l_instrument_label_fk_entity1
FOREIGN KEY (entity1)
REFERENCES label(id);
ALTER TABLE l_instrument_place
ADD CONSTRAINT l_instrument_place_fk_link
FOREIGN KEY (link)
REFERENCES link(id);
ALTER TABLE l_instrument_place
ADD CONSTRAINT l_instrument_place_fk_entity0
FOREIGN KEY (entity0)
REFERENCES instrument(id);
ALTER TABLE l_instrument_place
ADD CONSTRAINT l_instrument_place_fk_entity1
FOREIGN KEY (entity1)
REFERENCES place(id);
ALTER TABLE l_instrument_recording
ADD CONSTRAINT l_instrument_recording_fk_link
FOREIGN KEY (link)
REFERENCES link(id);
ALTER TABLE l_instrument_recording
ADD CONSTRAINT l_instrument_recording_fk_entity0
FOREIGN KEY (entity0)
REFERENCES instrument(id);
ALTER TABLE l_instrument_recording
ADD CONSTRAINT l_instrument_recording_fk_entity1
FOREIGN KEY (entity1)
REFERENCES recording(id);
ALTER TABLE l_instrument_release
ADD CONSTRAINT l_instrument_release_fk_link
FOREIGN KEY (link)
REFERENCES link(id);
ALTER TABLE l_instrument_release
ADD CONSTRAINT l_instrument_release_fk_entity0
FOREIGN KEY (entity0)
REFERENCES instrument(id);
ALTER TABLE l_instrument_release
ADD CONSTRAINT l_instrument_release_fk_entity1
FOREIGN KEY (entity1)
REFERENCES release(id);
ALTER TABLE l_instrument_release_group
ADD CONSTRAINT l_instrument_release_group_fk_link
FOREIGN KEY (link)
REFERENCES link(id);
ALTER TABLE l_instrument_release_group
ADD CONSTRAINT l_instrument_release_group_fk_entity0
FOREIGN KEY (entity0)
REFERENCES instrument(id);
ALTER TABLE l_instrument_release_group
ADD CONSTRAINT l_instrument_release_group_fk_entity1
FOREIGN KEY (entity1)
REFERENCES release_group(id);
ALTER TABLE l_instrument_url
ADD CONSTRAINT l_instrument_url_fk_link
FOREIGN KEY (link)
REFERENCES link(id);
ALTER TABLE l_instrument_url
ADD CONSTRAINT l_instrument_url_fk_entity0
FOREIGN KEY (entity0)
REFERENCES instrument(id);
ALTER TABLE l_instrument_url
ADD CONSTRAINT l_instrument_url_fk_entity1
FOREIGN KEY (entity1)
REFERENCES url(id);
ALTER TABLE l_instrument_work
ADD CONSTRAINT l_instrument_work_fk_link
FOREIGN KEY (link)
REFERENCES link(id);
ALTER TABLE l_instrument_work
ADD CONSTRAINT l_instrument_work_fk_entity0
FOREIGN KEY (entity0)
REFERENCES instrument(id);
ALTER TABLE l_instrument_work
ADD CONSTRAINT l_instrument_work_fk_entity1
FOREIGN KEY (entity1)
REFERENCES work(id);
CREATE TRIGGER b_upd_instrument BEFORE UPDATE ON instrument
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER end_date_implies_ended BEFORE UPDATE OR INSERT ON instrument_alias
FOR EACH ROW EXECUTE PROCEDURE end_date_implies_ended();
CREATE TRIGGER b_upd_instrument_alias BEFORE UPDATE ON instrument_alias
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON instrument_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_instrument_alias();
CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON instrument_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(2);
CREATE TRIGGER b_upd_l_area_instrument BEFORE UPDATE ON l_area_instrument
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER b_upd_l_artist_instrument BEFORE UPDATE ON l_artist_instrument
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER b_upd_l_instrument_instrument BEFORE UPDATE ON l_instrument_instrument
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER b_upd_l_instrument_label BEFORE UPDATE ON l_instrument_label
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER b_upd_l_instrument_place BEFORE UPDATE ON l_instrument_place
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER b_upd_l_instrument_recording BEFORE UPDATE ON l_instrument_recording
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER b_upd_l_instrument_release BEFORE UPDATE ON l_instrument_release
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER b_upd_l_instrument_release_group BEFORE UPDATE ON l_instrument_release_group
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER b_upd_l_instrument_url BEFORE UPDATE ON l_instrument_url
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER b_upd_l_instrument_work BEFORE UPDATE ON l_instrument_work
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();
CREATE TRIGGER a_ins_instrument AFTER INSERT ON musicbrainz.instrument
FOR EACH ROW EXECUTE PROCEDURE a_ins_instrument();
CREATE TRIGGER a_upd_instrument AFTER UPDATE ON musicbrainz.instrument
FOR EACH ROW EXECUTE PROCEDURE a_upd_instrument();
CREATE TRIGGER a_del_instrument AFTER DELETE ON musicbrainz.instrument
FOR EACH ROW EXECUTE PROCEDURE a_del_instrument();
CREATE CONSTRAINT TRIGGER remove_unused_links
AFTER DELETE OR UPDATE ON l_area_instrument DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_links();
CREATE CONSTRAINT TRIGGER remove_unused_links
AFTER DELETE OR UPDATE ON l_artist_instrument DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_links();
CREATE CONSTRAINT TRIGGER remove_unused_links
AFTER DELETE OR UPDATE ON l_instrument_instrument DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_links();
CREATE CONSTRAINT TRIGGER remove_unused_links
AFTER DELETE OR UPDATE ON l_instrument_label DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_links();
CREATE CONSTRAINT TRIGGER remove_unused_links
AFTER DELETE OR UPDATE ON l_instrument_place DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_links();
CREATE CONSTRAINT TRIGGER remove_unused_links
AFTER DELETE OR UPDATE ON l_instrument_recording DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_links();
CREATE CONSTRAINT TRIGGER remove_unused_links
AFTER DELETE OR UPDATE ON l_instrument_release DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_links();
CREATE CONSTRAINT TRIGGER remove_unused_links
AFTER DELETE OR UPDATE ON l_instrument_release_group DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_links();
CREATE CONSTRAINT TRIGGER remove_unused_links
AFTER DELETE OR UPDATE ON l_instrument_url DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_links();
CREATE CONSTRAINT TRIGGER remove_unused_links
AFTER DELETE OR UPDATE ON l_instrument_work DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_links();
CREATE CONSTRAINT TRIGGER url_gc_a_upd_l_instrument_url
AFTER UPDATE ON l_instrument_url DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_url();
CREATE CONSTRAINT TRIGGER url_gc_a_del_l_instrument_url
AFTER DELETE ON l_instrument_url DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE remove_unused_url();
ALTER TABLE documentation.l_area_instrument_example
ADD CONSTRAINT l_area_instrument_example_fk_id
FOREIGN KEY (id)
REFERENCES musicbrainz.l_area_instrument(id);
ALTER TABLE documentation.l_artist_instrument_example
ADD CONSTRAINT l_artist_instrument_example_fk_id
FOREIGN KEY (id)
REFERENCES musicbrainz.l_artist_instrument(id);
ALTER TABLE documentation.l_instrument_instrument_example
ADD CONSTRAINT l_instrument_instrument_example_fk_id
FOREIGN KEY (id)
REFERENCES musicbrainz.l_instrument_instrument(id);
ALTER TABLE documentation.l_instrument_label_example
ADD CONSTRAINT l_instrument_label_example_fk_id
FOREIGN KEY (id)
REFERENCES musicbrainz.l_instrument_label(id);
ALTER TABLE documentation.l_instrument_place_example
ADD CONSTRAINT l_instrument_place_example_fk_id
FOREIGN KEY (id)
REFERENCES musicbrainz.l_instrument_place(id);
ALTER TABLE documentation.l_instrument_recording_example
ADD CONSTRAINT l_instrument_recording_example_fk_id
FOREIGN KEY (id)
REFERENCES musicbrainz.l_instrument_recording(id);
ALTER TABLE documentation.l_instrument_release_example
ADD CONSTRAINT l_instrument_release_example_fk_id
FOREIGN KEY (id)
REFERENCES musicbrainz.l_instrument_release(id);
ALTER TABLE documentation.l_instrument_release_group_example
ADD CONSTRAINT l_instrument_release_group_example_fk_id
FOREIGN KEY (id)
REFERENCES musicbrainz.l_instrument_release_group(id);
ALTER TABLE documentation.l_instrument_url_example
ADD CONSTRAINT l_instrument_url_example_fk_id
FOREIGN KEY (id)
REFERENCES musicbrainz.l_instrument_url(id);
ALTER TABLE documentation.l_instrument_work_example
ADD CONSTRAINT l_instrument_work_example_fk_id
FOREIGN KEY (id)
REFERENCES musicbrainz.l_instrument_work(id);
--------------------------------------------------------------------------------
SELECT '20140318-series-fks.sql';
------------------
-- constraints --
------------------
ALTER TABLE series ADD CHECK (controlled_for_whitespace(comment));
ALTER TABLE link_attribute_text_value
ADD CONSTRAINT control_for_whitespace CHECK (controlled_for_whitespace(text_value)),
ADD CONSTRAINT only_non_empty CHECK (text_value != '');
ALTER TABLE series
ADD CONSTRAINT control_for_whitespace CHECK (controlled_for_whitespace(name)),
ADD CONSTRAINT only_non_empty CHECK (name != '');
ALTER TABLE series_type ADD CONSTRAINT allowed_series_entity_type
CHECK (
entity_type IN (
'recording',
'release',
'release_group',
'work'
)
);
------------------
-- foreign keys --
------------------
ALTER TABLE documentation.l_area_series_example ADD CONSTRAINT l_area_series_example_fk_id FOREIGN KEY (id) REFERENCES musicbrainz.l_area_series(id);
ALTER TABLE documentation.l_artist_series_example ADD CONSTRAINT l_artist_series_example_fk_id FOREIGN KEY (id) REFERENCES musicbrainz.l_artist_series(id);
ALTER TABLE documentation.l_instrument_series_example ADD CONSTRAINT l_instrument_series_example_fk_id FOREIGN KEY (id) REFERENCES musicbrainz.l_instrument_series(id);
ALTER TABLE documentation.l_label_series_example ADD CONSTRAINT l_label_series_example_fk_id FOREIGN KEY (id) REFERENCES musicbrainz.l_label_series(id);
ALTER TABLE documentation.l_place_series_example ADD CONSTRAINT l_place_series_example_fk_id FOREIGN KEY (id) REFERENCES musicbrainz.l_place_series(id);
ALTER TABLE documentation.l_recording_series_example ADD CONSTRAINT l_recording_series_example_fk_id FOREIGN KEY (id) REFERENCES musicbrainz.l_recording_series(id);
ALTER TABLE documentation.l_release_group_series_example ADD CONSTRAINT l_release_group_series_example_fk_id FOREIGN KEY (id) REFERENCES musicbrainz.l_release_group_series(id);
ALTER TABLE documentation.l_release_series_example ADD CONSTRAINT l_release_series_example_fk_id FOREIGN KEY (id) REFERENCES musicbrainz.l_release_series(id);
ALTER TABLE documentation.l_series_series_example ADD CONSTRAINT l_series_series_example_fk_id FOREIGN KEY (id) REFERENCES musicbrainz.l_series_series(id);
ALTER TABLE documentation.l_series_url_example ADD CONSTRAINT l_series_url_example_fk_id FOREIGN KEY (id) REFERENCES musicbrainz.l_series_url(id);
ALTER TABLE documentation.l_series_work_example ADD CONSTRAINT l_series_work_example_fk_id FOREIGN KEY (id) REFERENCES musicbrainz.l_series_work(id);
ALTER TABLE editor_subscribe_series ADD CONSTRAINT editor_subscribe_series_fk_editor FOREIGN KEY (editor) REFERENCES editor(id);
ALTER TABLE editor_subscribe_series ADD CONSTRAINT editor_subscribe_series_fk_series FOREIGN KEY (series) REFERENCES series(id);
ALTER TABLE editor_subscribe_series ADD CONSTRAINT editor_subscribe_series_fk_last_edit_sent FOREIGN KEY (last_edit_sent) REFERENCES edit(id);
ALTER TABLE editor_subscribe_series_deleted ADD CONSTRAINT editor_subscribe_series_deleted_fk_editor FOREIGN KEY (editor) REFERENCES editor(id);
ALTER TABLE editor_subscribe_series_deleted ADD CONSTRAINT editor_subscribe_series_deleted_fk_gid FOREIGN KEY (gid) REFERENCES series_deletion(gid);
ALTER TABLE editor_subscribe_series_deleted ADD CONSTRAINT editor_subscribe_series_deleted_fk_deleted_by FOREIGN KEY (deleted_by) REFERENCES edit(id);
ALTER TABLE l_area_series ADD CONSTRAINT l_area_series_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE l_area_series ADD CONSTRAINT l_area_series_fk_entity0 FOREIGN KEY (entity0) REFERENCES area(id);
ALTER TABLE l_area_series ADD CONSTRAINT l_area_series_fk_entity1 FOREIGN KEY (entity1) REFERENCES series(id);
ALTER TABLE l_artist_series ADD CONSTRAINT l_artist_series_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE l_artist_series ADD CONSTRAINT l_artist_series_fk_entity0 FOREIGN KEY (entity0) REFERENCES artist(id);
ALTER TABLE l_artist_series ADD CONSTRAINT l_artist_series_fk_entity1 FOREIGN KEY (entity1) REFERENCES series(id);
ALTER TABLE l_instrument_series ADD CONSTRAINT l_instrument_series_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE l_instrument_series ADD CONSTRAINT l_instrument_series_fk_entity0 FOREIGN KEY (entity0) REFERENCES instrument(id);
ALTER TABLE l_instrument_series ADD CONSTRAINT l_instrument_series_fk_entity1 FOREIGN KEY (entity1) REFERENCES series(id);
ALTER TABLE l_label_series ADD CONSTRAINT l_label_series_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE l_label_series ADD CONSTRAINT l_label_series_fk_entity0 FOREIGN KEY (entity0) REFERENCES label(id);
ALTER TABLE l_label_series ADD CONSTRAINT l_label_series_fk_entity1 FOREIGN KEY (entity1) REFERENCES series(id);
ALTER TABLE l_place_series ADD CONSTRAINT l_place_series_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE l_place_series ADD CONSTRAINT l_place_series_fk_entity0 FOREIGN KEY (entity0) REFERENCES place(id);
ALTER TABLE l_place_series ADD CONSTRAINT l_place_series_fk_entity1 FOREIGN KEY (entity1) REFERENCES series(id);
ALTER TABLE l_recording_series ADD CONSTRAINT l_recording_series_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE l_recording_series ADD CONSTRAINT l_recording_series_fk_entity0 FOREIGN KEY (entity0) REFERENCES recording(id);
ALTER TABLE l_recording_series ADD CONSTRAINT l_recording_series_fk_entity1 FOREIGN KEY (entity1) REFERENCES series(id);
ALTER TABLE l_release_group_series ADD CONSTRAINT l_release_group_series_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE l_release_group_series ADD CONSTRAINT l_release_group_series_fk_entity0 FOREIGN KEY (entity0) REFERENCES release_group(id);
ALTER TABLE l_release_group_series ADD CONSTRAINT l_release_group_series_fk_entity1 FOREIGN KEY (entity1) REFERENCES series(id);
ALTER TABLE l_release_series ADD CONSTRAINT l_release_series_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE l_release_series ADD CONSTRAINT l_release_series_fk_entity0 FOREIGN KEY (entity0) REFERENCES release(id);
ALTER TABLE l_release_series ADD CONSTRAINT l_release_series_fk_entity1 FOREIGN KEY (entity1) REFERENCES series(id);
ALTER TABLE l_series_series ADD CONSTRAINT l_series_series_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE l_series_series ADD CONSTRAINT l_series_series_fk_entity0 FOREIGN KEY (entity0) REFERENCES series(id);
ALTER TABLE l_series_series ADD CONSTRAINT l_series_series_fk_entity1 FOREIGN KEY (entity1) REFERENCES series(id);
ALTER TABLE l_series_url ADD CONSTRAINT l_series_url_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE l_series_url ADD CONSTRAINT l_series_url_fk_entity0 FOREIGN KEY (entity0) REFERENCES series(id);
ALTER TABLE l_series_url ADD CONSTRAINT l_series_url_fk_entity1 FOREIGN KEY (entity1) REFERENCES url(id);
ALTER TABLE l_series_work ADD CONSTRAINT l_series_work_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE l_series_work ADD CONSTRAINT l_series_work_fk_entity0 FOREIGN KEY (entity0) REFERENCES series(id);
ALTER TABLE l_series_work ADD CONSTRAINT l_series_work_fk_entity1 FOREIGN KEY (entity1) REFERENCES work(id);
ALTER TABLE link_attribute_text_value ADD CONSTRAINT link_attribute_text_value_fk_link FOREIGN KEY (link) REFERENCES link(id);
ALTER TABLE link_attribute_text_value ADD CONSTRAINT link_attribute_text_value_fk_attribute_type FOREIGN KEY (attribute_type) REFERENCES link_text_attribute_type(attribute_type);
ALTER TABLE link_text_attribute_type ADD CONSTRAINT link_text_attribute_type_fk_attribute_type FOREIGN KEY (attribute_type) REFERENCES link_attribute_type(id) ON DELETE CASCADE;
ALTER TABLE orderable_link_type ADD CONSTRAINT orderable_link_type_fk_link_type FOREIGN KEY (link_type) REFERENCES link_type(id);
ALTER TABLE series ADD CONSTRAINT series_fk_type FOREIGN KEY (type) REFERENCES series_type(id);
ALTER TABLE series ADD CONSTRAINT series_fk_ordering_attribute FOREIGN KEY (ordering_attribute) REFERENCES link_text_attribute_type(attribute_type);
ALTER TABLE series ADD CONSTRAINT series_fk_ordering_type FOREIGN KEY (ordering_type) REFERENCES series_ordering_type(id);
ALTER TABLE series_alias ADD CONSTRAINT series_alias_fk_series FOREIGN KEY (series) REFERENCES series(id);
ALTER TABLE series_alias ADD CONSTRAINT series_alias_fk_type FOREIGN KEY (type) REFERENCES series_alias_type(id);
ALTER TABLE series_annotation ADD CONSTRAINT series_annotation_fk_series FOREIGN KEY (series) REFERENCES series(id);
ALTER TABLE series_annotation ADD CONSTRAINT series_annotation_fk_annotation FOREIGN KEY (annotation) REFERENCES annotation(id);
ALTER TABLE series_gid_redirect ADD CONSTRAINT series_gid_redirect_fk_new_id FOREIGN KEY (new_id) REFERENCES series(id);
ALTER TABLE series_ordering_type ADD CONSTRAINT series_ordering_type_fk_parent FOREIGN KEY (parent) REFERENCES series_ordering_type(id);
ALTER TABLE series_type ADD CONSTRAINT series_type_fk_parent FOREIGN KEY (parent) REFERENCES series_type(id);
COMMIT; | the_stack |
library OpioidCDSCommon version '1.2.3'
using FHIR version '3.0.0'
include FHIRHelpers version '3.0.0' called FHIRHelpers
include OMTKLogicCQL version '1.2.3' called OMTKLogic
include OpioidCDSCommonConfig version '1.2.3' called Config
codesystem "LOINC": 'http://loinc.org'
codesystem "SNOMED": 'http://snomed.info/sct'
// Expression-based
valueset "Opioid analgesics with ambulatory misuse potential": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential'
valueset "Extended release opioid analgesics with ambulatory misuse potential": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/extended-release-opioid-with-ambulatory-misuse-potential'
valueset "Buprenorphine and methadone medications": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/buprenorphine-and-methadone-medications'
// Enumerated-compose
valueset "Limited life expectancy conditions": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/limited-life-expectancy-conditions'
valueset "Therapies indicating end of life care": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/therapies-indicating-end-of-life-care'
valueset "Conditions likely terminal for opioid prescribing": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/conditions-likely-terminal-for-opioid-prescribing'
valueset "CDC malignant cancer conditions": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/cdc-malignant-cancer-conditions'
valueset "Oncology specialty designations (NUCC)": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/oncology-specialty-designations'
valueset "Opioid misuse disorders": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-misuse-disorders'
valueset "Substance misuse behavioral counseling": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/substance-misuse-behavioral-counseling'
valueset "Conditions documenting substance misuse": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/conditions-documenting-substance-misuse'
// Harvested from VSAC - OID: 2.16.840.1.113883.3.464.1003.101.12.1001
// Reviewed with Terminology, 2020-02-05 - Value set name in VSAC is "Office Visit", need to verify suitability
valueset "Office Visit": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/office-visit'
valueset "Opioid counseling procedure": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-counseling-procedure'
/* Existing sets for first six recs */
valueset "Benzodiazepine medications": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/benzodiazepine-medications'
valueset "Non-opioid drug urine screening": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/non-opioid-drug-urine-screening'
valueset "Naloxone medications": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/naloxone-medications'
valueset "Opioid misuse assessment procedure": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-misuse-assessment-procedure'
valueset "Opioid drug urine screening": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-drug-urine-screening'
valueset "Hospice Disposition": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-disposition' // Harvested from VSAC - OID: 2.16.840.1.113762.1.4.1108.15
valueset "Hospice Finding Codes": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-finding'
valueset "Hospice Procedure Codes": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-procedure'
valueset "Observation Category Laboratory": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/observation-category-laboratory'
valueset "Observation Category Procedure": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/observation-category-procedure'
valueset "Pain treatment plan": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/pain-treatment-plan'
valueset "Pain management procedure": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/pain-management-procedure'
valueset "PDMP review procedure": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/pdmp-review-procedure'
valueset "PDMP data reviewed finding": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/pdmp-data-reviewed-finding'
valueset "Community": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/medicationrequest-category-community'
valueset "Active Condition": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-clinical-status-active'
valueset "Active MedicationRequest": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/medicationrequest-status-active'
/* valueset "US Core Condition Categories": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-categories' */
valueset "Encounter Diagnosis Condition Category": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/encounter-diagnosis-condition-category'
valueset "Problem List Condition Category": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/problem-list-condition-category'
valueset "US Core Health Concern Condition Category": 'http://fhir.org/guides/cdc/opioid-cds/ValueSet/us-core-health-concern-condition-category'
context Patient
// TODO: code "Nonpharmacologic therapy and nonopioid pharmocologic": 'TODO' from "TODO"
// TODO: Capture process decisions for long-term opioid use
define "Active Ambulatory Opioid Rx":
(
[MedicationRequest: status in "Active MedicationRequest"] MR
where date from MR.authoredOn 2 years or less on or before Today()
and MR.medication is Reference or MR.medication in "Opioid analgesics with ambulatory misuse potential"
and MR.category in "Community"
) Rx
let Med: [Medication: id in (Last(Split((Rx.medication as FHIR.Reference).reference, '/')))]
where not(Rx.medication is Reference) or Med.code in "Opioid analgesics with ambulatory misuse potential"
return
MedicationRequest {
id: Rx.id,
status: Rx.status,
intent: Rx.intent,
category: Rx.category,
medication: if Rx.medication is Reference then First(Med.code) else Rx.medication as CodeableConcept,
subject: Rx.subject,
recorder: Rx.recorder,
dosageInstruction: Rx.dosageInstruction,
dispenseRequest: Rx.dispenseRequest
}
define "Active Ambulatory Benzodiazepine Rx":
(
[MedicationRequest: status in "Active MedicationRequest"] MR
where date from MR.authoredOn 2 years or less on or before Today()
and MR.medication is Reference or MR.medication in "Benzodiazepine medications"
and MR.category in "Community"
) Rx
let Med: [Medication: id in (Last(Split((Rx.medication as FHIR.Reference).reference, '/')))]
where not(Rx.medication is Reference) or Med.code in "Benzodiazepine medications"
return
MedicationRequest {
id: Rx.id,
status: Rx.status,
intent: Rx.intent,
category: Rx.category,
medication: if Rx.medication is Reference then First(Med.code) else Rx.medication as CodeableConcept,
subject: Rx.subject,
recorder: Rx.recorder,
dosageInstruction: Rx.dosageInstruction,
dispenseRequest: Rx.dispenseRequest
}
define "Active Ambulatory Naloxone Rx":
(
[MedicationRequest: status in "Active MedicationRequest"] MR
where date from MR.authoredOn 2 years or less on or before Today()
and MR.medication is Reference or MR.medication in "Naloxone medications"
and MR.category in "Community"
) Rx
let Med: [Medication: id in (Last(Split((Rx.medication as FHIR.Reference).reference, '/')))]
where not(Rx.medication is Reference) or Med.code in "Naloxone medications"
return
MedicationRequest {
id: Rx.id,
status: Rx.status,
intent: Rx.intent,
category: Rx.category,
medication: if Rx.medication is Reference then First(Med.code) else Rx.medication as CodeableConcept,
subject: Rx.subject,
recorder: Rx.recorder,
dosageInstruction: Rx.dosageInstruction,
dispenseRequest: Rx.dispenseRequest
}
define function "Is Opioid Analgesic with Ambulatory Misuse Potential?"(value List<MedicationRequest>):
value Rx
let Med: [Medication: id in (Last(Split((Rx.medication as FHIR.Reference).reference, '/')))]
where not(Rx.medication is Reference) or Med.code in "Opioid analgesics with ambulatory misuse potential"
and Rx.category in "Community"
return
MedicationRequest {
id: Rx.id,
status: Rx.status,
intent: Rx.intent,
category: Rx.category,
medication: if Rx.medication is Reference then First(Med.code) else Rx.medication as CodeableConcept,
subject: Rx.subject,
authoredOn: Rx.authoredOn,
recorder: Rx.recorder,
dosageInstruction: Rx.dosageInstruction,
dispenseRequest: Rx.dispenseRequest
}
define function "Is Benzodiazepine?"(value List<MedicationRequest>):
value Rx
let Med: [Medication: id in (Last(Split((Rx.medication as FHIR.Reference).reference, '/')))]
where not(Rx.medication is Reference) or Med.code in "Benzodiazepine medications"
and Rx.category in "Community"
return
MedicationRequest {
id: Rx.id,
status: Rx.status,
intent: Rx.intent,
category: Rx.category,
medication: if Rx.medication is Reference then First(Med.code) else Rx.medication as CodeableConcept,
subject: Rx.subject,
authoredOn: Rx.authoredOn,
recorder: Rx.recorder,
dosageInstruction: Rx.dosageInstruction,
dispenseRequest: Rx.dispenseRequest
}
define "End of Life Assessment":
// 1. Conditions indicating end of life or with limited life expectancy
exists (
"Conditions Indicating End of Life or With Limited Life Expectancy"
)
// 2. Admitted/referred/discharged to hospice care
or exists (
"Admitted/Referred/Discharged to Hospice Care"
)
// 3. Medications indicating end of life
/* or exists (
"Medications Indicating End of Life"
) */
define "US Core-Categorized Conditions":
[Condition: category in "Encounter Diagnosis Condition Category"]
union [Condition: category in "Problem List Condition Category"]
union [Condition: category in "US Core Health Concern Condition Category"]
define "Conditions Indicating End of Life or With Limited Life Expectancy":
(
"US Core-Categorized Conditions" C
where C.code in "Conditions likely terminal for opioid prescribing"
and C.clinicalStatus in "Active Condition"
)
union
(
"US Core-Categorized Conditions" C
where C.code in "Limited life expectancy conditions"
and C.clinicalStatus in "Active Condition"
)
define "Admitted/Referred/Discharged to Hospice Care":
(
[Procedure: code in "Hospice Procedure Codes"] P
where P.status.value in { 'in-progress', 'completed' }
)
// NOTE: Disabled due to FHIR.AllTypes not supporting ProcedureRequest
/* union
(
[ProcedureRequest: code in "Hospice Procedure Codes"] E
where E.status.value in { 'active', 'completed', 'suspended' }
) */
union
(
if (Config."Hospice Findings Exclusion Enabled") then
[Observation: code in "Hospice Finding Codes"] O
where not (O.status.value in { 'unknown', 'entered-in-error', 'cancelled' })
else
{}
)
union
(
[Encounter] E
where date from E.period.start 1 year or less on or before Today()
and (
if E.hospitalization.dischargeDisposition.coding is null
or not exists (E.hospitalization.dischargeDisposition.coding)
then false
else E.hospitalization.dischargeDisposition in "Hospice Disposition"
)
and E.status.value in { 'planned', 'arrived', 'in-progress', 'finished', 'onleave' }
)
/*
define "Medications Indicating End of Life":
(
[MedicationAdministration: "End Of Life Opioids"] MA
where MA.status in { 'in-progress', 'on-hold', 'completed' }
)
union
(
[MedicationDispense: "End Of Life Opioids"] MD
where MD.status in { 'preparation', 'in-progress', 'on-hold', 'completed' }
)
union
(
[MedicationRequest: "End Of Life Opioids"] MR
where MR.status in { 'active', 'completed' }
)
union
(
[MedicationStatement: "End Of Life Opioids"] MS
where MS.status in { 'active', 'completed', 'intended' }
)
*/
define "Previous 10 Days Interval":
Interval[Today() - 10 days, Today()]
define "First Month":
Interval[Today() - 3 months, Today() - 2 months]
define "Second Month":
Interval[Today() - 2 months, Today() - 1 months]
define "Third Month":
Interval[Today() - 1 months, Today()]
define "Prescribed Opioids for 21 or more of 30 Days for each of the past 3 Months":
"Days on Opioids during Period"("First Month") >= 21
and "Days on Opioids during Period"("Second Month") >= 21
and "Days on Opioids during Period"("Third Month") >= 21
define function "Prescription Relevant Period"(prescription FHIR.MedicationRequest):
if (
prescription.authoredOn is not null and prescription.dispenseRequest is not null
and prescription.dispenseRequest.expectedSupplyDuration is not null
)
then Interval[
date from prescription.authoredOn,
date from prescription.authoredOn + System.Quantity{ value: GetDurationInDays(prescription.dispenseRequest.expectedSupplyDuration), unit: 'days' }
]
else null
define function "Days on Opioids during Period"(period Interval<Date>):
Sum(
(
collapse (
[MedicationRequest: "Opioid analgesics with ambulatory misuse potential"] OpioidPrescription
return "Prescription Relevant Period"( OpioidPrescription ) intersect period
)
) OpioidUseInterval
return days between start of OpioidUseInterval and end of OpioidUseInterval
)
define function Prescriptions(Orders List<MedicationRequest>):
Orders O
let
// NOTE: Assuming medication is specified as a CodeableConcept with a single RxNorm code
rxNormCode: FHIRHelpers.ToCode((O.medication as FHIR.CodeableConcept).coding[0]),
medicationName: OMTKLogic.GetMedicationName(rxNormCode),
// NOTE: Assuming a single dosage instruction element
dosageInstruction: O.dosageInstruction[0],
repeat: dosageInstruction.timing.repeat,
frequency: Coalesce(repeat.frequencyMax.value, repeat.frequency.value),
period: System.Quantity { value: repeat.period.value, unit: repeat.periodUnit.value },
doseDescription:
Coalesce(
// There should be a conversion from FHIR.SimpleQuantity to System.Quantity
if dosageInstruction.dose is FHIR.Range
then ToString(ToQuantity((dosageInstruction.dose as FHIR.Range).low))
+ '-' + ToString(ToQuantity((dosageInstruction.dose as FHIR.Range).high))
+ (dosageInstruction.dose as FHIR.Range).high.unit.value
else ToString(ToQuantity(dosageInstruction.dose)),
''
),
frequencyDescription:
ToString(dosageInstruction.timing.repeat.frequency.value) +
Coalesce(
'-' + ToString(dosageInstruction.timing.repeat.frequencyMax.value),
''
)
return {
rxNormCode: rxNormCode,
isDraft: O.status.value = 'draft',
// NOTE: Assuming asNeeded is expressed as a boolean
isPRN: dosageInstruction.asNeeded,
prescription:
if dosageInstruction.text is not null then
medicationName + ' ' + dosageInstruction.text.value
else
// TODO: Shouldn't need the .value here on asNeededBoolean
medicationName + ' ' + doseDescription + ' q' + frequencyDescription + (if dosageInstruction.asNeeded then ' PRN' else ''),
// TODO: Shouldn't need the ToQuantity here...
dose: if dosageInstruction.dose is FHIR.Range
then ToQuantity((dosageInstruction.dose as FHIR.Range).high)
else ToQuantity(dosageInstruction.dose),
dosesPerDay: Coalesce(OMTKLogic.ToDaily(frequency, period), 1.0)
}
define function MME(prescriptions List<MedicationRequest>):
(Prescriptions(prescriptions)) P
let mmePerIngredient: OMTKLogic.CalculateMMEs({ { rxNormCode: P.rxNormCode, doseQuantity: P.dose, dosesPerDay: P.dosesPerDay } })
return {
rxNormCode: P.rxNormCode,
isDraft: P.isDraft,
isPRN: P.isPRN,
prescription: P.prescription,
dailyDose: Combine(mmePerIngredient X return X.dailyDoseDescription, '\r\n'),
mme: Sum(mmePerIngredient X return X.mme)
}
define function TotalMME(prescriptions List<MedicationRequest>):
System.Quantity {
value: Sum((MME(prescriptions)) M return M.mme.value),
unit: 'mg/d'
}
define function GetDurationInDays(value FHIR.Duration):
if value is null then null
else
case
when value.code.value ~ 'a' then value.value.value * 365.0
when value.code.value ~ 'mo' then value.value.value * 30.0
when value.code.value ~ 'wk' then value.value.value * 7.0
when value.code.value ~ 'd' then value.value.value
when value.code.value ~ 'h' then value.value.value / 24.0
when value.code.value ~ 'min' then value.value.value / 60.0 / 24.0
when value.code.value ~ 's' then value.value.value / 60.0 / 60.0 / 24.0
when value.code.value ~ 'ms' then value.value.value / 60.0 / 60.0 / 24.0 / 1000.0
when value.code.value is null then Message(1000, true, 'Undefined', 'Error', 'Duration unit code is null')
else Message(1000, true, 'Undefined', 'Error', 'Unsupported duration unit code: ' + value.code.value)
end
define function GetIngredient(rxNormCode Code):
OMTKLogic.GetIngredients(rxNormCode).ingredientName
define function GetIngredients(rxNormCodes List<Code>):
rxNormCodes rnc return GetIngredient(rnc)
/*
* Conversion Functions
*/
define function ToQuantity(quantity FHIR.Quantity):
if quantity.code.value is not null
then System.Quantity { value: quantity.value.value, unit: quantity.code.value }
else System.Quantity { value: quantity.value.value, unit: quantity.unit.value } | the_stack |
-- 2017-07-01T16:40:12.267
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:40:12','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Default Response',Description='Default Response',WEBUI_NameBrowse='Default Response' WHERE AD_Menu_ID=540848 AND AD_Language='en_US'
;
-- 2017-07-01T16:40:55.045
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:40:55','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Default Response',Description='Maintain Default Request Responses' WHERE AD_Window_ID=348 AND AD_Language='en_US'
;
-- 2017-07-01T16:41:26.857
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:41:26','YYYY-MM-DD HH24:MI:SS'),Name='Default Response',Description='Maintain Default Request Responses' WHERE AD_Tab_ID=703 AND AD_Language='en_US'
;
-- 2017-07-01T16:43:48.669
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:43:48','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Unit of Measure',Description='Maintenance of Unit of Measure',WEBUI_NameBrowse='Unit of Measure' WHERE AD_Menu_ID=540794 AND AD_Language='en_US'
;
-- 2017-07-01T16:46:46.184
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:46:46','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Order Control',WEBUI_NameBrowse='Order Control' WHERE AD_Menu_ID=540855 AND AD_Language='en_US'
;
-- 2017-07-01T16:47:28.757
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:47:28','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Order Control',Description='Window for Order Control Data Maintenance' WHERE AD_Window_ID=540274 AND AD_Language='en_US'
;
-- 2017-07-01T16:47:42.482
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:47:42','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Order Control' WHERE AD_Tab_ID=540703 AND AD_Language='it_CH'
;
-- 2017-07-01T16:48:36.515
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:48:36','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Sales Opportunity Board (Prototype)',WEBUI_NameBrowse='Sales Opportunity Board (Prototype)' WHERE AD_Menu_ID=540867 AND AD_Language='en_US'
;
-- 2017-07-01T16:49:21.512
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:49:21','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Menu_ID=1000041 AND AD_Language='en_US'
;
-- 2017-07-01T16:51:15.529
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:51:15','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Purchase Assignment',WEBUI_NameBrowse='Purchase Assignment' WHERE AD_Menu_ID=540785 AND AD_Language='en_US'
;
-- 2017-07-01T16:51:54.537
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:51:54','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Purchase Candidates' WHERE AD_Window_ID=540285 AND AD_Language='en_US'
;
-- 2017-07-01T16:52:09.659
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:52:09','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Purchase Candidates' WHERE AD_Tab_ID=540725 AND AD_Language='en_US'
;
-- 2017-07-01T16:52:19.810
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 16:52:19','YYYY-MM-DD HH24:MI:SS'),Name='Purchase Candidates',WEBUI_NameBrowse='Purchase Candidates' WHERE AD_Menu_ID=540785 AND AD_Language='en_US'
;
-- 2017-07-01T17:21:01.196
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:21:01','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Material Tracking',WEBUI_NameBrowse='Material Tracking' WHERE AD_Menu_ID=540786 AND AD_Language='en_US'
;
-- 2017-07-01T17:21:15.650
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:21:15','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Material Tracking' WHERE AD_Window_ID=540226 AND AD_Language='en_US'
;
-- 2017-07-01T17:21:35.524
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:21:35','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Material Tracking' WHERE AD_Tab_ID=540610 AND AD_Language='en_US'
;
-- 2017-07-01T17:22:15.166
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:22:15','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='MRP Product Info',WEBUI_NameBrowse='MRP Product Info' WHERE AD_Menu_ID=540817 AND AD_Language='en_US'
;
-- 2017-07-01T17:22:28.594
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:22:28','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='MRP Product Info' WHERE AD_Window_ID=540338 AND AD_Language='en_US'
;
-- 2017-07-01T17:23:37.148
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:23:37','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Product for Procurement Contracts' WHERE AD_Window_ID=540288 AND AD_Language='en_US'
;
-- 2017-07-01T17:23:59.143
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:23:59','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Product for Procurement Contracts',WEBUI_NameBrowse='Product for Procurement Contracts' WHERE AD_Menu_ID=540869 AND AD_Language='en_US'
;
-- 2017-07-01T17:25:57.973
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:25:57','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Procurement Availability Trend',WEBUI_NameBrowse='Procurement Availability Trend' WHERE AD_Menu_ID=540870 AND AD_Language='en_US'
;
-- 2017-07-01T17:30:12.581
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:30:12','YYYY-MM-DD HH24:MI:SS'),Name='Request for Proposal',Description='Maintain Request for Proposals',WEBUI_NameBrowse='Request for Proposal' WHERE AD_Menu_ID=540877 AND AD_Language='en_US'
;
-- 2017-07-01T17:30:17.041
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:30:17','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Menu_ID=540877 AND AD_Language='en_US'
;
-- 2017-07-01T17:30:59.667
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:30:59','YYYY-MM-DD HH24:MI:SS'),Name='Request for Proposal',Description='Manage RRequest for Proposals',Help='Request for Proposal to be sent out to vendors of a RfP Topic. After Vendor selection, optionally create Sales Order or Quote for Customer as well as Purchase Order for Vendor(s)' WHERE AD_Window_ID=315 AND AD_Language='en_US'
;
-- 2017-07-01T17:31:25.778
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:31:25','YYYY-MM-DD HH24:MI:SS'),Name='Request for Proposal',Description='Request for Proposal',Help='Request for Proposal to be sent out to vendors of a RfP Topic. After Vendor selection, optionally create Sales Order or Quote for Customer as well as Purchase Order for Vendor(s)' WHERE AD_Tab_ID=613 AND AD_Language='en_US'
;
-- 2017-07-01T17:33:53.913
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:33:53','YYYY-MM-DD HH24:MI:SS'),Name='Request for Proposal Response',Description='Maintain Request for Proposal Responses',WEBUI_NameBrowse='Request for Proposal Response' WHERE AD_Menu_ID=540879 AND AD_Language='en_US'
;
-- 2017-07-01T17:34:17.560
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:34:17','YYYY-MM-DD HH24:MI:SS'),Name='Request for Proposal Response',Description='Manage Request for Proposal Responses' WHERE AD_Window_ID=324 AND AD_Language='en_US'
;
-- 2017-07-01T17:34:58.229
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:34:58','YYYY-MM-DD HH24:MI:SS'),Description='Request for Proposal Response',Help='Request for Proposal Response from a potential Vendor' WHERE AD_Tab_ID=614 AND AD_Language='en_US'
;
-- 2017-07-01T17:35:35.123
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:35:35','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Request for Proposal Responseline',WEBUI_NameBrowse='Request for Proposal Responseline' WHERE AD_Menu_ID=540880 AND AD_Language='en_US'
;
-- 2017-07-01T17:35:59.185
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:35:59','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Request for Proposal Responseline' WHERE AD_Window_ID=540295 AND AD_Language='en_US'
;
-- 2017-07-01T17:36:18.772
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:36:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Request for Proposal Responseline' WHERE AD_Tab_ID=540740 AND AD_Language='en_US'
;
-- 2017-07-01T17:37:17.252
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:37:17','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Allotment',WEBUI_NameBrowse='Allotment' WHERE AD_Menu_ID=540888 AND AD_Language='en_US'
;
-- 2017-07-01T17:37:32.261
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:37:32','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Allotment' WHERE AD_Window_ID=540210 AND AD_Language='en_US'
;
-- 2017-07-01T17:37:46.844
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:37:46','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Allotment' WHERE AD_Tab_ID=540573 AND AD_Language='en_US'
;
-- 2017-07-01T17:50:24.652
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:50:24','YYYY-MM-DD HH24:MI:SS'),Name='Bankaccount',Description='Manage Bankaccounts',WEBUI_NameBrowse='Bankaccount' WHERE AD_Menu_ID=540814 AND AD_Language='en_US'
;
-- 2017-07-01T17:50:27.450
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:50:27','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Menu_ID=540814 AND AD_Language='en_US'
;
-- 2017-07-01T17:51:25.946
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:51:25','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Bankaccount',Description='Manage Bankaccounts',Help='This window allows the user to maintain Bankaccounts.' WHERE AD_Window_ID=540337 AND AD_Language='en_US'
;
-- 2017-07-01T17:51:42.350
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:51:42','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Bankaccount' WHERE AD_Tab_ID=540812 AND AD_Language='en_US'
;
-- 2017-07-01T17:52:18.387
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:52:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Bankstatement',Description='Process Bankstatements',WEBUI_NameBrowse='Bankstatement' WHERE AD_Menu_ID=540803 AND AD_Language='en_US'
;
-- 2017-07-01T17:52:54.676
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:52:54','YYYY-MM-DD HH24:MI:SS'),Name='Bankstatement',Description='Process Bankstatements',Help='The Process Bankstatements window allows you to reconcile your Bankstatements. You can either enter the line items from the statement in the Statement Line tab or select the ''Create From'' button to automatically generate the statement from all unreconciled payments to this bank account. Once you have completed reconciling, select the ''Process Statement'' button to mark the payments as reconciled and update the appropriate GL accounts.' WHERE AD_Window_ID=194 AND AD_Language='en_US'
;
-- 2017-07-01T17:53:25.677
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:53:25','YYYY-MM-DD HH24:MI:SS') WHERE AD_Tab_ID=328 AND AD_Language='en_US'
;
-- 2017-07-01T17:54:15.349
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:54:15','YYYY-MM-DD HH24:MI:SS'),Name='Bank Statement',Description='Process Bank Statements',Help='The Process Bank Statements window allows you to reconcile your Bank Statements. You can either enter the line items from the statement in the Statement Line tab or select the ''Create From'' button to automatically generate the Statement from all unreconciled payments to this bank account. Once you have completed reconciling, select the ''Process Statement'' button to mark the payments as reconciled and update the appropriate GL accounts.' WHERE AD_Window_ID=194 AND AD_Language='en_US'
;
-- 2017-07-01T17:54:41.408
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:54:41','YYYY-MM-DD HH24:MI:SS'),Name='Bank Statement',Description='Process Bank Statements',WEBUI_NameBrowse='Bank Statement' WHERE AD_Menu_ID=540803 AND AD_Language='en_US'
;
-- 2017-07-01T17:55:22.712
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:55:22','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Payment Allocations',Description='Check and remove Payment Allocations',WEBUI_NameBrowse='Payment Allocations' WHERE AD_Menu_ID=540779 AND AD_Language='en_US'
;
-- 2017-07-01T17:56:13.104
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:56:13','YYYY-MM-DD HH24:MI:SS'),Name='Reverse Payment Allocation',Description='View and Reverse Payment Allocations',Help='The Reverse Payment Allocation Window allows you to view and reverse a payment allocation' WHERE AD_Window_ID=205 AND AD_Language='en_US'
;
-- 2017-07-01T17:58:37.330
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:58:37','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Accounting Transactions',Description='View Accounting Transactions',WEBUI_NameBrowse='Accounting Transactions' WHERE AD_Menu_ID=540806 AND AD_Language='en_US'
;
-- 2017-07-01T17:59:02.738
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:59:02','YYYY-MM-DD HH24:MI:SS'),Name='Accounting Transactions',Description='Query Accounting Transactions',Help='Query the detail Accounting Transactions' WHERE AD_Window_ID=162 AND AD_Language='en_US'
;
-- 2017-07-01T17:59:24.848
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 17:59:24','YYYY-MM-DD HH24:MI:SS'),Name='Accounting Transactions',Description='View Accounting Transactions Details' WHERE AD_Tab_ID=242 AND AD_Language='en_US'
;
-- 2017-07-01T18:00:04.990
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:00:04','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Calendar and Year',Description='Maintain Calendar and Years',WEBUI_NameBrowse='Calendar and Year' WHERE AD_Menu_ID=540881 AND AD_Language='en_US'
;
-- 2017-07-01T18:48:06.505
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:48:06','YYYY-MM-DD HH24:MI:SS'),Description='Maintain Calendars, Years and Periods' WHERE AD_Window_ID=117 AND AD_Language='en_US'
;
-- 2017-07-01T18:49:26.500
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:49:26','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Calendar Periods',Description='Maintain Calendar Periods',WEBUI_NameBrowse='Calendar Periods' WHERE AD_Menu_ID=540882 AND AD_Language='en_US'
;
-- 2017-07-01T18:49:41.361
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:49:41','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Calendar Periods',Description='Maintain Calendar Periods' WHERE AD_Window_ID=540349 AND AD_Language='de_CH'
;
-- 2017-07-01T18:49:57.035
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:49:57','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Periods' WHERE AD_Tab_ID=540838 AND AD_Language='en_US'
;
-- 2017-07-01T18:50:19.899
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:50:19','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Period Control' WHERE AD_Tab_ID=540839 AND AD_Language='en_US'
;
-- 2017-07-01T18:50:47.724
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:50:47','YYYY-MM-DD HH24:MI:SS'),Description='Control the allowed Activity for Periods' WHERE AD_Tab_ID=540839 AND AD_Language='en_US'
;
-- 2017-07-01T18:51:52.267
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:51:52','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Tax Rate',Description='Maintain Tax Rates',WEBUI_NameBrowse='Tax Rate' WHERE AD_Menu_ID=540842 AND AD_Language='en_US'
;
-- 2017-07-01T18:53:04.743
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:53:04','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Tax Category',Description='Maintain Tax Categories',WEBUI_NameBrowse='Tax Category' WHERE AD_Menu_ID=540843 AND AD_Language='en_US'
;
-- 2017-07-01T18:53:43.608
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:53:43','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Currency',Description='Maintain Currencies',WEBUI_NameBrowse='Currency' WHERE AD_Menu_ID=540812 AND AD_Language='en_US'
;
-- 2017-07-01T18:54:46.543
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:54:46','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Currency Rate',Description='Maintain Currency Rates and Currency Exchange Rates',WEBUI_NameBrowse='Currency Rate' WHERE AD_Menu_ID=540813 AND AD_Language='en_US'
;
-- 2017-07-01T18:55:28.065
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:55:28','YYYY-MM-DD HH24:MI:SS'),Description='Maintain Currency Rates for Currency Conversion' WHERE AD_Menu_ID=540813 AND AD_Language='en_US'
;
-- 2017-07-01T18:56:40.592
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:56:40','YYYY-MM-DD HH24:MI:SS'),Name='Dunning Type' WHERE AD_Window_ID=159 AND AD_Language='en_US'
;
-- 2017-07-01T18:56:50.877
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:56:50','YYYY-MM-DD HH24:MI:SS'),Name='Dunning Type' WHERE AD_Tab_ID=231 AND AD_Language='en_US'
;
-- 2017-07-01T18:57:23.018
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 18:57:23','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Dunning Type',Description='Maintain Dunning Types',WEBUI_NameBrowse='Dunning Type' WHERE AD_Menu_ID=540780 AND AD_Language='en_US'
;
-- 2017-07-01T20:05:18.954
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:05:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Delivery Days',WEBUI_NameBrowse='Delivery Days' WHERE AD_Menu_ID=540797 AND AD_Language='en_US'
;
-- 2017-07-01T20:05:55.288
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:05:55','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Delivery Days',Description='View and maintain Delivery Days' WHERE AD_Window_ID=540110 AND AD_Language='en_US'
;
-- 2017-07-01T20:13:04.702
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:13:04','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Distribution Order',WEBUI_NameBrowse='Distribution Order' WHERE AD_Menu_ID=540829 AND AD_Language='en_US'
;
-- 2017-07-01T20:13:27.366
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET Name='Distributionsauftrag',Updated=TO_TIMESTAMP('2017-07-01 20:13:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=53012
;
-- 2017-07-01T20:13:27.401
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Description='Distribution Order allow create Order inter warehouse to supply a demand ', IsActive='Y', Name='Distributionsauftrag',Updated=TO_TIMESTAMP('2017-07-01 20:13:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53068
;
-- 2017-07-01T20:13:47.274
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Distributionsauftrag',Updated=TO_TIMESTAMP('2017-07-01 20:13:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53055
;
-- 2017-07-01T20:14:45.383
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:14:45','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Packing Instruction',WEBUI_NameBrowse='Packing Instruction' WHERE AD_Menu_ID=540830 AND AD_Language='en_US'
;
-- 2017-07-01T20:14:58.469
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:14:58','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Packing Instruction' WHERE AD_Window_ID=540343 AND AD_Language='en_US'
;
-- 2017-07-01T20:15:08.144
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:15:08','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Packing Instruction' WHERE AD_Tab_ID=540822 AND AD_Language='en_US'
;
-- 2017-07-01T20:15:31.280
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:15:31','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Packing Instruction Version',WEBUI_NameBrowse='Packing Instruction Version' WHERE AD_Menu_ID=540831 AND AD_Language='en_US'
;
-- 2017-07-01T20:15:48.630
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:15:48','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Packing Instruction Version' WHERE AD_Window_ID=540344 AND AD_Language='en_US'
;
-- 2017-07-01T20:16:02.026
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:16:02','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Packing Instruction Version' WHERE AD_Tab_ID=540823 AND AD_Language='en_US'
;
-- 2017-07-01T20:16:31.919
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET Name='Packvorschrift Version',Updated=TO_TIMESTAMP('2017-07-01 20:16:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=540344
;
-- 2017-07-01T20:16:58.834
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:16:58','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Packing Material',WEBUI_NameBrowse='Packing Material' WHERE AD_Menu_ID=540844 AND AD_Language='en_US'
;
-- 2017-07-01T20:17:14.079
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:17:14','YYYY-MM-DD HH24:MI:SS'),Name='Packing Material' WHERE AD_Window_ID=540192 AND AD_Language='en_US'
;
-- 2017-07-01T20:17:26.570
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:17:26','YYYY-MM-DD HH24:MI:SS'),Name='Packing Material' WHERE AD_Tab_ID=540521 AND AD_Language='en_US'
;
-- 2017-07-01T20:18:47.046
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:18:47','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Transport Delivery' WHERE AD_Window_ID=540346 AND AD_Language='en_US'
;
-- 2017-07-01T20:19:01.327
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:19:01','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Transport Delivery' WHERE AD_Tab_ID=540831 AND AD_Language='en_US'
;
-- 2017-07-01T20:19:10.391
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:19:10','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Transport Delivery',WEBUI_NameBrowse='Transport Delivery' WHERE AD_Menu_ID=540857 AND AD_Language='en_US'
;
-- 2017-07-01T20:19:51.156
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:19:51','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Product Transactions',WEBUI_NameBrowse='Product Transactions' WHERE AD_Menu_ID=540860 AND AD_Language='en_US'
;
-- 2017-07-01T20:20:13.769
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:20:13','YYYY-MM-DD HH24:MI:SS'),Name='Product Transactions',Description='Product Transactions' WHERE AD_Window_ID=223 AND AD_Language='en_US'
;
-- 2017-07-01T20:20:39.095
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:20:39','YYYY-MM-DD HH24:MI:SS'),Name='Material Transactions',Description='Material Transactions' WHERE AD_Window_ID=223 AND AD_Language='en_US'
;
-- 2017-07-01T20:21:09.989
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET Description='Produkt Transaktionen', Name='Produkt Transaktionen',Updated=TO_TIMESTAMP('2017-07-01 20:21:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=223
;
-- 2017-07-01T20:21:09.999
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Description='Produkt Transaktionen', IsActive='Y', Name='Produkt Transaktionen',Updated=TO_TIMESTAMP('2017-07-01 20:21:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=540860
;
-- 2017-07-01T20:21:10.003
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Description='Produkt Transaktionen', IsActive='Y', Name='Produkt Transaktionen',Updated=TO_TIMESTAMP('2017-07-01 20:21:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=292
;
-- 2017-07-01T20:21:54.319
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:21:54','YYYY-MM-DD HH24:MI:SS'),Name='Material Transactions',Description='Material Transactions',WEBUI_NameBrowse='Material Transactions' WHERE AD_Menu_ID=540860 AND AD_Language='en_US'
;
-- 2017-07-01T20:22:30.499
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:22:30','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Transportation Order',WEBUI_NameBrowse='Transportation Order' WHERE AD_Menu_ID=540866 AND AD_Language='en_US'
;
-- 2017-07-01T20:22:44.790
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:22:44','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Transportation Order' WHERE AD_Window_ID=540020 AND AD_Language='en_US'
;
-- 2017-07-01T20:23:18.147
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:23:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Transportation Delivery' WHERE AD_Tab_ID=540096 AND AD_Language='en_US'
;
-- 2017-07-01T20:23:49.425
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:23:49','YYYY-MM-DD HH24:MI:SS'),Name='Distribution Configuration',WEBUI_NameBrowse='Distribution Configuration' WHERE AD_Menu_ID=540821 AND AD_Language='en_US'
;
-- 2017-07-01T20:23:51.673
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:23:51','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Menu_ID=540821 AND AD_Language='en_US'
;
-- 2017-07-01T20:24:10.525
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET Name='Distributions Netzwerk',Updated=TO_TIMESTAMP('2017-07-01 20:24:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=53018
;
-- 2017-07-01T20:24:10.526
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Description='Distribution Network define the supply relationships', IsActive='Y', Name='Distributions Netzwerk',Updated=TO_TIMESTAMP('2017-07-01 20:24:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=540821
;
-- 2017-07-01T20:24:10.527
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Description='Distribution Network define the supply relationships', IsActive='Y', Name='Distributions Netzwerk',Updated=TO_TIMESTAMP('2017-07-01 20:24:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53088
;
-- 2017-07-01T20:24:34.156
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Distributions Netzwerk',Updated=TO_TIMESTAMP('2017-07-01 20:24:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53071
;
-- 2017-07-01T20:25:22.490
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:25:22','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Empties Receive',WEBUI_NameBrowse='Empties Receive' WHERE AD_Menu_ID=540781 AND AD_Language='en_US'
;
-- 2017-07-01T20:25:32.699
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:25:32','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Empties Receive' WHERE AD_Window_ID=540323 AND AD_Language='en_US'
;
-- 2017-07-01T20:26:02.381
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Leergut Rücknahme',Updated=TO_TIMESTAMP('2017-07-01 20:26:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540782
;
-- 2017-07-01T20:26:14.972
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:26:14','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Empties Receive' WHERE AD_Tab_ID=540782 AND AD_Language='en_US'
;
-- 2017-07-01T20:26:52.508
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:26:52','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Vendor Returns',WEBUI_NameBrowse='Vendor Returns' WHERE AD_Menu_ID=540782 AND AD_Language='en_US'
;
-- 2017-07-01T20:27:08.803
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:27:08','YYYY-MM-DD HH24:MI:SS'),Name='Vendor Returns' WHERE AD_Window_ID=53098 AND AD_Language='en_US'
;
-- 2017-07-01T20:27:19.750
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-01 20:27:19','YYYY-MM-DD HH24:MI:SS'),Name='Vendor Returns' WHERE AD_Tab_ID=53276 AND AD_Language='en_US'
; | the_stack |
DROP TABLE IF EXISTS mpp_row_table1;
DROP TABLE IF EXISTS mpp_col_table1;
DROP TABLE IF EXISTS mpp_row_partition_table1;
DROP TABLE IF EXISTS mpp_col_partition_table1;
DROP TABLE IF EXISTS mpp_row_table2;
DROP TABLE IF EXISTS mpp_col_table2;
DROP TABLE IF EXISTS mpp_row_partition_table2;
DROP TABLE IF EXISTS mpp_col_parititon_table2;
CREATE SCHEMA redis_schema;
CREATE TABLE mpp_row_table1(id int, id2 int, name varchar);
CREATE INDEX mpp_row_table1_index1 on mpp_row_table1(id);
CREATE INDEX mpp_row_table1_index2 on mpp_row_table1(name);
CREATE INDEX mpp_row_table1_index3 on mpp_row_table1(id);
INSERT INTO mpp_row_table1 values(generate_series(1,20),111,'122');
alter table mpp_row_table1 drop column id2;
CREATE TABLE mpp_col_table1(id int, id2 int, name varchar)with(orientation = column);
CREATE INDEX mpp_col_table1_index1 on mpp_col_table1(id);
CREATE INDEX mpp_col_table1_index2 on mpp_col_table1(name);
INSERT INTO mpp_col_table1 VALUES(generate_series(1,20),111, '122');
alter table mpp_col_table1 drop column id2;
CREATE TABLE mpp_row_partition_table1(id int, id2 int, name varchar) partition by range(id) (partition p1 values less than (6),partition p2 values less than (10));
CREATE INDEX mpp_row_partition_table1_index1 on mpp_row_partition_table1(id) local;
CREATE INDEX mpp_row_partition_table1_index2 on mpp_row_partition_table1(name) local;
CREATE INDEX mpp_row_partition_table1_index3 on mpp_row_partition_table1(id) local;
INSERT INTO mpp_row_partition_table1 VALUES(1,111,'122');
INSERT INTO mpp_row_partition_table1 VALUES(8,811,'822');
alter table mpp_row_partition_table1 drop column id2;
CREATE TABLE mpp_col_partition_table1(id int, id2 int, name varchar) with(orientation = column) partition by range(id) (partition p1 values less than (6),partition p2 values less than (11));
CREATE INDEX mpp_col_partition_table1_index1 on mpp_col_partition_table1(id) local;
CREATE INDEX mpp_col_partition_table1_index2 on mpp_col_partition_table1(name) local;
INSERT INTO mpp_col_partition_table1 VALUES(1, 111,'122');
INSERT INTO mpp_col_partition_table1 VALUES(8, 811,'122');
alter table mpp_col_partition_table1 drop column id2;
ALTER TABLE mpp_row_table1 SET (append_mode=on, rel_cn_oid=12345);
ALTER TABLE mpp_row_partition_table1 SET (append_mode=on, rel_cn_oid=12345);
CREATE INDEX create_fail on mpp_row_table1(id);
CREATE INDEX create_fail2 on mpp_row_partition_table1(id);
REINDEX TABLE mpp_row_table1;
REINDEX TABLE mpp_row_partition_table1;
REINDEX INDEX mpp_row_table1_index1;
REINDEX INDEX mpp_row_partition_table1_index1;
CREATE TABLE redis_schema.mpp_row_table2(like mpp_row_table1 including INDEXES including storage INCLUDING RELOPTIONS including distribution, nodeid int,tupleblocknum bigint,tupleoffset int);
CREATE TABLE mpp_col_table2(like mpp_col_table1 including storage INCLUDING RELOPTIONS including distribution, nodeid int,tupleblocknum bigint,tupleoffset int);
CREATE TABLE redis_schema.mpp_row_partition_table2(like mpp_row_partition_table1 including INDEXES including storage INCLUDING RELOPTIONS including distribution including partition,nodeid int,partitionoid int,tupleblocknum bigint,tupleoffset int);
CREATE TABLE mpp_col_partition_table2(like mpp_col_partition_table1 including storage INCLUDING RELOPTIONS including distribution including partition,nodeid int,partitionoid int,tupleblocknum bigint,tupleoffset int);
select c.relname from pg_class as a, pg_index as b, pg_class as c where a.relname in ('mpp_row_table1', 'mpp_row_table2', 'mpp_row_partition_table1', 'mpp_row_partition_table2') and a.oid=b.indrelid and b.indexrelid=c.oid order by c.relname;
INSERT INTO redis_schema.mpp_row_table2 values(generate_series(1,20),'222',233,244,255);
INSERT INTO mpp_col_table2 VALUES(generate_series(1,20),'222',233,244,255);
INSERT INTO redis_schema.mpp_row_partition_table2 VALUES(1,'222',233,244,255,266);
INSERT INTO redis_schema.mpp_row_partition_table2 VALUES(8,'822',833,844,855,866);
INSERT INTO mpp_col_partition_table2 VALUES(1,'222',233,244,255,266);
INSERT INTO mpp_col_partition_table2 VALUES(8,'822',833,844,855,866);
alter table mpp_row_table1 add column nodeid int,add column tupleblocknum bigint, add column tupleoffset int;
alter table mpp_row_table1 drop column nodeid,drop column tupleblocknum, drop column tupleoffset;
alter table redis_schema.mpp_row_table2 drop column nodeid,drop column tupleblocknum, drop column tupleoffset;
select gs_switch_relfilenode('mpp_row_table1','redis_schema.mpp_row_table2');
--procedure to switch relname and check the data count
create or replace procedure switch_relfilenode_and_check_for_nonpart_table(t1 in TEXT, t1_index1 in TEXT, t1_index2 in TEXT, t1_index3 in TEXT, t2 in TEXT, t2_index1 in TEXT, t2_index2 in TEXT, t2_index3 in TEXT, public_schema IN TEXT, tmp_schema in TEXT)
as
old_num_t1 integer;
old_t1_index1 integer;
old_t1_index2 integer;
old_t1_index3 integer;
old_num_t2 integer;
old_t2_index1 integer;
old_t2_index2 integer;
old_t2_index3 integer;
new_num_t1 integer;
new_t1_index1 integer;
new_t1_index2 integer;
new_t1_index3 integer;
new_num_t2 integer;
new_t2_index1 integer;
new_t2_index2 integer;
new_t2_index3 integer;
t1_fullname TEXT;
t2_fullname TEXT;
begin
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t1 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || public_schema || ''''' ''') into old_num_t1;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t1_index1 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || public_schema || ''''' ''') into old_t1_index1;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t1_index2 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || public_schema || ''''' ''') into old_t1_index2;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t1_index3 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || public_schema || ''''' ''') into old_t1_index3;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t2 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || tmp_schema || ''''' ''') into old_num_t2;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t2_index1 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || tmp_schema || ''''' ''') into old_t2_index1;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t2_index2 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || tmp_schema || ''''' ''') into old_t2_index2;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t2_index3 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || tmp_schema || ''''' ''') into old_t2_index3;
t1_fullname := public_schema||'.'||t1;
t2_fullname := tmp_schema||'.'||t2;
execute('select gs_switch_relfilenode(''' || t1_fullname || ''' , ''' || t2_fullname || ''')');
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t1 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || public_schema || ''''' ''') into new_num_t1;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t1_index1 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || public_schema || ''''' ''') into new_t1_index1;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t1_index2 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || public_schema || ''''' ''') into new_t1_index2;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t1_index3 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || public_schema || ''''' ''') into new_t1_index3;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t2 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || tmp_schema || ''''' ''') into new_num_t2;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t2_index1 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || tmp_schema || ''''' ''') into new_t2_index1;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t2_index2 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || tmp_schema || ''''' ''') into new_t2_index2;
execute('execute direct on (datanode1) ''select a.relfilenode from pg_class as a, pg_namespace as b where a.relname=''''' || t2_index3 || ''''' and a.relnamespace=b.oid and b.nspname=''''' || tmp_schema || ''''' ''') into new_t2_index3;
if (old_num_t1 = new_num_t2 and old_t1_index1 = new_t2_index1 and old_t1_index2 = new_t2_index2 and old_t1_index3 = new_t2_index3 and old_num_t2 = new_num_t1 and old_t2_index1 = new_t1_index1 and old_t2_index2 = new_t1_index2 and old_t2_index3 = new_t1_index3) then
else
end if;
return;
end;
/
select switch_relfilenode_and_check_for_nonpart_table('mpp_row_table1', 'mpp_row_table1_index1', 'mpp_row_table1_index2', 'mpp_row_table1_index3', 'mpp_row_table2', 'mpp_row_table1_index1', 'mpp_row_table1_index2', 'mpp_row_table1_index3', 'public', 'redis_schema');
select * from mpp_row_table1 order by 1;
select * from redis_schema.mpp_row_table2 order by 1;
alter table mpp_col_table1 add column nodeid int,add column tupleblocknum bigint, add column tupleoffset int;
alter table mpp_col_table1 drop column nodeid,drop column tupleblocknum, drop column tupleoffset;
alter table mpp_col_table2 drop column nodeid,drop column tupleblocknum, drop column tupleoffset;
select gs_switch_relfilenode('mpp_col_table1','mpp_col_table2');
select * from mpp_col_table1 order by id;
select * from mpp_col_table2 order by id;
alter table mpp_row_partition_table1 add column nodeid int,add column partitionoid int,add column tupleblocknum bigint, add column tupleoffset int;
alter table mpp_row_partition_table1 drop column nodeid,drop column partitionoid,drop column tupleblocknum, drop column tupleoffset;
alter table redis_schema.mpp_row_partition_table2 drop column nodeid,drop column partitionoid,drop column tupleblocknum, drop column tupleoffset;
--procedure to switch relname and check the data count
create or replace procedure switch_relfilenode_and_check_for_part_table(t1 in TEXT, t1_index1 in TEXT, t1_index2 in TEXT, t1_index3 in TEXT, t2 in TEXT, t2_index1 in TEXT, t2_index2 in TEXT, t2_index3 in TEXT, table_part_name in TEXT, index_part_name1 in TEXT, index_part_name2 in TEXT, public_schema IN TEXT, tmp_schema in TEXT)
as
old_num_t1 integer;
old_t1_index1 integer;
old_t1_index2 integer;
old_t1_index3 integer;
old_num_t2 integer;
old_t2_index1 integer;
old_t2_index2 integer;
old_t2_index3 integer;
new_num_t1 integer;
new_t1_index1 integer;
new_t1_index2 integer;
new_t1_index3 integer;
new_num_t2 integer;
new_t2_index1 integer;
new_t2_index2 integer;
new_t2_index3 integer;
t1_fullname TEXT;
t2_fullname TEXT;
begin
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t1 || ''''' and b.relname=''''' || table_part_name || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || public_schema || ''''' ''') into old_num_t1;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t1_index1 || ''''' and b.relname=''''' || index_part_name1 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || public_schema || ''''' ''') into old_t1_index1;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t1_index2 || ''''' and b.relname=''''' || index_part_name2 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || public_schema || ''''' ''') into old_t1_index2;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t1_index3 || ''''' and b.relname=''''' || index_part_name1 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || public_schema || ''''' ''') into old_t1_index3;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t2 || ''''' and b.relname=''''' || table_part_name || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || tmp_schema || ''''' ''') into old_num_t2;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t2_index1 || ''''' and b.relname=''''' || index_part_name1 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || tmp_schema || ''''' ''') into old_t2_index1;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t2_index2 || ''''' and b.relname=''''' || index_part_name2 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || tmp_schema || ''''' ''') into old_t2_index2;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t2_index3 || ''''' and b.relname=''''' || index_part_name1 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || tmp_schema || ''''' ''') into old_t2_index3;
t1_fullname := public_schema||'.'||t1;
t2_fullname := tmp_schema||'.'||t2;
execute('select gs_switch_relfilenode(''' || t1_fullname || ''' , ''' || t2_fullname || ''')');
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t1 || ''''' and b.relname=''''' || table_part_name || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || public_schema || ''''' ''') into new_num_t1;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t1_index1 || ''''' and b.relname=''''' || index_part_name1 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || public_schema || ''''' ''') into new_t1_index1;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t1_index2 || ''''' and b.relname=''''' || index_part_name2 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || public_schema || ''''' ''') into new_t1_index2;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t1_index3 || ''''' and b.relname=''''' || index_part_name1 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || public_schema || ''''' ''') into new_t1_index3;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t2 || ''''' and b.relname=''''' || table_part_name || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || tmp_schema || ''''' ''') into new_num_t2;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t2_index1 || ''''' and b.relname=''''' || index_part_name1 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || tmp_schema || ''''' ''') into new_t2_index1;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t2_index2 || ''''' and b.relname=''''' || index_part_name2 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || tmp_schema || ''''' ''') into new_t2_index2;
execute('execute direct on (datanode1) ''select b.relfilenode from pg_class as a, pg_partition as b, pg_namespace as c where a.relname=''''' || t2_index3 || ''''' and b.relname=''''' || index_part_name1 || ''''' and a.oid=b.parentid and a.relnamespace=c.oid and c.nspname=''''' || tmp_schema || ''''' ''') into new_t2_index3;
if (old_num_t1 = new_num_t2 and old_t1_index1 = new_t2_index1 and old_t1_index2 = new_t2_index2 and old_t1_index3 = new_t2_index3 and old_num_t2 = new_num_t1 and old_t2_index1 = new_t1_index1 and old_t2_index2 = new_t1_index2 and old_t2_index3 = new_t1_index3) then
else
end if;
return;
end;
/
select switch_relfilenode_and_check_for_part_table('mpp_row_partition_table1', 'mpp_row_partition_table1_index1', 'mpp_row_partition_table1_index2', 'mpp_row_partition_table1_index3', 'mpp_row_partition_table2', 'mpp_row_partition_table1_index1', 'mpp_row_partition_table1_index2', 'mpp_row_partition_table1_index3', 'p1', 'p1_id_idx', 'p1_name_idx', 'public', 'redis_schema');
select * from mpp_row_partition_table1 order by id;
select * from redis_schema.mpp_row_partition_table2 order by id;
alter table mpp_col_partition_table1 add column nodeid int,add column partitionoid int,add column tupleblocknum bigint, add column tupleoffset int;
alter table mpp_col_partition_table1 drop column nodeid,drop column partitionoid,drop column tupleblocknum, drop column tupleoffset;
alter table mpp_col_partition_table2 drop column nodeid,drop column partitionoid,drop column tupleblocknum, drop column tupleoffset;
select gs_switch_relfilenode('mpp_col_partition_table1','mpp_col_partition_table2');
select * from mpp_col_partition_table1 order by id;
select * from mpp_col_partition_table2 order by id;
/* add test for swap attinfos during swap relfilenode */
-- no partition table;
create table row_t1(c1 int, c2 int);
create table row_t2(like row_t1 including storage INCLUDING RELOPTIONS including distribution, c3 int, c4 int);
insert into row_t1 values(1,2);
insert into row_t2 values(3,4,1,2);
alter table row_t2 drop column c3, drop column c4;
alter table row_t1 add column c3 int, add column c4 int;
alter table row_t1 drop column c3, drop column c4;
-- get original natts
select relname, relnatts from pg_class where relname in ('row_t1', 'row_t2') order by relname;
select gs_switch_relfilenode('row_t1','row_t2');
-- relnatts must be swap
select relname, relnatts from pg_class where relname in ('row_t1', 'row_t2') order by relname;
select * from row_t1 order by 1;
select * from row_t2 order by 1;
-- partition table;
CREATE TABLE row_partition_t1(id int, name varchar) partition by range(id) (partition p1 values less than (6),partition p2 values less than (10));
CREATE TABLE row_partition_t2(like row_partition_t1 including storage INCLUDING RELOPTIONS including distribution including partition,i int, j int);
insert into row_partition_t1 values(1, 'row_partition_t1');
insert into row_partition_t2 values(1, 'row_partition_t2', 1, 1);
alter table row_partition_t2 drop column i, drop column j;
alter table row_partition_t1 add column i int, add column j int;
alter table row_partition_t1 drop column i, drop column j;
-- get original the natts
select relname, relnatts from pg_class where relname in ('row_partition_t1', 'row_partition_t2') order by relname;
select gs_switch_relfilenode('row_partition_t1', 'row_partition_t2');
-- check whether the natts is changed.
select relname, relnatts from pg_class where relname in ('row_partition_t1', 'row_partition_t2') order by relname;
select * from row_partition_t1 order by id;
select * from row_partition_t2 order by id;
DROP TABLE mpp_row_table1;
DROP TABLE mpp_col_table1;
DROP TABLE mpp_row_partition_table1;
DROP TABLE mpp_col_partition_table1;
DROP TABLE redis_schema.mpp_row_table2;
DROP TABLE mpp_col_table2;
DROP TABLE redis_schema.mpp_row_partition_table2;
DROP TABLE mpp_col_partition_table2;
DROP TABLE row_partition_t1;
DROP TABLE row_partition_t2;
DROP TABLE row_t1;
DROP TABLE row_t2;
DROP PROCEDURE switch_relfilenode_and_check_for_nonpart_table;
DROP PROCEDURE switch_relfilenode_and_check_for_part_table;
DROP SCHEMA redis_schema cascade;
select DISTINCT node_name from pg_pooler_status order by 1; | the_stack |
-- 2019-01-13T13:31:15.129
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-13 13:31:15','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Preisgrundlage',PrintName='Preisgrundlage' WHERE AD_Element_ID=543953 AND AD_Language='de_CH'
;
-- 2019-01-13T13:31:15.439
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543953,'de_CH')
;
-- 2019-01-13T13:31:24.144
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-13 13:31:24','YYYY-MM-DD HH24:MI:SS'),Name='Price base',PrintName='Price base' WHERE AD_Element_ID=543953 AND AD_Language='en_US'
;
-- 2019-01-13T13:31:24.157
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543953,'en_US')
;
-- 2019-01-13T13:31:33.755
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-13 13:31:33','YYYY-MM-DD HH24:MI:SS'),Name='Preisgrundlage',PrintName='Preisgrundlage' WHERE AD_Element_ID=543953 AND AD_Language='nl_NL'
;
-- 2019-01-13T13:31:33.775
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543953,'nl_NL')
;
-- 2019-01-13T13:31:40.987
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-13 13:31:40','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Preisgrundlage',PrintName='Preisgrundlage' WHERE AD_Element_ID=543953 AND AD_Language='de_DE'
;
-- 2019-01-13T13:31:41
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543953,'de_DE')
;
-- 2019-01-13T13:31:41.030
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(543953,'de_DE')
;
-- 2019-01-13T13:31:41.045
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='PriceBase', Name='Preisgrundlage', Description=NULL, Help=NULL WHERE AD_Element_ID=543953
;
-- 2019-01-13T13:31:41.059
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='PriceBase', Name='Preisgrundlage', Description=NULL, Help=NULL, AD_Element_ID=543953 WHERE UPPER(ColumnName)='PRICEBASE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-01-13T13:31:41.066
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='PriceBase', Name='Preisgrundlage', Description=NULL, Help=NULL WHERE AD_Element_ID=543953 AND IsCentrallyMaintained='Y'
;
-- 2019-01-13T13:31:41.072
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Preisgrundlage', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=543953) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 543953)
;
-- 2019-01-13T13:31:41.097
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Preisgrundlage', Name='Preisgrundlage' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=543953)
;
-- 2019-01-13T13:31:41.104
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Preisgrundlage', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 543953
;
-- 2019-01-13T13:31:41.112
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Preisgrundlage', Description=NULL, Help=NULL WHERE AD_Element_ID = 543953
;
-- 2019-01-13T13:31:41.120
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name='Preisgrundlage', Description=NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 543953
;
-- 2019-01-13T13:47:45.271
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,575937,0,TO_TIMESTAMP('2019-01-13 13:47:45','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.pricing','Y','Festpreis','Festpreis',TO_TIMESTAMP('2019-01-13 13:47:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-13T13:47:45.274
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=575937 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2019-01-13T13:47:50.509
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-13 13:47:50','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=575937 AND AD_Language='de_CH'
;
-- 2019-01-13T13:47:50.527
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575937,'de_CH')
;
-- 2019-01-13T13:47:53.229
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-13 13:47:53','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=575937 AND AD_Language='de_DE'
;
-- 2019-01-13T13:47:53.242
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575937,'de_DE')
;
-- 2019-01-13T13:47:53.265
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(575937,'de_DE')
;
-- 2019-01-13T13:48:03.519
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-13 13:48:03','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Fixed price',PrintName='Fixed price' WHERE AD_Element_ID=575937 AND AD_Language='en_US'
;
-- 2019-01-13T13:48:03.533
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575937,'en_US')
;
-- 2019-01-13T13:48:07.920
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=622222
;
-- 2019-01-13T13:48:08.122
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Link (AD_Client_ID,AD_Element_ID,AD_Element_Link_ID,AD_Field_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,957,625056,563197,0,233,TO_TIMESTAMP('2019-01-13 13:48:07','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2019-01-13 13:48:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-13T13:48:12.940
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Name_ID=575937, Description=NULL, Help=NULL, Name='Festpreis',Updated=TO_TIMESTAMP('2019-01-13 13:48:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=563197
;
-- 2019-01-13T13:48:12.971
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=625056
;
-- 2019-01-13T13:48:13.070
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Link (AD_Client_ID,AD_Element_ID,AD_Element_Link_ID,AD_Field_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,575937,625057,563197,0,233,TO_TIMESTAMP('2019-01-13 13:48:12','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2019-01-13 13:48:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-13T13:48:13.072
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(575937)
;
-- 2019-01-13T13:49:25.730
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=1229 AND AD_Language='fr_CH'
;
-- 2019-01-13T13:49:25.756
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=1229 AND AD_Language='it_CH'
;
-- 2019-01-13T13:49:25.778
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=1229 AND AD_Language='en_GB'
;
-- 2019-01-13T13:49:44.514
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-13 13:49:44','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Description='',Help='' WHERE AD_Element_ID=1229 AND AD_Language='de_CH'
;
-- 2019-01-13T13:49:44.526
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1229,'de_CH')
;
-- 2019-01-13T13:49:54.913
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-13 13:49:54','YYYY-MM-DD HH24:MI:SS'),Description='',Help='' WHERE AD_Element_ID=1229 AND AD_Language='de_DE'
;
-- 2019-01-13T13:49:54.934
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1229,'de_DE')
;
-- 2019-01-13T13:49:54.965
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(1229,'de_DE')
;
-- 2019-01-13T13:49:54.978
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='Std_AddAmt', Name='Aufschlag auf Standardpreis', Description='', Help='' WHERE AD_Element_ID=1229
;
-- 2019-01-13T13:49:54.990
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Std_AddAmt', Name='Aufschlag auf Standardpreis', Description='', Help='', AD_Element_ID=1229 WHERE UPPER(ColumnName)='STD_ADDAMT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-01-13T13:49:54.998
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Std_AddAmt', Name='Aufschlag auf Standardpreis', Description='', Help='' WHERE AD_Element_ID=1229 AND IsCentrallyMaintained='Y'
;
-- 2019-01-13T13:49:55.007
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Aufschlag auf Standardpreis', Description='', Help='' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=1229) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 1229)
;
-- 2019-01-13T13:49:55.034
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Aufschlag auf Standardpreis', Description='', Help='', CommitWarning = NULL WHERE AD_Element_ID = 1229
;
-- 2019-01-13T13:49:55.041
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Aufschlag auf Standardpreis', Description='', Help='' WHERE AD_Element_ID = 1229
;
-- 2019-01-13T13:49:55.049
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name='Aufschlag auf Standardpreis', Description='', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 1229
;
-- 2019-01-13T13:56:24.348
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=185,Updated=TO_TIMESTAMP('2019-01-13 13:56:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552443
;
-- 2019-01-14T08:21:26.984
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET EntityType='de.metas.pricing',Updated=TO_TIMESTAMP('2019-01-14 08:21:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=1000093
;
-- 2019-01-14T08:22:56.636
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 08:22:56','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Description='',Help='' WHERE AD_Element_ID=957 AND AD_Language='fr_CH'
;
-- 2019-01-14T08:22:56.650
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(957,'fr_CH')
;
-- 2019-01-14T08:23:01.235
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=957 AND AD_Language='it_CH'
;
-- 2019-01-14T08:23:03.842
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=957 AND AD_Language='en_GB'
;
-- 2019-01-14T08:23:10.768
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 08:23:10','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Description='',Help='' WHERE AD_Element_ID=957 AND AD_Language='de_CH'
;
-- 2019-01-14T08:23:10.782
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(957,'de_CH')
;
-- 2019-01-14T08:23:24.861
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 08:23:24','YYYY-MM-DD HH24:MI:SS'),Description='',Help='' WHERE AD_Element_ID=957 AND AD_Language='nl_NL'
;
-- 2019-01-14T08:23:24.875
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(957,'nl_NL')
;
-- 2019-01-14T08:23:29.262
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 08:23:29','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Description='',Help='' WHERE AD_Element_ID=957 AND AD_Language='de_DE'
;
-- 2019-01-14T08:23:29.273
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(957,'de_DE')
;
-- 2019-01-14T08:23:29.295
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(957,'de_DE')
;
-- 2019-01-14T08:23:29.307
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='PriceStd', Name='Standardpreis', Description='', Help='' WHERE AD_Element_ID=957
;
-- 2019-01-14T08:23:29.320
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='PriceStd', Name='Standardpreis', Description='', Help='', AD_Element_ID=957 WHERE UPPER(ColumnName)='PRICESTD' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-01-14T08:23:29.328
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='PriceStd', Name='Standardpreis', Description='', Help='' WHERE AD_Element_ID=957 AND IsCentrallyMaintained='Y'
;
-- 2019-01-14T08:23:29.335
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Standardpreis', Description='', Help='' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=957) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 957)
;
-- 2019-01-14T08:23:29.374
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Standardpreis', Description='', Help='', CommitWarning = NULL WHERE AD_Element_ID = 957
;
-- 2019-01-14T08:23:29.387
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Standardpreis', Description='', Help='' WHERE AD_Element_ID = 957
;
-- 2019-01-14T08:23:29.394
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name='Standardpreis', Description='', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 957
;
-- 2019-01-14T08:23:36.071
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 08:23:36','YYYY-MM-DD HH24:MI:SS'),Description='' WHERE AD_Element_ID=957 AND AD_Language='en_US'
;
-- 2019-01-14T08:23:36.084
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(957,'en_US')
;
----------------------------------------------
-- 2019-01-14T11:01:18.941
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET Description='', Name='M_DiscountSchemaBreak',Updated=TO_TIMESTAMP('2019-01-14 11:01:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=476
;
-- 2019-01-14T11:21:32.740
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,575939,0,'PricingSystemSurcharge',TO_TIMESTAMP('2019-01-14 11:21:32','YYYY-MM-DD HH24:MI:SS'),100,'Aufschlag auf den Preis, der aus dem Preissystem resultieren würde','de.metas.pricing','Y','Preisaufschlag','Preisaufschlag',TO_TIMESTAMP('2019-01-14 11:21:32','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-14T11:21:32.742
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=575939 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2019-01-14T11:21:37.275
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 11:21:37','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=575939 AND AD_Language='de_CH'
;
-- 2019-01-14T11:21:37.500
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575939,'de_CH')
;
-- 2019-01-14T11:21:39.955
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 11:21:39','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Element_ID=575939 AND AD_Language='de_DE'
;
-- 2019-01-14T11:21:39.965
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575939,'de_DE')
;
-- 2019-01-14T11:21:39.985
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(575939,'de_DE')
;
-- 2019-01-14T11:22:39.325
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 11:22:39','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Surcharge',PrintName='Surcharge',Description='Surcharge on the price that would result from the pricing system' WHERE AD_Element_ID=575939 AND AD_Language='en_US'
;
-- 2019-01-14T11:22:39.336
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(575939,'en_US')
;
-- 2019-01-14T11:23:09.672
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Element_ID=575939, ColumnName='PricingSystemSurcharge', Description='Aufschlag auf den Preis, der aus dem Preissystem resultieren würde', EntityType='de.metas.pricing', Help=NULL, Name='Preisaufschlag',Updated=TO_TIMESTAMP('2019-01-14 11:23:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559658
;
-- 2019-01-14T11:23:09.674
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Preisaufschlag', Description='Aufschlag auf den Preis, der aus dem Preissystem resultieren würde', Help=NULL WHERE AD_Column_ID=559658
;
-- 2019-01-14T11:29:47.494
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-01-14 11:29:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559658
;
-- 2019-01-14T11:30:47.002
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET ColumnName='PricingSystemSurchargeAmt',Updated=TO_TIMESTAMP('2019-01-14 11:30:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=575939
;
-- 2019-01-14T11:30:47.006
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='PricingSystemSurchargeAmt', Name='Preisaufschlag', Description='Aufschlag auf den Preis, der aus dem Preissystem resultieren würde', Help=NULL WHERE AD_Element_ID=575939
;
-- 2019-01-14T11:30:47.008
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='PricingSystemSurchargeAmt', Name='Preisaufschlag', Description='Aufschlag auf den Preis, der aus dem Preissystem resultieren würde', Help=NULL, AD_Element_ID=575939 WHERE UPPER(ColumnName)='PRICINGSYSTEMSURCHARGEAMT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-01-14T11:30:47.011
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='PricingSystemSurchargeAmt', Name='Preisaufschlag', Description='Aufschlag auf den Preis, der aus dem Preissystem resultieren würde', Help=NULL WHERE AD_Element_ID=575939 AND IsCentrallyMaintained='Y'
;
-- 2019-01-14T11:59:25.774
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Element_ID=575939, ColumnName='PricingSystemSurchargeAmt', Description='Aufschlag auf den Preis, der aus dem Preissystem resultieren würde', EntityType='de.metas.pricing', Help=NULL, IsMandatory='Y', Name='Preisaufschlag',Updated=TO_TIMESTAMP('2019-01-14 11:59:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559787
;
-- 2019-01-14T11:59:25.782
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Preisaufschlag', Description='Aufschlag auf den Preis, der aus dem Preissystem resultieren würde', Help=NULL WHERE AD_Column_ID=559787
;
-- 2019-01-14T12:00:03.909
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET Name='I_DiscountSchema',Updated=TO_TIMESTAMP('2019-01-14 12:00:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=540963
;
-- 2019-01-14T12:01:40.522
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-01-14 12:01:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559787
;
-- 2019-01-14T12:05:29.249
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsAlwaysUpdateable='Y', MandatoryLogic='(@PriceBase/P@ = P & @PricingSystemSurchargeAmt/0@ ! 0) | @PriceBase/P@ = F', TechnicalNote='This is the currency of PriceStd or PricingSystemSurchargeAmt; only relevant if @PriceBase@ = F, or if @PriceBase@ = P and a PricingSystemSurchargeAmt != 0 was set',Updated=TO_TIMESTAMP('2019-01-14 12:05:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=560678
;
-- 2019-01-14T12:06:19.229
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsMandatory='N', MandatoryLogic='(@PriceBase/P@ = P & @PricingSystemSurchargeAmt/0@ ! 0) | @PriceBase/P@ = F', TechnicalNote='This is the currency of PriceStd or PricingSystemSurchargeAmt; only relevant if @PriceBase@ = F, or if @PriceBase@ = P and a PricingSystemSurchargeAmt != 0 was set.',Updated=TO_TIMESTAMP('2019-01-14 12:06:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559787
;
-- 2019-01-14T12:06:52.057
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsMandatory='Y', MandatoryLogic='', TechnicalNote='',Updated=TO_TIMESTAMP('2019-01-14 12:06:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559787
;
-- 2019-01-14T12:07:13.188
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET MandatoryLogic='(@PriceBase/P@ = P & @PricingSystemSurchargeAmt/0@ ! 0) | @PriceBase/P@ = F', TechnicalNote='This is the currency of PriceStd or PricingSystemSurchargeAmt; only relevant if @PriceBase@ = F, or if @PriceBase@ = P and a PricingSystemSurchargeAmt != 0 was set.',Updated=TO_TIMESTAMP('2019-01-14 12:07:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=560679
;
-- 2019-01-14T12:07:31.302
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET TechnicalNote='This is the currency of PriceStd or PricingSystemSurchargeAmt; only relevant if @PriceBase@ = F, or if @PriceBase@ = P and a PricingSystemSurchargeAmt != 0 was set.',Updated=TO_TIMESTAMP('2019-01-14 12:07:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=560678
;
-- 2019-01-14T12:07:51.727
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET MandatoryLogic='@PriceBase/P@ = F',Updated=TO_TIMESTAMP('2019-01-14 12:07:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559786
;
-- 2019-01-14T12:24:46.674
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET ColumnName='FixedStdPrice',Updated=TO_TIMESTAMP('2019-01-14 12:24:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=1746
;
-- 2019-01-14T12:24:46.690
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='FixedStdPrice', Name='Fixed Standard Price', Description='Fixed Standard Price (not calculated)', Help=NULL WHERE AD_Element_ID=1746
;
-- 2019-01-14T12:24:46.692
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='FixedStdPrice', Name='Fixed Standard Price', Description='Fixed Standard Price (not calculated)', Help=NULL, AD_Element_ID=1746 WHERE UPPER(ColumnName)='FIXEDSTDPRICE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-01-14T12:24:46.694
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='FixedStdPrice', Name='Fixed Standard Price', Description='Fixed Standard Price (not calculated)', Help=NULL WHERE AD_Element_ID=1746 AND IsCentrallyMaintained='Y'
;
-- 2019-01-14T12:25:19.820
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET ColumnName='PriceStdFixed',Updated=TO_TIMESTAMP('2019-01-14 12:25:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=1746
;
-- 2019-01-14T12:25:19.824
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='PriceStdFixed', Name='Fixed Standard Price', Description='Fixed Standard Price (not calculated)', Help=NULL WHERE AD_Element_ID=1746
;
-- 2019-01-14T12:25:19.826
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='PriceStdFixed', Name='Fixed Standard Price', Description='Fixed Standard Price (not calculated)', Help=NULL, AD_Element_ID=1746 WHERE UPPER(ColumnName)='PRICESTDFIXED' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-01-14T12:25:19.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='PriceStdFixed', Name='Fixed Standard Price', Description='Fixed Standard Price (not calculated)', Help=NULL WHERE AD_Element_ID=1746 AND IsCentrallyMaintained='Y'
;
-- 2019-01-14T12:26:48.961
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Element_ID=1746, AD_Reference_ID=37, ColumnName='PriceStdFixed', Description='Fixed Standard Price (not calculated)', Help=NULL, Name='Fixed Standard Price',Updated=TO_TIMESTAMP('2019-01-14 12:26:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559786
;
-- 2019-01-14T12:26:48.965
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Fixed Standard Price', Description='Fixed Standard Price (not calculated)', Help=NULL WHERE AD_Column_ID=559786
;
-- 2019-01-14T12:27:08.718
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Element_ID=1746, ColumnName='PriceStdFixed', Description='Fixed Standard Price (not calculated)', Help=NULL, Name='Fixed Standard Price',Updated=TO_TIMESTAMP('2019-01-14 12:27:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=559659
;
-- 2019-01-14T12:27:08.721
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Fixed Standard Price', Description='Fixed Standard Price (not calculated)', Help=NULL WHERE AD_Column_ID=559659
;
-- 2019-01-14T12:27:33.561
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=1746 AND AD_Language='fr_CH'
;
-- 2019-01-14T12:27:33.584
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=1746 AND AD_Language='it_CH'
;
-- 2019-01-14T12:27:33.607
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=1746 AND AD_Language='en_GB'
;
-- 2019-01-14T12:28:29.599
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 12:28:29','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Festpreis',PrintName='Festpreis',Description='' WHERE AD_Element_ID=1746 AND AD_Language='de_CH'
;
-- 2019-01-14T12:28:29.629
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1746,'de_CH')
;
-- 2019-01-14T12:28:45.325
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 12:28:45','YYYY-MM-DD HH24:MI:SS'),Name='Fixed price',PrintName='Fixed price',Description='' WHERE AD_Element_ID=1746 AND AD_Language='en_US'
;
-- 2019-01-14T12:28:45.339
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1746,'en_US')
;
-- 2019-01-14T12:28:58.760
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 12:28:58','YYYY-MM-DD HH24:MI:SS'),Name='Festpreis',PrintName='Festpreis',Description='' WHERE AD_Element_ID=1746 AND AD_Language='nl_NL'
;
-- 2019-01-14T12:28:58.770
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1746,'nl_NL')
;
-- 2019-01-14T12:29:26.701
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 12:29:26','YYYY-MM-DD HH24:MI:SS'),Description='Festpreis, ohne ggf. zusätzliche Rabatte' WHERE AD_Element_ID=1746 AND AD_Language='nl_NL'
;
-- 2019-01-14T12:29:26.717
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1746,'nl_NL')
;
-- 2019-01-14T12:29:37.538
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2019-01-14 12:29:37','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Festpreis',PrintName='Festpreis',Description='Festpreis, ohne ggf. zusätzliche Rabatte' WHERE AD_Element_ID=1746 AND AD_Language='de_DE'
;
-- 2019-01-14T12:29:37.548
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1746,'de_DE')
;
-- 2019-01-14T12:29:37.585
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(1746,'de_DE')
;
-- 2019-01-14T12:29:37.596
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='PriceStdFixed', Name='Festpreis', Description='Festpreis, ohne ggf. zusätzliche Rabatte', Help=NULL WHERE AD_Element_ID=1746
;
-- 2019-01-14T12:29:37.605
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='PriceStdFixed', Name='Festpreis', Description='Festpreis, ohne ggf. zusätzliche Rabatte', Help=NULL, AD_Element_ID=1746 WHERE UPPER(ColumnName)='PRICESTDFIXED' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-01-14T12:29:37.613
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='PriceStdFixed', Name='Festpreis', Description='Festpreis, ohne ggf. zusätzliche Rabatte', Help=NULL WHERE AD_Element_ID=1746 AND IsCentrallyMaintained='Y'
;
-- 2019-01-14T12:29:37.621
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Festpreis', Description='Festpreis, ohne ggf. zusätzliche Rabatte', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=1746) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 1746)
;
-- 2019-01-14T12:29:37.668
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Festpreis', Name='Festpreis' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=1746)
;
-- 2019-01-14T12:29:37.676
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Festpreis', Description='Festpreis, ohne ggf. zusätzliche Rabatte', Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 1746
;
-- 2019-01-14T12:29:37.684
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Festpreis', Description='Festpreis, ohne ggf. zusätzliche Rabatte', Help=NULL WHERE AD_Element_ID = 1746
;
-- 2019-01-14T12:29:37.692
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name='Festpreis', Description='Festpreis, ohne ggf. zusätzliche Rabatte', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 1746
;
-- 2019-01-14T12:30:31.782
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=625057
;
-- 2019-01-14T12:30:31.991
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Link (AD_Client_ID,AD_Element_ID,AD_Element_Link_ID,AD_Field_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,575937,625058,563197,0,233,TO_TIMESTAMP('2019-01-14 12:30:31','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2019-01-14 12:30:31','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-14T12:30:32.760
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Name_ID=NULL, Description='Festpreis, ohne ggf. zusätzliche Rabatte', Name='Festpreis',Updated=TO_TIMESTAMP('2019-01-14 12:30:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=563197
;
-- 2019-01-14T12:30:32.785
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=625058
;
-- 2019-01-14T12:30:32.873
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Link (AD_Client_ID,AD_Element_ID,AD_Element_Link_ID,AD_Field_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,1746,625059,563197,0,233,TO_TIMESTAMP('2019-01-14 12:30:32','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2019-01-14 12:30:32','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-14T12:30:32.877
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1746)
;
-- 2019-01-14T12:30:42.792
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=575937
;
-- 2019-01-14T12:30:42.799
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=575937
;
-- 2019-01-14T12:31:40.871
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET DisplayLogic='@PriceBase/F@ = F',Updated=TO_TIMESTAMP('2019-01-14 12:31:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=563197
;
-- 2019-01-14T12:32:17.607
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET DisplayLogic='(@PriceBase/P@ = P & @PricingSystemSurchargeAmt/0@ ! 0) | @PriceBase/P@ = F',Updated=TO_TIMESTAMP('2019-01-14 12:32:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=565109
; | the_stack |
-- Change ownership on the TIGER tables
ALTER TABLE tiger2012.cbsa OWNER TO census;
ALTER TABLE tiger2012.cd OWNER TO census;
ALTER TABLE tiger2012.county OWNER TO census;
ALTER TABLE tiger2012.csa OWNER TO census;
ALTER TABLE tiger2012.place OWNER TO census;
ALTER TABLE tiger2012.state OWNER TO census;
ALTER TABLE tiger2012.elsd OWNER TO census;
ALTER TABLE tiger2012.scsd OWNER TO census;
ALTER TABLE tiger2012.zcta5 OWNER TO census;
ALTER TABLE tiger2012.cousub OWNER TO census;
ALTER TABLE tiger2012.puma OWNER TO census;
ALTER TABLE tiger2012.sldl OWNER TO census;
ALTER TABLE tiger2012.sldu OWNER TO census;
ALTER TABLE tiger2012.aiannh OWNER TO census;
ALTER TABLE tiger2012.aits OWNER TO census;
ALTER TABLE tiger2012.anrc OWNER TO census;
ALTER TABLE tiger2012.bg OWNER TO census;
ALTER TABLE tiger2012.cnecta OWNER TO census;
ALTER TABLE tiger2012.concity OWNER TO census;
ALTER TABLE tiger2012.metdiv OWNER TO census;
ALTER TABLE tiger2012.necta OWNER TO census;
ALTER TABLE tiger2012.nectadiv OWNER TO census;
ALTER TABLE tiger2012.submcd OWNER TO census;
ALTER TABLE tiger2012.tbg OWNER TO census;
ALTER TABLE tiger2012.ttract OWNER TO census;
ALTER TABLE tiger2012.tabblock OWNER TO census;
ALTER TABLE tiger2012.tract OWNER TO census;
ALTER TABLE tiger2012.uac OWNER TO census;
ALTER TABLE tiger2012.unsd OWNER TO census;
ALTER TABLE tiger2012.vtd OWNER TO census;
-- OGR needs select on geography_columns to do it's thing
GRANT SELECT ON geography_columns TO census;
-- Create a unified table for all census names -> geoid
DROP TABLE IF EXISTS tiger2012.census_name_lookup;
CREATE TABLE tiger2012.census_name_lookup (
display_name varchar,
simple_name varchar,
prefix_match_name varchar,
sumlevel varchar(3),
geoid varchar,
full_geoid varchar(40),
priority smallint,
population int,
aland decimal(15),
awater decimal(15)
);
SELECT AddGeometryColumn('tiger2012', 'census_name_lookup', 'the_geom', 4326, 'MULTIPOLYGON', 2);
INSERT INTO tiger2012.census_name_lookup
SELECT
state.name,
state.name,
state.name,
'040',
state.geoid,
'04000US' || state.geoid,
10,
b01003.b01003001,
state.aland,
state.awater,
state.the_geom
FROM tiger2012.state LEFT OUTER JOIN acs2012_5yr.b01003 ON (('04000US' || state.geoid) = b01003.geoid)
WHERE state.geoid NOT IN ('60', '66', '69', '78');
INSERT INTO tiger2012.census_name_lookup
SELECT
place.name || ', ' || state.stusps,
place.name,
place.name || ' ' || state.stusps,
'160',
place.geoid,
'16000US' || place.geoid,
20,
b01003.b01003001,
place.aland,
place.awater,
place.the_geom
FROM tiger2012.place LEFT OUTER JOIN acs2012_5yr.b01003 ON (('16000US' || place.geoid) = b01003.geoid) JOIN tiger2012.state USING (statefp)
WHERE state.geoid NOT IN ('60', '66', '69', '78');
INSERT INTO tiger2012.census_name_lookup
SELECT
county.namelsad || ', ' || state.stusps,
county.namelsad,
county.namelsad || ' ' || state.stusps,
'050',
county.geoid,
'05000US' || county.geoid,
30,
b01003.b01003001,
county.aland,
county.awater,
county.the_geom
FROM tiger2012.county LEFT OUTER JOIN acs2012_5yr.b01003 ON (('05000US' || county.geoid) = b01003.geoid) JOIN tiger2012.state USING (statefp)
WHERE state.geoid NOT IN ('60', '66', '69', '78');
INSERT INTO tiger2012.census_name_lookup
SELECT
cousub.namelsad || ', ' || county.namelsad || ', ' || state.stusps,
cousub.name,
cousub.name || ' ' || state.stusps,
'060',
cousub.geoid,
'06000US' || cousub.geoid,
40,
b01003.b01003001,
cousub.aland,
cousub.awater,
cousub.the_geom
FROM tiger2012.cousub LEFT OUTER JOIN acs2012_5yr.b01003 ON (('06000US' || cousub.geoid) = b01003.geoid) JOIN tiger2012.county USING (statefp, countyfp) JOIN tiger2012.state USING (statefp)
WHERE state.geoid NOT IN ('60', '66', '69', '78');
INSERT INTO tiger2012.census_name_lookup
SELECT
zcta5.zcta5ce10,
zcta5.zcta5ce10,
zcta5.zcta5ce10,
'860',
zcta5.geoid10,
'86000US' || zcta5.geoid10,
50,
b01003.b01003001,
zcta5.aland10,
zcta5.awater10,
zcta5.the_geom
FROM tiger2012.zcta5 LEFT OUTER JOIN acs2012_5yr.b01003 ON (('86000US' || zcta5.geoid10) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
cbsa.namelsad,
cbsa.name,
cbsa.name,
'310',
cbsa.geoid,
'31000US' || cbsa.geoid,
60,
b01003.b01003001,
cbsa.aland,
cbsa.awater,
cbsa.the_geom
FROM tiger2012.cbsa LEFT OUTER JOIN acs2012_5yr.b01003 ON (('31000US' || cbsa.geoid) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
cd.namelsad || ', ' || state.stusps,
cd.namelsad,
cd.namelsad,
'500',
cd.geoid,
'50000US' || cd.geoid,
70,
b01003.b01003001,
cd.aland,
cd.awater,
cd.the_geom
FROM tiger2012.cd LEFT OUTER JOIN acs2012_5yr.b01003 ON (('50000US' || cd.geoid) = b01003.geoid) JOIN tiger2012.state USING (statefp)
WHERE state.geoid NOT IN ('60', '66', '69', '78');
INSERT INTO tiger2012.census_name_lookup
SELECT
csa.namelsad,
csa.name,
csa.name,
'330',
csa.geoid,
'33000US' || csa.geoid,
80,
b01003.b01003001,
csa.aland,
csa.awater,
csa.the_geom
FROM tiger2012.csa LEFT OUTER JOIN acs2012_5yr.b01003 ON (('33000US' || csa.geoid) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
elsd.name || ', ' || state.stusps,
elsd.name,
elsd.name,
'950',
elsd.geoid,
'95000US' || elsd.geoid,
90,
b01003.b01003001,
elsd.aland,
elsd.awater,
elsd.the_geom
FROM tiger2012.elsd LEFT OUTER JOIN acs2012_5yr.b01003 ON (('95000US' || elsd.geoid) = b01003.geoid) JOIN tiger2012.state USING (statefp);
INSERT INTO tiger2012.census_name_lookup
SELECT
scsd.name || ', ' || state.stusps,
scsd.name,
scsd.name,
'960',
scsd.geoid,
'96000US' || scsd.geoid,
100,
b01003.b01003001,
scsd.aland,
scsd.awater,
scsd.the_geom
FROM tiger2012.scsd LEFT OUTER JOIN acs2012_5yr.b01003 ON (('96000US' || scsd.geoid) = b01003.geoid) JOIN tiger2012.state USING (statefp);
INSERT INTO tiger2012.census_name_lookup
SELECT
puma.namelsad10 || ', ' || state.stusps,
puma.namelsad10,
puma.namelsad10,
'795',
puma.geoid10,
'79500US' || puma.geoid10,
110,
b01003.b01003001,
puma.aland10,
puma.awater10,
puma.the_geom
FROM tiger2012.puma LEFT OUTER JOIN acs2012_5yr.b01003 ON (('79500US' || puma.geoid10) = b01003.geoid) JOIN tiger2012.state ON (puma.statefp10=state.statefp)
WHERE statefp NOT IN ('60', '66', '69', '78');
INSERT INTO tiger2012.census_name_lookup
SELECT
sldl.namelsad || ', ' || state.stusps,
sldl.namelsad,
sldl.namelsad,
'620',
sldl.geoid,
'62000US' || sldl.geoid,
120,
b01003.b01003001,
sldl.aland,
sldl.awater,
sldl.the_geom
FROM tiger2012.sldl LEFT OUTER JOIN acs2012_5yr.b01003 ON (('62000US' || sldl.geoid) = b01003.geoid) JOIN tiger2012.state USING (statefp);
INSERT INTO tiger2012.census_name_lookup
SELECT
sldu.namelsad || ', ' || state.stusps,
sldu.namelsad,
sldu.namelsad,
'610',
sldu.geoid,
'61000US' || sldu.geoid,
130,
b01003.b01003001,
sldu.aland,
sldu.awater,
sldu.the_geom
FROM tiger2012.sldu LEFT OUTER JOIN acs2012_5yr.b01003 ON (('61000US' || sldu.geoid) = b01003.geoid) JOIN tiger2012.state USING (statefp);
INSERT INTO tiger2012.census_name_lookup
SELECT
aiannh.namelsad,
aiannh.namelsad,
aiannh.namelsad,
'250',
aiannh.geoid,
'25000US' || aiannh.geoid,
140,
b01003.b01003001,
aiannh.aland,
aiannh.awater,
aiannh.the_geom
FROM tiger2012.aiannh LEFT OUTER JOIN acs2012_5yr.b01003 ON (('25000US' || aiannh.geoid) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
aits.namelsad,
aits.namelsad,
aits.namelsad,
'251',
aits.geoid,
'25100US' || aits.geoid,
150,
b01003.b01003001,
aits.aland,
aits.awater,
aits.the_geom
FROM tiger2012.aits LEFT OUTER JOIN acs2012_5yr.b01003 ON (('25100US' || aits.geoid) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
anrc.namelsad,
anrc.namelsad,
anrc.namelsad,
'230',
anrc.geoid,
'23000US' || anrc.geoid,
160,
b01003.b01003001,
anrc.aland,
anrc.awater,
anrc.the_geom
FROM tiger2012.anrc LEFT OUTER JOIN acs2012_5yr.b01003 ON (('23000US' || anrc.geoid) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
bg.namelsad || ', ' || county.name || ', ' || state.stusps,
bg.namelsad,
null,
'150',
bg.geoid,
'15000US' || bg.geoid,
170,
b01003.b01003001,
bg.aland,
bg.awater,
bg.the_geom
FROM tiger2012.bg LEFT OUTER JOIN acs2012_5yr.b01003 ON (('15000US' || bg.geoid) = b01003.geoid) JOIN tiger2012.county USING (statefp, countyfp) JOIN tiger2012.state USING (statefp)
WHERE statefp NOT IN ('60', '66', '69', '78');
INSERT INTO tiger2012.census_name_lookup
SELECT
cnecta.namelsad,
cnecta.namelsad,
cnecta.namelsad,
'335',
cnecta.geoid,
'33500US' || cnecta.geoid,
180,
b01003.b01003001,
cnecta.aland,
cnecta.awater,
cnecta.the_geom
FROM tiger2012.cnecta LEFT OUTER JOIN acs2012_5yr.b01003 ON (('33500US' || cnecta.geoid) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
concity.namelsad || ', ' || state.stusps,
concity.namelsad,
concity.name || ' ' || state.stusps,
'170',
concity.geoid,
'17000US' || concity.geoid,
190,
b01003.b01003001,
concity.aland,
concity.awater,
concity.the_geom
FROM tiger2012.concity LEFT OUTER JOIN acs2012_5yr.b01003 ON (('17000US' || concity.geoid) = b01003.geoid) JOIN tiger2012.state USING (statefp);
INSERT INTO tiger2012.census_name_lookup
SELECT
metdiv.namelsad,
metdiv.namelsad,
metdiv.name,
'314',
metdiv.geoid,
'31400US' || metdiv.geoid,
200,
b01003.b01003001,
metdiv.aland,
metdiv.awater,
metdiv.the_geom
FROM tiger2012.metdiv LEFT OUTER JOIN acs2012_5yr.b01003 ON (('31400US' || metdiv.geoid) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
necta.namelsad,
necta.namelsad,
necta.name,
'350',
necta.geoid,
'35000US' || necta.geoid,
210,
b01003.b01003001,
necta.aland,
necta.awater,
necta.the_geom
FROM tiger2012.necta LEFT OUTER JOIN acs2012_5yr.b01003 ON (('35000US' || necta.geoid) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
nectadiv.namelsad,
nectadiv.namelsad,
nectadiv.name,
'355',
nectadiv.geoid,
'35500US' || nectadiv.geoid,
220,
b01003.b01003001,
nectadiv.aland,
nectadiv.awater,
nectadiv.the_geom
FROM tiger2012.nectadiv LEFT OUTER JOIN acs2012_5yr.b01003 ON (('35500US' || nectadiv.geoid) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
submcd.namelsad,
submcd.namelsad,
submcd.name,
'067',
submcd.geoid,
'06700US' || submcd.geoid,
230,
b01003.b01003001,
submcd.aland,
submcd.awater,
submcd.the_geom
FROM tiger2012.submcd LEFT OUTER JOIN acs2012_5yr.b01003 ON (('06700US' || submcd.geoid) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
tbg.namelsad,
tbg.namelsad,
null,
'258',
tbg.geoid,
'25800US' || tbg.geoid,
240,
b01003.b01003001,
tbg.aland,
tbg.awater,
tbg.the_geom
FROM tiger2012.tbg LEFT OUTER JOIN acs2012_5yr.b01003 ON (('25800US' || tbg.geoid) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
ttract.namelsad,
ttract.namelsad,
null,
'256',
ttract.geoid,
'25600US' || ttract.geoid,
250,
b01003.b01003001,
ttract.aland,
ttract.awater,
ttract.the_geom
FROM tiger2012.ttract LEFT OUTER JOIN acs2012_5yr.b01003 ON (('25600US' || ttract.geoid) = b01003.geoid);
-- Don't include blocks because there's no ACS data for it.
-- INSERT INTO tiger2012.census_name_lookup
-- SELECT
-- tabblock.name || ', ' || county.name || ', ' || state.stusps,
-- null,
-- '101',
-- tabblock.geoid,
-- '10100US' || tabblock.geoid,
-- 260,
-- NULL,
-- NULL,
-- NULL,
-- tabblock.the_geom
-- FROM tiger2012.tabblock JOIN tiger2012.county USING (statefp, countyfp) JOIN tiger2012.state USING (statefp);
INSERT INTO tiger2012.census_name_lookup
SELECT
tract.namelsad || ', ' || county.name || ', ' || state.stusps,
tract.namelsad,
null,
'140',
tract.geoid,
'14000US' || tract.geoid,
270,
b01003.b01003001,
tract.aland,
tract.awater,
tract.the_geom
FROM tiger2012.tract LEFT OUTER JOIN acs2012_5yr.b01003 ON (('14000US' || tract.geoid) = b01003.geoid) JOIN tiger2012.county USING (statefp, countyfp) JOIN tiger2012.state USING (statefp)
WHERE statefp NOT IN ('60', '66', '69', '78');
INSERT INTO tiger2012.census_name_lookup
SELECT
uac.namelsad10,
uac.name10,
uac.name10,
'400',
uac.geoid10,
'40000US' || uac.geoid10,
280,
b01003.b01003001,
uac.aland10,
uac.awater10,
uac.the_geom
FROM tiger2012.uac LEFT OUTER JOIN acs2012_5yr.b01003 ON (('40000US' || uac.geoid10) = b01003.geoid);
INSERT INTO tiger2012.census_name_lookup
SELECT
unsd.name || ', ' || state.stusps,
unsd.name,
unsd.name || ' ' || state.stusps,
'970',
unsd.geoid,
'97000US' || unsd.geoid,
290,
b01003.b01003001,
unsd.aland,
unsd.awater,
unsd.the_geom
FROM tiger2012.unsd LEFT OUTER JOIN acs2012_5yr.b01003 ON (('97000US' || unsd.geoid) = b01003.geoid) JOIN tiger2012.state USING (statefp)
WHERE statefp NOT IN ('60', '66', '69', '78');
INSERT INTO tiger2012.census_name_lookup
SELECT
vtd.name10 || ', ' || state.stusps,
vtd.name10,
vtd.name10 || ' ' || state.stusps,
'700',
vtd.geoid10,
'70000US' || vtd.geoid10,
300,
b01003.b01003001,
vtd.aland10,
vtd.awater10,
vtd.the_geom
FROM tiger2012.vtd LEFT OUTER JOIN acs2012_5yr.b01003 ON (('70000US' || vtd.geoid10) = b01003.geoid) JOIN tiger2012.state ON (vtd.statefp10=state.statefp);
INSERT INTO tiger2012.census_name_lookup
SELECT
'United States',
'United States',
'united states',
'010',
'',
'01000US',
5,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid='01000US'),
(SELECT SUM(aland) FROM tiger2012.state),
(SELECT SUM(awater) FROM tiger2012.state),
(SELECT ST_Simplify(ST_Union(the_geom), 0.01) FROM tiger2012.state);
---- Divisions
-- Division 1
INSERT INTO tiger2012.census_name_lookup
SELECT
'New England Division',
'New England Division',
'new england division',
'030',
'',
'03000US1',
310,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '03000US1'),
(SELECT SUM(aland) FROM tiger2012.state WHERE division='1'),
(SELECT SUM(awater) FROM tiger2012.state WHERE division='1'),
(SELECT ST_Union(the_geom) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('04000US09', '04000US23', '04000US25', '04000US33', '04000US44', '04000US50'));
-- Division 2
INSERT INTO tiger2012.census_name_lookup
SELECT
'Middle Atlantic Division',
'Middle Atlantic Division',
'middle atlantic division',
'030',
'',
'03000US2',
310,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '03000US2'),
(SELECT SUM(aland) FROM tiger2012.state WHERE division='2'),
(SELECT SUM(awater) FROM tiger2012.state WHERE division='2'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('04000US34', '04000US36', '04000US42'));
-- Division 3
INSERT INTO tiger2012.census_name_lookup
SELECT
'East North Central Division',
'East North Central Division',
'east north central division',
'030',
'',
'03000US3',
310,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '03000US3'),
(SELECT SUM(aland) FROM tiger2012.state WHERE division='3'),
(SELECT SUM(awater) FROM tiger2012.state WHERE division='3'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('04000US18', '04000US17', '04000US26', '04000US39', '04000US55'));
-- Division 4
INSERT INTO tiger2012.census_name_lookup
SELECT
'West North Central Division',
'West North Central Division',
'west north central division',
'030',
'',
'03000US4',
310,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '03000US4'),
(SELECT SUM(aland) FROM tiger2012.state WHERE division='4'),
(SELECT SUM(awater) FROM tiger2012.state WHERE division='4'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('04000US19', '04000US20', '04000US27', '04000US29', '04000US31', '04000US38', '04000US46'));
-- Division 5
INSERT INTO tiger2012.census_name_lookup
SELECT
'South Atlantic Division',
'South Atlantic Division',
'south atlantic division',
'030',
'',
'03000US5',
310,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '03000US5'),
(SELECT SUM(aland) FROM tiger2012.state WHERE division='5'),
(SELECT SUM(awater) FROM tiger2012.state WHERE division='5'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('04000US10', '04000US11', '04000US12', '04000US13', '04000US24', '04000US37', '04000US45', '04000US51', '04000US54'));
-- Division 6
INSERT INTO tiger2012.census_name_lookup
SELECT
'East South Central Division',
'East South Central Division',
'east south central division',
'030',
'',
'03000US6',
310,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '03000US6'),
(SELECT SUM(aland) FROM tiger2012.state WHERE division='6'),
(SELECT SUM(awater) FROM tiger2012.state WHERE division='6'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('04000US01', '04000US21', '04000US28', '04000US47'));
-- Division 7
INSERT INTO tiger2012.census_name_lookup
SELECT
'West South Central Division',
'West South Central Division',
'west south central division',
'030',
'',
'03000US7',
310,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '03000US7'),
(SELECT SUM(aland) FROM tiger2012.state WHERE division='7'),
(SELECT SUM(awater) FROM tiger2012.state WHERE division='7'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('04000US05', '04000US22', '04000US40', '04000US48'));
-- Division 8
INSERT INTO tiger2012.census_name_lookup
SELECT
'Mountain Division',
'Mountain Division',
'mountain division',
'030',
'',
'03000US8',
310,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '03000US8'),
(SELECT SUM(aland) FROM tiger2012.state WHERE division='8'),
(SELECT SUM(awater) FROM tiger2012.state WHERE division='8'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('04000US04', '04000US08', '04000US16', '04000US35', '04000US30', '04000US49', '04000US32', '04000US56'));
-- Division 9
INSERT INTO tiger2012.census_name_lookup
SELECT
'Pacific Division',
'Pacific Division',
'pacific division',
'030',
'',
'03000US9',
310,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '03000US9'),
(SELECT SUM(aland) FROM tiger2012.state WHERE division='9'),
(SELECT SUM(awater) FROM tiger2012.state WHERE division='9'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('04000US02', '04000US06', '04000US15', '04000US41', '04000US53'));
---- Regions
-- Region 1
INSERT INTO tiger2012.census_name_lookup
SELECT
'Northeast Region',
'Northeast Region',
'northeast region',
'020',
'',
'02000US1',
320,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '02000US1'),
(SELECT SUM(aland) FROM tiger2012.state WHERE region='1'),
(SELECT SUM(awater) FROM tiger2012.state WHERE region='1'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('03000US1', '03000US2'));
-- Region 2
INSERT INTO tiger2012.census_name_lookup
SELECT
'Midwest Region',
'Midwest Region',
'midwest region',
'020',
'',
'02000US2',
320,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '02000US2'),
(SELECT SUM(aland) FROM tiger2012.state WHERE region='2'),
(SELECT SUM(awater) FROM tiger2012.state WHERE region='2'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('03000US3', '03000US4'));
-- Region 3
INSERT INTO tiger2012.census_name_lookup
SELECT
'South Region',
'South Region',
'south region',
'020',
'',
'02000US3',
320,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '02000US3'),
(SELECT SUM(aland) FROM tiger2012.state WHERE region='3'),
(SELECT SUM(awater) FROM tiger2012.state WHERE region='3'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('03000US5', '03000US6', '03000US7'));
-- Region 4
INSERT INTO tiger2012.census_name_lookup
SELECT
'West Region',
'West Region',
'west region',
'020',
'',
'02000US4',
320,
(SELECT b01003.b01003001 FROM acs2012_5yr.b01003 WHERE geoid = '02000US4'),
(SELECT SUM(aland) FROM tiger2012.state WHERE region='4'),
(SELECT SUM(awater) FROM tiger2012.state WHERE region='4'),
(SELECT ST_Multi(ST_Union(the_geom)) FROM tiger2012.census_name_lookup WHERE full_geoid IN ('03000US8', '03000US9'));
CREATE INDEX census_name_lookup_idx_lower ON tiger2012.census_name_lookup ((lower(prefix_match_name)) text_pattern_ops);
CREATE INDEX census_name_lookup_idx_geom ON tiger2012.census_name_lookup USING GIST(the_geom);
CREATE INDEX census_name_lookup_idx_geoid ON tiger2012.census_name_lookup (full_geoid);
CREATE INDEX census_name_lookup_idx_sumlevel ON tiger2012.census_name_lookup(sumlevel);
DROP TABLE IF EXISTS tiger2012.census_geo_containment;
CREATE TABLE tiger2012.census_geo_containment (
child_geoid varchar(40),
parent_geoid varchar(40),
percent_covered real
);
-- Places (160) in Counties (050)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'16000US' || place.geoid AS child_geoid,
'05000US' || county.geoid AS parent_geoid,
ST_Area(ST_Intersection(place.the_geom,county.the_geom))/ST_Area(place.the_geom)*100 as percent_covered
FROM tiger2012.place
JOIN tiger2012.county ON ST_Intersects(place.the_geom, county.the_geom)
WHERE
ST_Area(ST_Intersection(place.the_geom,county.the_geom))/ST_Area(place.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(place.the_geom,county.the_geom)) DESC
);
-- ZCTA5s (860) in Counties (050)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'86000US' || zcta5.geoid10 AS child_geoid,
'05000US' || county.geoid AS parent_geoid,
ST_Area(ST_Intersection(zcta5.the_geom,county.the_geom))/ST_Area(zcta5.the_geom)*100 as percent_covered
FROM tiger2012.zcta5
JOIN tiger2012.county ON ST_Intersects(zcta5.the_geom, county.the_geom)
WHERE
ST_IsValid(zcta5.the_geom) AND
ST_Area(ST_Intersection(zcta5.the_geom,county.the_geom))/ST_Area(zcta5.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(zcta5.the_geom,county.the_geom)) DESC
);
-- Elementary school districts (950) in Counties (050)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'95000US' || elsd.geoid AS child_geoid,
'05000US' || county.geoid AS parent_geoid,
ST_Area(ST_Intersection(elsd.the_geom,county.the_geom))/ST_Area(elsd.the_geom)*100 as percent_covered
FROM tiger2012.elsd
JOIN tiger2012.county ON ST_Intersects(elsd.the_geom, county.the_geom)
WHERE
ST_IsValid(elsd.the_geom) AND
ST_Area(ST_Intersection(elsd.the_geom,county.the_geom))/ST_Area(elsd.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(elsd.the_geom,county.the_geom)) DESC
);
-- Secondary school districts (960) in Counties (050)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'96000US' || scsd.geoid AS child_geoid,
'05000US' || county.geoid AS parent_geoid,
ST_Area(ST_Intersection(scsd.the_geom,county.the_geom))/ST_Area(scsd.the_geom)*100 as percent_covered
FROM tiger2012.scsd
JOIN tiger2012.county ON ST_Intersects(scsd.the_geom, county.the_geom)
WHERE
ST_IsValid(scsd.the_geom) AND
ST_Area(ST_Intersection(scsd.the_geom,county.the_geom))/ST_Area(scsd.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(scsd.the_geom,county.the_geom)) DESC
);
-- Unified school districts (970) in Counties (050)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'97000US' || unsd.geoid AS child_geoid,
'05000US' || county.geoid AS parent_geoid,
ST_Area(ST_Intersection(unsd.the_geom,county.the_geom))/ST_Area(unsd.the_geom)*100 as percent_covered
FROM tiger2012.unsd
JOIN tiger2012.county ON ST_Intersects(unsd.the_geom, county.the_geom)
WHERE
ST_IsValid(unsd.the_geom) AND
ST_Area(ST_Intersection(unsd.the_geom,county.the_geom))/ST_Area(unsd.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(unsd.the_geom,county.the_geom)) DESC
);
-- VTD (700) in Counties (050)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'70000US' || vtd.geoid10 AS child_geoid,
'05000US' || county.geoid AS parent_geoid,
ST_Area(ST_Intersection(vtd.the_geom,county.the_geom))/ST_Area(vtd.the_geom)*100 as percent_covered
FROM tiger2012.vtd
JOIN tiger2012.county ON ST_Intersects(vtd.the_geom, county.the_geom)
WHERE
ST_IsValid(vtd.the_geom) AND
ST_Area(ST_Intersection(vtd.the_geom,county.the_geom))/ST_Area(vtd.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(vtd.the_geom,county.the_geom)) DESC
);
-- VTD (700) in States (040)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'70000US' || vtd.geoid10 AS child_geoid,
'04000US' || state.geoid AS parent_geoid,
ST_Area(ST_Intersection(vtd.the_geom,state.the_geom))/ST_Area(vtd.the_geom)*100 as percent_covered
FROM tiger2012.vtd
JOIN tiger2012.state ON ST_Intersects(vtd.the_geom, state.the_geom)
WHERE
ST_IsValid(vtd.the_geom) AND
ST_Area(ST_Intersection(vtd.the_geom,state.the_geom))/ST_Area(vtd.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(vtd.the_geom,state.the_geom)) DESC
);
-- Places (160) in CBSA (310)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'16000US' || place.geoid AS child_geoid,
'31000US' || cbsa.geoid AS parent_geoid,
ST_Area(ST_Intersection(place.the_geom,cbsa.the_geom))/ST_Area(place.the_geom)*100 as percent_covered
FROM tiger2012.place
JOIN tiger2012.cbsa ON ST_Intersects(place.the_geom, cbsa.the_geom)
WHERE
ST_IsValid(place.the_geom) AND
ST_Area(ST_Intersection(place.the_geom,cbsa.the_geom))/ST_Area(place.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(place.the_geom,cbsa.the_geom)) DESC
);
-- ZCTA5s (860) in CBSA (310)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'86000US' || zcta5.geoid10 AS child_geoid,
'31000US' || cbsa.geoid AS parent_geoid,
ST_Area(ST_Intersection(zcta5.the_geom,cbsa.the_geom))/ST_Area(zcta5.the_geom)*100 as percent_covered
FROM tiger2012.zcta5
JOIN tiger2012.cbsa ON ST_Intersects(zcta5.the_geom, cbsa.the_geom)
WHERE
ST_IsValid(zcta5.the_geom) AND
ST_Area(ST_Intersection(zcta5.the_geom,cbsa.the_geom))/ST_Area(zcta5.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(zcta5.the_geom,cbsa.the_geom)) DESC
);
-- ZCTA5s (860) in States (040)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'86000US' || zcta5.geoid10 AS child_geoid,
'04000US' || state.geoid AS parent_geoid,
ST_Area(ST_Intersection(zcta5.the_geom,state.the_geom))/ST_Area(zcta5.the_geom)*100 as percent_covered
FROM tiger2012.zcta5
JOIN tiger2012.state ON ST_Intersects(zcta5.the_geom, state.the_geom)
WHERE
ST_IsValid(zcta5.the_geom) AND
ST_Area(ST_Intersection(zcta5.the_geom,state.the_geom))/ST_Area(zcta5.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(zcta5.the_geom,state.the_geom)) DESC
);
-- CBSAs (310) in States (040)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'31000US' || cbsa.geoid AS child_geoid,
'04000US' || state.geoid AS parent_geoid,
ST_Area(ST_Intersection(cbsa.the_geom,state.the_geom))/ST_Area(cbsa.the_geom)*100 as percent_covered
FROM tiger2012.cbsa
JOIN tiger2012.state ON ST_Intersects(cbsa.the_geom, state.the_geom)
WHERE
ST_IsValid(cbsa.the_geom) AND
ST_Area(ST_Intersection(cbsa.the_geom,state.the_geom))/ST_Area(cbsa.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(cbsa.the_geom,state.the_geom)) DESC
);
-- CBSAs (310) in CSAs (330)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'31000US' || cbsa.geoid AS child_geoid,
'33000US' || csa.geoid AS parent_geoid,
ST_Area(ST_Intersection(cbsa.the_geom,csa.the_geom))/ST_Area(cbsa.the_geom)*100 as percent_covered
FROM tiger2012.cbsa
JOIN tiger2012.csa ON ST_Intersects(cbsa.the_geom, csa.the_geom)
WHERE
ST_IsValid(cbsa.the_geom) AND
ST_Area(ST_Intersection(cbsa.the_geom,csa.the_geom))/ST_Area(cbsa.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(cbsa.the_geom,csa.the_geom)) DESC
);
-- CSAs (330) in States (040)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'33000US' || csa.geoid AS child_geoid,
'04000US' || state.geoid AS parent_geoid,
ST_Area(ST_Intersection(csa.the_geom,state.the_geom))/ST_Area(csa.the_geom)*100 as percent_covered
FROM tiger2012.csa
JOIN tiger2012.state ON ST_Intersects(csa.the_geom, state.the_geom)
WHERE
ST_IsValid(csa.the_geom) AND
ST_Area(ST_Intersection(csa.the_geom,state.the_geom))/ST_Area(csa.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(csa.the_geom,state.the_geom)) DESC
);
-- Tracts (140) in Places (160)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'14000US' || tract.geoid AS child_geoid,
'16000US' || place.geoid AS parent_geoid,
ST_Area(ST_Intersection(tract.the_geom,place.the_geom))/ST_Area(tract.the_geom)*100 as percent_covered
FROM tiger2012.tract
JOIN tiger2012.place ON ST_Intersects(tract.the_geom, place.the_geom)
WHERE
ST_IsValid(tract.the_geom) AND
ST_Area(ST_Intersection(tract.the_geom,place.the_geom))/ST_Area(tract.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(tract.the_geom,place.the_geom)) DESC
);
-- Block Groups (150) in Places (160)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'15000US' || bg.geoid AS child_geoid,
'16000US' || place.geoid AS parent_geoid,
ST_Area(ST_Intersection(bg.the_geom,place.the_geom))/ST_Area(bg.the_geom)*100 as percent_covered
FROM tiger2012.bg
JOIN tiger2012.place ON ST_Intersects(bg.the_geom, place.the_geom)
WHERE
ST_IsValid(bg.the_geom) AND
ST_Area(ST_Intersection(bg.the_geom,place.the_geom))/ST_Area(bg.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(bg.the_geom,place.the_geom)) DESC
);
-- NECTAs (350) in States (040)
INSERT INTO tiger2012.census_geo_containment (
SELECT
'35000US' || necta.geoid AS child_geoid,
'04000US' || state.geoid AS parent_geoid,
ST_Area(ST_Intersection(necta.the_geom,state.the_geom))/ST_Area(necta.the_geom)*100 as percent_covered
FROM tiger2012.necta
JOIN tiger2012.state ON ST_Intersects(necta.the_geom, state.the_geom)
WHERE
ST_IsValid(necta.the_geom) AND
ST_Area(ST_Intersection(necta.the_geom,state.the_geom))/ST_Area(necta.the_geom) > 0
ORDER BY
child_geoid ASC,
ST_Area(ST_Intersection(necta.the_geom,state.the_geom)) DESC
);
CREATE INDEX census_geo_containment_idx_child_geoid ON tiger2012.census_geo_containment (child_geoid);
CREATE INDEX census_geo_containment_idx_parent_geoid ON tiger2012.census_geo_containment (parent_geoid); | the_stack |
-- 2017-09-26T13:49:47.863
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540675,541179,TO_TIMESTAMP('2017-09-26 13:49:47','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-09-26 13:49:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T13:49:58.097
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET Name='advanced edit', SeqNo=90,Updated=TO_TIMESTAMP('2017-09-26 13:49:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=541177
;
-- 2017-09-26T13:58:33.687
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,201,0,110,541179,548885,'F',TO_TIMESTAMP('2017-09-26 13:58:33','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Name',10,0,0,TO_TIMESTAMP('2017-09-26 13:58:33','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T13:58:45.066
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,554660,0,110,541179,548886,'F',TO_TIMESTAMP('2017-09-26 13:58:45','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Interner Name',20,0,0,TO_TIMESTAMP('2017-09-26 13:58:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T13:59:03.977
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,5827,0,110,541179,548887,'F',TO_TIMESTAMP('2017-09-26 13:59:03','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Entitätsart',30,0,0,TO_TIMESTAMP('2017-09-26 13:59:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T13:59:21.044
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,205,0,110,541179,548888,'F',TO_TIMESTAMP('2017-09-26 13:59:21','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Aktion',40,0,0,TO_TIMESTAMP('2017-09-26 13:59:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:00:41.296
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,206,0,110,541179,548889,'F',TO_TIMESTAMP('2017-09-26 14:00:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Fenster',50,0,0,TO_TIMESTAMP('2017-09-26 14:00:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:00:55.145
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,2576,0,110,541179,548890,'F',TO_TIMESTAMP('2017-09-26 14:00:55','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Prozess',60,0,0,TO_TIMESTAMP('2017-09-26 14:00:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:03:34.466
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3612,0,110,541179,548891,'F',TO_TIMESTAMP('2017-09-26 14:03:34','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Form',70,0,0,TO_TIMESTAMP('2017-09-26 14:03:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:03:45.944
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,207,0,110,541179,548892,'F',TO_TIMESTAMP('2017-09-26 14:03:45','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Workflow',80,0,0,TO_TIMESTAMP('2017-09-26 14:03:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:04:03.658
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,4944,0,110,541179,548893,'F',TO_TIMESTAMP('2017-09-26 14:04:03','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Workbench',90,0,0,TO_TIMESTAMP('2017-09-26 14:04:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:06:12.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,558726,0,110,541179,548894,'F',TO_TIMESTAMP('2017-09-26 14:06:12','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Board',100,0,0,TO_TIMESTAMP('2017-09-26 14:06:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:06:40.825
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,208,0,110,541179,548895,'F',TO_TIMESTAMP('2017-09-26 14:06:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Externer Prozess',110,0,0,TO_TIMESTAMP('2017-09-26 14:06:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:07:01.703
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540675,541180,TO_TIMESTAMP('2017-09-26 14:07:01','YYYY-MM-DD HH24:MI:SS'),100,'Y','webui',20,TO_TIMESTAMP('2017-09-26 14:07:01','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:07:13.492
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,557251,0,110,541180,548896,'F',TO_TIMESTAMP('2017-09-26 14:07:13','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Browse Name',10,0,0,TO_TIMESTAMP('2017-09-26 14:07:13','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:07:41.162
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,557216,0,110,541180,548897,'F',TO_TIMESTAMP('2017-09-26 14:07:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Neu erstellen',20,0,0,TO_TIMESTAMP('2017-09-26 14:07:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:09:23.102
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,557252,0,110,541180,548898,'F',TO_TIMESTAMP('2017-09-26 14:09:23','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Neuer Datensatz Name',30,0,0,TO_TIMESTAMP('2017-09-26 14:09:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:09:44.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,557261,0,110,541180,548899,'F',TO_TIMESTAMP('2017-09-26 14:09:44','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Neuer Datensatz Breadcrumb',40,0,0,TO_TIMESTAMP('2017-09-26 14:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:10:14.675
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540676,541181,TO_TIMESTAMP('2017-09-26 14:10:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','flags',10,TO_TIMESTAMP('2017-09-26 14:10:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:10:40.164
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,304,0,110,541181,548900,'F',TO_TIMESTAMP('2017-09-26 14:10:39','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Ordner',10,0,0,TO_TIMESTAMP('2017-09-26 14:10:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:10:55.376
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,5321,0,110,541181,548901,'F',TO_TIMESTAMP('2017-09-26 14:10:55','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Schreibgeschützt',20,0,0,TO_TIMESTAMP('2017-09-26 14:10:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:11:13.245
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3315,0,110,541181,548902,'F',TO_TIMESTAMP('2017-09-26 14:11:13','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Verkaufs Transaktion',30,0,0,TO_TIMESTAMP('2017-09-26 14:11:13','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:11:32.078
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540676,541182,TO_TIMESTAMP('2017-09-26 14:11:32','YYYY-MM-DD HH24:MI:SS'),100,'Y','org',20,TO_TIMESTAMP('2017-09-26 14:11:32','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:11:41.910
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1993,0,110,541182,548903,'F',TO_TIMESTAMP('2017-09-26 14:11:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2017-09-26 14:11:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:11:55.430
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,284,0,110,541182,548904,'F',TO_TIMESTAMP('2017-09-26 14:11:55','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',20,0,0,TO_TIMESTAMP('2017-09-26 14:11:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:13:36.274
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548853
;
-- 2017-09-26T14:13:36.336
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548854
;
-- 2017-09-26T14:13:36.345
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548855
;
-- 2017-09-26T14:13:36.357
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548856
;
-- 2017-09-26T14:13:36.373
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548859
;
-- 2017-09-26T14:13:36.383
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548860
;
-- 2017-09-26T14:13:45.586
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548861
;
-- 2017-09-26T14:13:45.602
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548862
;
-- 2017-09-26T14:13:45.615
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548863
;
-- 2017-09-26T14:13:45.627
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548864
;
-- 2017-09-26T14:13:45.637
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548865
;
-- 2017-09-26T14:13:45.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548866
;
-- 2017-09-26T14:13:53.814
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548867
;
-- 2017-09-26T14:13:53.826
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548868
;
-- 2017-09-26T14:13:53.833
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548869
;
-- 2017-09-26T14:13:53.841
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548870
;
-- 2017-09-26T14:13:53.848
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548871
;
-- 2017-09-26T14:13:53.854
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548872
;
-- 2017-09-26T14:13:59.132
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548873
;
-- 2017-09-26T14:13:59.153
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548874
;
-- 2017-09-26T14:14:02.871
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=548858
;
-- 2017-09-26T14:14:15.907
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy,Value) VALUES (0,0,110,540507,TO_TIMESTAMP('2017-09-26 14:14:15','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-09-26 14:14:15','YYYY-MM-DD HH24:MI:SS'),100,'advanced edit')
;
-- 2017-09-26T14:14:15.911
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section_Trl (AD_Language,AD_UI_Section_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_UI_Section_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_UI_Section t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_UI_Section_ID=540507 AND NOT EXISTS (SELECT 1 FROM AD_UI_Section_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_UI_Section_ID=t.AD_UI_Section_ID)
;
-- 2017-09-26T14:14:19.130
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540678,540507,TO_TIMESTAMP('2017-09-26 14:14:19','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-09-26 14:14:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:14:32.381
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET AD_UI_Column_ID=540678, SeqNo=10,Updated=TO_TIMESTAMP('2017-09-26 14:14:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=541177
;
-- 2017-09-26T14:15:06.822
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,283,0,110,541181,548905,'F',TO_TIMESTAMP('2017-09-26 14:15:06','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Aktiv',40,0,0,TO_TIMESTAMP('2017-09-26 14:15:06','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-26T14:15:10.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-09-26 14:15:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548905
;
-- 2017-09-26T14:15:14.855
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-09-26 14:15:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548900
;
-- 2017-09-26T14:15:17.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-09-26 14:15:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548901
;
-- 2017-09-26T14:15:21.564
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-09-26 14:15:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548902
;
-- 2017-09-26T14:16:48.591
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-09-26 14:16:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548857
;
-- 2017-09-26T14:24:43.093
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548857
;
-- 2017-09-26T14:24:43.094
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548885
;
-- 2017-09-26T14:24:43.095
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548886
;
-- 2017-09-26T14:24:43.096
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548887
;
-- 2017-09-26T14:24:43.098
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548888
;
-- 2017-09-26T14:24:43.100
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548889
;
-- 2017-09-26T14:24:43.101
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548890
;
-- 2017-09-26T14:24:43.104
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548894
;
-- 2017-09-26T14:24:43.105
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548892
;
-- 2017-09-26T14:24:43.106
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548893
;
-- 2017-09-26T14:24:43.107
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548905
;
-- 2017-09-26T14:24:43.109
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548900
;
-- 2017-09-26T14:24:43.110
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548901
;
-- 2017-09-26T14:24:43.111
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548902
;
-- 2017-09-26T14:24:43.113
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2017-09-26 14:24:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548903
;
-- 2017-09-26T14:27:27.378
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='N', SeqNo_SideList=0,Updated=TO_TIMESTAMP('2017-09-26 14:27:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548857
;
-- 2017-09-26T14:27:27.386
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=10,Updated=TO_TIMESTAMP('2017-09-26 14:27:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548885
;
-- 2017-09-26T14:27:27.388
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=20,Updated=TO_TIMESTAMP('2017-09-26 14:27:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548887
;
-- 2017-09-26T14:27:27.389
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=30,Updated=TO_TIMESTAMP('2017-09-26 14:27:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548905
;
-- 2017-09-26T14:27:27.390
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=40,Updated=TO_TIMESTAMP('2017-09-26 14:27:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548903
; | the_stack |
-- 2019-05-07T12:41:38.391
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,576702,0,'PrincipalType',TO_TIMESTAMP('2019-05-07 12:41:38','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Typ','Typ',TO_TIMESTAMP('2019-05-07 12:41:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-05-07T12:41:38.402
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=576702 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2019-05-07T12:41:45.890
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-05-07 12:41:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576702 AND AD_Language='de_CH'
;
-- 2019-05-07T12:41:46.069
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576702,'de_CH')
;
-- 2019-05-07T12:41:47.522
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-05-07 12:41:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576702 AND AD_Language='de_DE'
;
-- 2019-05-07T12:41:47.525
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576702,'de_DE')
;
-- 2019-05-07T12:41:47.543
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(576702,'de_DE')
;
-- 2019-05-07T12:41:51.203
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Type', PrintName='Type',Updated=TO_TIMESTAMP('2019-05-07 12:41:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576702 AND AD_Language='en_US'
;
-- 2019-05-07T12:41:51.204
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576702,'en_US')
;
-- 2019-05-07T12:41:53.617
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-05-07 12:41:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576702 AND AD_Language='en_US'
;
-- 2019-05-07T12:41:53.618
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576702,'en_US')
;
-- 2019-05-07T12:42:16.040
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540992,TO_TIMESTAMP('2019-05-07 12:42:15','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','PrincipalType',TO_TIMESTAMP('2019-05-07 12:42:15','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2019-05-07T12:42:16.042
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Reference_ID=540992 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2019-05-07T12:42:50.181
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541965,540992,TO_TIMESTAMP('2019-05-07 12:42:50','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Nutzer',TO_TIMESTAMP('2019-05-07 12:42:50','YYYY-MM-DD HH24:MI:SS'),100,'U','Nutzer')
;
-- 2019-05-07T12:42:50.188
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Ref_List_ID=541965 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2019-05-07T12:42:56.674
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-05-07 12:42:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Ref_List_ID=541965
;
-- 2019-05-07T12:43:05.221
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET IsTranslated='Y', Name='User',Updated=TO_TIMESTAMP('2019-05-07 12:43:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Ref_List_ID=541965
;
-- 2019-05-07T12:43:22.875
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541966,540992,TO_TIMESTAMP('2019-05-07 12:43:22','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Nutzergruppe',TO_TIMESTAMP('2019-05-07 12:43:22','YYYY-MM-DD HH24:MI:SS'),100,'G','UserGroup')
;
-- 2019-05-07T12:43:22.876
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Ref_List_ID=541966 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
update AD_Ref_List set ValueName='User' where AD_Ref_List_ID=541965;
-- 2019-05-07T12:47:54.843
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Classname='de.metas.security.process.UserGroupRecordAccess_Grant', Value='UserGroupRecordAccess_Grant',Updated=TO_TIMESTAMP('2019-05-07 12:47:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=541095
;
-- 2019-05-07T12:48:19.509
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET SeqNo=40,Updated=TO_TIMESTAMP('2019-05-07 12:48:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541395
;
-- 2019-05-07T12:48:22.887
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET SeqNo=30,Updated=TO_TIMESTAMP('2019-05-07 12:48:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541394
;
-- 2019-05-07T12:48:58.495
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Reference_Value_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,576702,0,541095,541443,17,540992,'PrincipalType',TO_TIMESTAMP('2019-05-07 12:48:58','YYYY-MM-DD HH24:MI:SS'),100,'G','D',0,'Y','N','Y','N','Y','N','Typ',20,TO_TIMESTAMP('2019-05-07 12:48:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-05-07T12:48:58.503
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541443 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2019-05-07T12:49:31.420
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET DisplayLogic='@PrincipalType@=U',Updated=TO_TIMESTAMP('2019-05-07 12:49:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541394
;
-- 2019-05-07T12:49:38.831
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET DisplayLogic='@PrincipalType@=G',Updated=TO_TIMESTAMP('2019-05-07 12:49:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541395
;
-- 2019-05-07T12:54:44.515
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Classname='de.metas.security.process.UserGroupRecordAccess_Revoke', Value='UserGroupRecordAccess_Revoke',Updated=TO_TIMESTAMP('2019-05-07 12:54:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=541096
;
-- 2019-05-07T12:55:08.954
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET SeqNo=40,Updated=TO_TIMESTAMP('2019-05-07 12:55:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541398
;
-- 2019-05-07T12:55:13.900
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET SeqNo=30,Updated=TO_TIMESTAMP('2019-05-07 12:55:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541397
;
-- 2019-05-07T12:55:48.669
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Reference_Value_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,576702,0,541096,541444,17,540992,'PrincipalType',TO_TIMESTAMP('2019-05-07 12:55:48','YYYY-MM-DD HH24:MI:SS'),100,'G','D',0,'Y','N','Y','N','Y','N','Typ',20,TO_TIMESTAMP('2019-05-07 12:55:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-05-07T12:55:48.671
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541444 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2019-05-07T12:56:06.545
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET DisplayLogic='@PrincipalType@=U',Updated=TO_TIMESTAMP('2019-05-07 12:56:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541397
;
-- 2019-05-07T12:56:14.682
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET DisplayLogic='@PrincipalType@=G',Updated=TO_TIMESTAMP('2019-05-07 12:56:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541398
;
-- 2019-05-07T14:16:11.731
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2019-05-07 14:16:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541394
;
-- 2019-05-07T14:16:14.497
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2019-05-07 14:16:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541395
;
-- 2019-05-07T14:26:46.449
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2019-05-07 14:26:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541397
;
-- 2019-05-07T14:26:49.047
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2019-05-07 14:26:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541398
; | the_stack |
-- 2020-02-06T13:51:45.883Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID, AD_Column_ID, AD_Element_ID, AD_Org_ID, AD_Reference_ID, AD_Table_ID, ColumnName, Created, CreatedBy, DDL_NoForeignKey, DefaultValue, Description, EntityType, FieldLength, Help, IsActive, IsAdvancedText, IsAllowLogging, IsAlwaysUpdateable, IsAutoApplyValidationRule, IsAutocomplete, IsCalculated, IsDimension, IsDLMPartitionBoundary, IsEncrypted,
IsForceIncludeInGeneratedModel, IsGenericZoomKeyColumn, IsGenericZoomOrigin, IsIdentifier, IsKey, IsLazyLoading, IsMandatory, IsParent, IsRangeFilter, IsSelectionColumn, IsShowFilterIncrementButtons, IsStaleable, IsSyncDatabase, IsTranslated, IsUpdateable, IsUseDocSequence, Name, SelectionColumnSeqNo, Updated, UpdatedBy, Version)
VALUES (0, 569954, 1752, 0, 30, 104, 'AD_Message_ID', TO_TIMESTAMP('2020-02-06 15:51:45', 'YYYY-MM-DD HH24:MI:SS'), 100, 'N', '', 'System Message', 'D', 10, 'Information and Error messages', 'Y', 'N', 'Y', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'Y', 'N', 'N', 'N', 'N', 'N', 'N', 'Meldung', 0, TO_TIMESTAMP('2020-02-06 15:51:45', 'YYYY-MM-DD HH24:MI:SS'),
100, 1)
;
-- 2020-02-06T13:51:45.888Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language, AD_Column_ID, Name, IsTranslated, AD_Client_ID, AD_Org_ID, Created, Createdby, Updated, UpdatedBy)
SELECT l.AD_Language,
t.AD_Column_ID,
t.Name,
'N',
t.AD_Client_ID,
t.AD_Org_ID,
t.Created,
t.Createdby,
t.Updated,
t.UpdatedBy
FROM AD_Language l,
AD_Column t
WHERE l.IsActive = 'Y'
AND (l.IsSystemLanguage = 'Y' AND l.IsBaseLanguage = 'N')
AND t.AD_Column_ID = 569954
AND NOT EXISTS(SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language = l.AD_Language AND tt.AD_Column_ID = t.AD_Column_ID)
;
-- 2020-02-06T13:51:45.922Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */
select update_Column_Translation_From_AD_Element(1752)
;
-- 2020-02-06T13:51:54.989Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */
SELECT public.db_alter_table('AD_Ref_List', 'ALTER TABLE public.AD_Ref_List ADD COLUMN AD_Message_ID NUMERIC(10)')
;
-- 2020-02-06T13:51:55.224Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE AD_Ref_List
ADD CONSTRAINT ADMessage_ADRefList FOREIGN KEY (AD_Message_ID) REFERENCES public.AD_Message DEFERRABLE INITIALLY DEFERRED
;
-- 2020-02-06T13:52:08.762Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column
SET IsSelectionColumn='N',
Updated=TO_TIMESTAMP('2020-02-06 15:52:08', 'YYYY-MM-DD HH24:MI:SS'),
UpdatedBy=100
WHERE AD_Column_ID = 569954
;
-- 2020-02-06T13:52:28.828Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO t_alter_column
values ('ad_ref_list', 'AD_Message_ID', 'NUMERIC(10)', null, null)
;
-- 2020-02-07T15:21:42.962Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID, AD_Message_ID, AD_Org_ID, Created, CreatedBy, EntityType, IsActive, MsgText, MsgType, Updated, UpdatedBy, Value)
VALUES (0, 544962, 0, TO_TIMESTAMP('2020-02-07 17:21:42', 'YYYY-MM-DD HH24:MI:SS'), 100, 'U', 'Y', 'VOID ENGLISH TEST MESSAGE', 'I', TO_TIMESTAMP('2020-02-07 17:21:42', 'YYYY-MM-DD HH24:MI:SS'), 100, 'VO_Validation_Message')
;
-- 2020-02-07T15:21:42.971Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language, AD_Message_ID, MsgText, MsgTip, IsTranslated, AD_Client_ID, AD_Org_ID, Created, Createdby, Updated, UpdatedBy)
SELECT l.AD_Language,
t.AD_Message_ID,
t.MsgText,
t.MsgTip,
'N',
t.AD_Client_ID,
t.AD_Org_ID,
t.Created,
t.Createdby,
t.Updated,
t.UpdatedBy
FROM AD_Language l,
AD_Message t
WHERE l.IsActive = 'Y'
AND (l.IsSystemLanguage = 'Y' AND l.IsBaseLanguage = 'N')
AND t.AD_Message_ID = 544962
AND NOT EXISTS(SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language = l.AD_Language AND tt.AD_Message_ID = t.AD_Message_ID)
;
-- 2020-02-07T15:21:53.442Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl
SET MsgText='VOID CH TEST MESSAGE',
Updated=TO_TIMESTAMP('2020-02-07 17:21:53', 'YYYY-MM-DD HH24:MI:SS'),
UpdatedBy=100
WHERE AD_Language = 'de_CH'
AND AD_Message_ID = 544962
;
-- 2020-02-07T15:21:58.837Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl
SET MsgText='VOID NL TEST MESSAGE',
Updated=TO_TIMESTAMP('2020-02-07 17:21:58', 'YYYY-MM-DD HH24:MI:SS'),
UpdatedBy=100
WHERE AD_Language = 'nl_NL'
AND AD_Message_ID = 544962
;
-- 2020-02-07T15:22:11.045Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message
SET MsgText='VOID GERMAN TEST MESSAGE',
Updated=TO_TIMESTAMP('2020-02-07 17:22:11', 'YYYY-MM-DD HH24:MI:SS'),
UpdatedBy=100
WHERE AD_Message_ID = 544962
;
-- 2020-02-07T16:28:27.112Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID, AD_Element_ID, AD_Org_ID, ColumnName, Created, CreatedBy, Description, EntityType, Help, IsActive, Name, PrintName, Updated, UpdatedBy)
VALUES (0, 577511, 0, 'AD_Messsage_Value', TO_TIMESTAMP('2020-02-07 18:28:26', 'YYYY-MM-DD HH24:MI:SS'), 100, 'Suchschlüssel für den Eintrag im erforderlichen Format - muss eindeutig sein', 'U', 'A search key allows you a fast method of finding a particular record.
If you leave the search key empty, the system automatically creates a numeric number. The document sequence used for this fallback number is defined in the "Maintain Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table (e.g. C_Order).', 'Y', 'Suchschlüssel', 'Suchschlüssel', TO_TIMESTAMP('2020-02-07 18:28:26', 'YYYY-MM-DD HH24:MI:SS'), 100)
;
-- 2020-02-07T16:28:27.115Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language, AD_Element_ID, CommitWarning, Description, Help, Name, PO_Description, PO_Help, PO_Name, PO_PrintName, PrintName, WEBUI_NameBrowse, WEBUI_NameNew, WEBUI_NameNewBreadcrumb, IsTranslated, AD_Client_ID, AD_Org_ID, Created, Createdby, Updated, UpdatedBy)
SELECT l.AD_Language,
t.AD_Element_ID,
t.CommitWarning,
t.Description,
t.Help,
t.Name,
t.PO_Description,
t.PO_Help,
t.PO_Name,
t.PO_PrintName,
t.PrintName,
t.WEBUI_NameBrowse,
t.WEBUI_NameNew,
t.WEBUI_NameNewBreadcrumb,
'N',
t.AD_Client_ID,
t.AD_Org_ID,
t.Created,
t.Createdby,
t.Updated,
t.UpdatedBy
FROM AD_Language l,
AD_Element t
WHERE l.IsActive = 'Y'
AND (l.IsSystemLanguage = 'Y' OR l.IsBaseLanguage = 'Y')
AND t.AD_Element_ID = 577511
AND NOT EXISTS(SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language = l.AD_Language AND tt.AD_Element_ID = t.AD_Element_ID)
;
-- 2020-02-10T10:21:57.675Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID, AD_Message_ID, AD_Org_ID, Created, CreatedBy, EntityType, IsActive, MsgText, MsgType, Updated, UpdatedBy, Value)
VALUES (0, 544963, 0, TO_TIMESTAMP('2020-02-10 12:21:57', 'YYYY-MM-DD HH24:MI:SS'), 100, 'D', 'Y', 'YES', 'I', TO_TIMESTAMP('2020-02-10 12:21:57', 'YYYY-MM-DD HH24:MI:SS'), 100, 'de.metas.popupinfo.yes')
;
-- 2020-02-10T10:21:57.684Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language, AD_Message_ID, MsgText, MsgTip, IsTranslated, AD_Client_ID, AD_Org_ID, Created, Createdby, Updated, UpdatedBy)
SELECT l.AD_Language,
t.AD_Message_ID,
t.MsgText,
t.MsgTip,
'N',
t.AD_Client_ID,
t.AD_Org_ID,
t.Created,
t.Createdby,
t.Updated,
t.UpdatedBy
FROM AD_Language l,
AD_Message t
WHERE l.IsActive = 'Y'
AND (l.IsSystemLanguage = 'Y' AND l.IsBaseLanguage = 'N')
AND t.AD_Message_ID = 544963
AND NOT EXISTS(SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language = l.AD_Language AND tt.AD_Message_ID = t.AD_Message_ID)
;
-- 2020-02-10T10:22:10.093Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID, AD_Message_ID, AD_Org_ID, Created, CreatedBy, EntityType, IsActive, MsgText, MsgType, Updated, UpdatedBy, Value)
VALUES (0, 544964, 0, TO_TIMESTAMP('2020-02-10 12:22:09', 'YYYY-MM-DD HH24:MI:SS'), 100, 'U', 'Y', 'NO', 'I', TO_TIMESTAMP('2020-02-10 12:22:09', 'YYYY-MM-DD HH24:MI:SS'), 100, 'de.metas.popupinfo.no')
;
-- 2020-02-10T10:22:10.094Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language, AD_Message_ID, MsgText, MsgTip, IsTranslated, AD_Client_ID, AD_Org_ID, Created, Createdby, Updated, UpdatedBy)
SELECT l.AD_Language,
t.AD_Message_ID,
t.MsgText,
t.MsgTip,
'N',
t.AD_Client_ID,
t.AD_Org_ID,
t.Created,
t.Createdby,
t.Updated,
t.UpdatedBy
FROM AD_Language l,
AD_Message t
WHERE l.IsActive = 'Y'
AND (l.IsSystemLanguage = 'Y' AND l.IsBaseLanguage = 'N')
AND t.AD_Message_ID = 544964
AND NOT EXISTS(SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language = l.AD_Language AND tt.AD_Message_ID = t.AD_Message_ID)
;
-- 2020-02-10T10:22:22.713Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID, AD_Message_ID, AD_Org_ID, Created, CreatedBy, EntityType, IsActive, MsgText, MsgType, Updated, UpdatedBy, Value)
VALUES (0, 544965, 0, TO_TIMESTAMP('2020-02-10 12:22:22', 'YYYY-MM-DD HH24:MI:SS'), 100, 'U', 'Y', 'TESTUL', 'I', TO_TIMESTAMP('2020-02-10 12:22:22', 'YYYY-MM-DD HH24:MI:SS'), 100, 'de.metas.popupinfo.test')
;
-- 2020-02-10T10:22:22.714Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language, AD_Message_ID, MsgText, MsgTip, IsTranslated, AD_Client_ID, AD_Org_ID, Created, Createdby, Updated, UpdatedBy)
SELECT l.AD_Language,
t.AD_Message_ID,
t.MsgText,
t.MsgTip,
'N',
t.AD_Client_ID,
t.AD_Org_ID,
t.Created,
t.Createdby,
t.Updated,
t.UpdatedBy
FROM AD_Language l,
AD_Message t
WHERE l.IsActive = 'Y'
AND (l.IsSystemLanguage = 'Y' AND l.IsBaseLanguage = 'N')
AND t.AD_Message_ID = 544965
AND NOT EXISTS(SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language = l.AD_Language AND tt.AD_Message_ID = t.AD_Message_ID)
;
-- 2020-02-10T13:37:47.047Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message
SET MsgText='Are you sure you want to void this document?',
Value='de.metas.popupinfo.voidMessage',
Updated=TO_TIMESTAMP('2020-02-10 15:37:47', 'YYYY-MM-DD HH24:MI:SS'),
UpdatedBy=100
WHERE AD_Message_ID = 544965
;
-- 2020-02-10T13:38:18.726Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl
SET IsTranslated='Y',
MsgText='Are you sure you want to void this document?',
Updated=TO_TIMESTAMP('2020-02-10 15:38:18', 'YYYY-MM-DD HH24:MI:SS'),
UpdatedBy=100
WHERE AD_Language = 'en_US'
AND AD_Message_ID = 544965
;
-- 2020-02-10T13:38:21.816Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl
SET MsgText='Möchten Sie diesen Beleg wirklich löschen?',
Updated=TO_TIMESTAMP('2020-02-10 15:38:21', 'YYYY-MM-DD HH24:MI:SS'),
UpdatedBy=100
WHERE AD_Language = 'de_DE'
AND AD_Message_ID = 544965
;
-- 2020-02-10T13:38:25.598Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl
SET MsgText='Möchten Sie diesen Beleg wirklich löschen?',
Updated=TO_TIMESTAMP('2020-02-10 15:38:25', 'YYYY-MM-DD HH24:MI:SS'),
UpdatedBy=100
WHERE AD_Language = 'nl_NL'
AND AD_Message_ID = 544965
;
-- 2020-02-10T13:38:28.631Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl
SET MsgText='Möchten Sie diesen Beleg wirklich löschen?',
Updated=TO_TIMESTAMP('2020-02-10 15:38:28', 'YYYY-MM-DD HH24:MI:SS'),
UpdatedBy=100
WHERE AD_Language = 'de_CH'
AND AD_Message_ID = 544965
;
-- 2020-02-10T13:38:34.192Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message
SET MsgText='Möchten Sie diesen Beleg wirklich löschen?',
Updated=TO_TIMESTAMP('2020-02-10 15:38:34', 'YYYY-MM-DD HH24:MI:SS'),
UpdatedBy=100
WHERE AD_Message_ID = 544965
;
update ad_ref_list
set ad_message_id = 544965
where ad_ref_list_id = 182
; | the_stack |
-----------------------------------------------------------------------
-- BEGIN END https://msdn.microsoft.com/en-us/library/ms190487.aspx
USE AdventureWorks2012;
GO
BEGIN TRANSACTION;
GO
IF @@TRANCOUNT = 0
BEGIN
SELECT FirstName, MiddleName
FROM Person.Person WHERE LastName = 'Adams';
ROLLBACK TRANSACTION;
PRINT N'Rolling back the transaction two times would cause an error.';
END;
ROLLBACK TRANSACTION;
PRINT N'Rolled back the transaction.';
GO
-----------------------------------------------------------------------
-- BREAK https://msdn.microsoft.com/en-us/library/ms181271.aspx
-----------------------------------------------------------------------
-- CONTINUE https://msdn.microsoft.com/en-us/library/ms174366.aspx
-----------------------------------------------------------------------
-- GOTO
DECLARE @Counter int;
SET @Counter = 1;
WHILE @Counter < 10
BEGIN
SELECT @Counter
SET @Counter = @Counter + 1
IF @Counter = 4 GOTO Branch_One --Jumps to the first branch.
IF @Counter = 5 GOTO Branch_Two --This will never execute.
END
Branch_One:
SELECT 'Jumping To Branch One.'
GOTO Branch_Three; --This will prevent Branch_Two from executing.
Branch_Two:
SELECT 'Jumping To Branch Two.'
Branch_Three:
SELECT 'Jumping To Branch Three.';
-----------------------------------------------------------------------
-- IF ELSE https://msdn.microsoft.com/en-us/library/ms182587.aspx
DECLARE @compareprice money, @cost money
EXECUTE Production.uspGetList '%Bikes%', 700,
@compareprice OUT,
@cost OUTPUT
IF @cost <= @compareprice
BEGIN
PRINT 'These products can be purchased for less than
$'+RTRIM(CAST(@compareprice AS varchar(20)))+'.'
END
ELSE
PRINT 'The prices for all products in this category exceed
$'+ RTRIM(CAST(@compareprice AS varchar(20)))+'.'
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using a query as part of a Boolean expression
IF 1 = 1 PRINT 'Boolean_expression is true.'
ELSE PRINT 'Boolean_expression is false.' ;
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using a simple Boolean expression
USE AdventureWorks2012;
GO
IF
(SELECT COUNT(*) FROM Production.Product WHERE Name LIKE 'Touring-3000%' ) > 5
PRINT 'There are more than 5 Touring-3000 bicycles.'
ELSE PRINT 'There are 5 or less Touring-3000 bicycles.' ;
GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using a statement block
USE AdventureWorks2012;
GO
DECLARE @AvgWeight decimal(8,2), @BikeCount int
IF
(SELECT COUNT(*) FROM Production.Product WHERE Name LIKE 'Touring-3000%' ) > 5
BEGIN
SET @BikeCount =
(SELECT COUNT(*)
FROM Production.Product
WHERE Name LIKE 'Touring-3000%');
SET @AvgWeight =
(SELECT AVG(Weight)
FROM Production.Product
WHERE Name LIKE 'Touring-3000%');
PRINT 'There are ' + CAST(@BikeCount AS varchar(3)) + ' Touring-3000 bikes.'
PRINT 'The average weight of the top 5 Touring-3000 bikes is ' + CAST(@AvgWeight AS varchar(8)) + '.';
END
ELSE
BEGIN
SET @AvgWeight =
(SELECT AVG(Weight)
FROM Production.Product
WHERE Name LIKE 'Touring-3000%' );
PRINT 'Average weight of the Touring-3000 bikes is ' + CAST(@AvgWeight AS varchar(8)) + '.' ;
END ;
GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using nested IF...ELSE statements
DECLARE @Number int;
SET @Number = 50;
IF @Number > 100
PRINT 'The number is large.';
ELSE
BEGIN
IF @Number < 10
PRINT 'The number is small.';
ELSE
PRINT 'The number is medium.';
END ;
GO
-----------------------------------------------------------------------
-- RETURN https://msdn.microsoft.com/en-us/library/ms174998.aspx
CREATE PROCEDURE findjobs @nm sysname = NULL
AS
IF @nm IS NULL
BEGIN
PRINT 'You must give a user name'
RETURN
END
ELSE
BEGIN
SELECT o.name, o.id, o.uid
FROM sysobjects o INNER JOIN master..syslogins l
ON o.uid = l.sid
WHERE l.name = @nm
END;
-----------------------------------------------------------------------
-- THROW https://msdn.microsoft.com/en-us/library/ee677615.aspx
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using THROW to raise an exception
THROW 51000, 'The record does not exist.', 1;
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using THROW to raise an exception again
USE tempdb;
GO
CREATE TABLE dbo.TestRethrow
( ID INT PRIMARY KEY
);
BEGIN TRY
INSERT dbo.TestRethrow(ID) VALUES(1);
-- Force error 2627, Violation of PRIMARY KEY constraint to be raised.
INSERT dbo.TestRethrow(ID) VALUES(1);
END TRY
BEGIN CATCH
PRINT 'In catch block.';
THROW;
END CATCH;
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using FORMATMESSAGE with THROW
EXEC sys.sp_addmessage
@msgnum = 60000
,@severity = 16
,@msgtext = N'This is a test message with one numeric parameter (%d), one string parameter (%s), and another string parameter (%s).'
,@lang = 'us_english';
GO
DECLARE @msg NVARCHAR(2048) = FORMATMESSAGE(60000, 500, N'First string', N'second string');
THROW 60000, @msg, 1;
-----------------------------------------------------------------------
-- TRY CATCH https://msdn.microsoft.com/en-us/library/ms175976.aspx
-- Verify that the stored procedure does not already exist.
IF OBJECT_ID ( 'usp_GetErrorInfo', 'P' ) IS NOT NULL
DROP PROCEDURE usp_GetErrorInfo;
GO
-- Create procedure to retrieve error information.
CREATE PROCEDURE usp_GetErrorInfo
AS
SELECT
ERROR_NUMBER() AS ErrorNumber
,ERROR_SEVERITY() AS ErrorSeverity
,ERROR_STATE() AS ErrorState
,ERROR_PROCEDURE() AS ErrorProcedure
,ERROR_LINE() AS ErrorLine
,ERROR_MESSAGE() AS ErrorMessage;
GO
BEGIN TRY
-- Generate divide-by-zero error.
SELECT 1/0;
END TRY
BEGIN CATCH
-- Execute error retrieval routine.
EXECUTE usp_GetErrorInfo;
END CATCH;
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using TRY…CATCH
BEGIN TRY
-- Generate a divide-by-zero error.
SELECT 1/0;
END TRY
BEGIN CATCH
SELECT
ERROR_NUMBER() AS ErrorNumber
,ERROR_SEVERITY() AS ErrorSeverity
,ERROR_STATE() AS ErrorState
,ERROR_PROCEDURE() AS ErrorProcedure
,ERROR_LINE() AS ErrorLine
,ERROR_MESSAGE() AS ErrorMessage;
END CATCH;
GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using TRY…CATCH in a transaction
BEGIN TRANSACTION;
BEGIN TRY
-- Generate a constraint violation error.
DELETE FROM Production.Product
WHERE ProductID = 980;
END TRY
BEGIN CATCH
SELECT
ERROR_NUMBER() AS ErrorNumber
,ERROR_SEVERITY() AS ErrorSeverity
,ERROR_STATE() AS ErrorState
,ERROR_PROCEDURE() AS ErrorProcedure
,ERROR_LINE() AS ErrorLine
,ERROR_MESSAGE() AS ErrorMessage;
IF @@TRANCOUNT > 0
ROLLBACK TRANSACTION;
END CATCH;
IF @@TRANCOUNT > 0
COMMIT TRANSACTION;
GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using TRY…CATCH with XACT_STATE
-- Check to see whether this stored procedure exists.
IF OBJECT_ID (N'usp_GetErrorInfo', N'P') IS NOT NULL
DROP PROCEDURE usp_GetErrorInfo;
GO
-- Create procedure to retrieve error information.
CREATE PROCEDURE usp_GetErrorInfo
AS
SELECT
ERROR_NUMBER() AS ErrorNumber
,ERROR_SEVERITY() AS ErrorSeverity
,ERROR_STATE() AS ErrorState
,ERROR_LINE () AS ErrorLine
,ERROR_PROCEDURE() AS ErrorProcedure
,ERROR_MESSAGE() AS ErrorMessage;
GO
-- SET XACT_ABORT ON will cause the transaction to be uncommittable
-- when the constraint violation occurs.
SET XACT_ABORT ON;
BEGIN TRY
BEGIN TRANSACTION;
-- A FOREIGN KEY constraint exists on this table. This
-- statement will generate a constraint violation error.
DELETE FROM Production.Product
WHERE ProductID = 980;
-- If the DELETE statement succeeds, commit the transaction.
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
-- Execute error retrieval routine.
EXECUTE usp_GetErrorInfo;
-- Test XACT_STATE:
-- If 1, the transaction is committable.
-- If -1, the transaction is uncommittable and should
-- be rolled back.
-- XACT_STATE = 0 means that there is no transaction and
-- a commit or rollback operation would generate an error.
-- Test whether the transaction is uncommittable.
IF (XACT_STATE()) = -1
BEGIN
PRINT
N'The transaction is in an uncommittable state.' +
'Rolling back transaction.'
ROLLBACK TRANSACTION;
END;
-- Test whether the transaction is committable.
IF (XACT_STATE()) = 1
BEGIN
PRINT
N'The transaction is committable.' +
'Committing transaction.'
COMMIT TRANSACTION;
END;
END CATCH;
GO
-----------------------------------------------------------------------
-- WAITFOR https://msdn.microsoft.com/en-us/library/ms187331.aspx
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using WAITFOR TIME
EXECUTE sp_add_job @job_name = 'TestJob';
BEGIN
WAITFOR TIME '22:20';
EXECUTE sp_update_job @job_name = 'TestJob',
@new_name = 'UpdatedJob';
END;
GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using WAITFOR DELAY
BEGIN
WAITFOR DELAY '02:00';
EXECUTE sp_helpdb;
END;
GO
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using WAITFOR DELAY with a local variable
IF OBJECT_ID('dbo.TimeDelay_hh_mm_ss','P') IS NOT NULL
DROP PROCEDURE dbo.TimeDelay_hh_mm_ss;
GO
CREATE PROCEDURE dbo.TimeDelay_hh_mm_ss
(
@DelayLength char(8)= '00:00:00'
)
AS
DECLARE @ReturnInfo varchar(255)
IF ISDATE('2000-01-01 ' + @DelayLength + '.000') = 0
BEGIN
SELECT @ReturnInfo = 'Invalid time ' + @DelayLength
+ ',hh:mm:ss, submitted.';
-- This PRINT statement is for testing, not use in production.
PRINT @ReturnInfo
RETURN(1)
END
BEGIN
WAITFOR DELAY @DelayLength
SELECT @ReturnInfo = 'A total time of ' + @DelayLength + ',
hh:mm:ss, has elapsed! Your time is up.'
-- This PRINT statement is for testing, not use in production.
PRINT @ReturnInfo;
END;
GO
/* This statement executes the dbo.TimeDelay_hh_mm_ss procedure. */
EXEC TimeDelay_hh_mm_ss '00:00:10';
GO
-- waitfor with receive statement
WAITFOR (
RECEIVE *
FROM ExpenseQueue);
-- waitfor with receive statement and timeout
WAITFOR (
RECEIVE *
FROM ExpenseQueue ), TIMEOUT 60000;
-- waitfor with receive statement containing column select
DECLARE @ConversationHandle uniqueidentifier;
WAITFOR (
RECEIVE TOP (1)
@ConversationHandle = conversation_handle
FROM dbo.ReplicationInboundQueue), TIMEOUT 3000;
-----------------------------------------------------------------------
-- WHILE https://msdn.microsoft.com/en-us/library/ms178642.aspx
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using BREAK and CONTINUE with nested IF...ELSE and WHILE
USE AdventureWorks2012;
GO
WHILE (SELECT AVG(ListPrice) FROM Production.Product) < $300
BEGIN
UPDATE Production.Product
SET ListPrice = ListPrice * 2
SELECT MAX(ListPrice) FROM Production.Product
IF (SELECT MAX(ListPrice) FROM Production.Product) > $500
BREAK
ELSE
CONTINUE
END
PRINT 'Too much for the market to bear';
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Using WHILE in a cursor
DECLARE Employee_Cursor CURSOR FOR
SELECT EmployeeID, Title
FROM AdventureWorks2012.HumanResources.Employee
WHERE JobTitle = 'Marketing Specialist';
OPEN Employee_Cursor;
FETCH NEXT FROM Employee_Cursor;
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH NEXT FROM Employee_Cursor;
END;
CLOSE Employee_Cursor;
DEALLOCATE Employee_Cursor;
GO | the_stack |
-- phpMyAdmin SQL Dump
-- http://www.diygw.com
--
-- 主机: localhost
-- 生成日期: 2019-01-06
-- 服务器版本: 5.5.53
-- PHP 版本: 5.6.27
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- 数据库: `diygw`
--
-- --------------------------------------------------------
--
-- 表的结构 `diygw_addons`
--
DROP TABLE IF EXISTS `diygw_addons`;
CREATE TABLE IF NOT EXISTS `diygw_addons` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(40) NOT NULL COMMENT '插件名或标识',
`title` varchar(20) NOT NULL DEFAULT '' COMMENT '中文名',
`description` text COMMENT '插件描述',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态',
`config` text COMMENT '配置',
`author` varchar(40) DEFAULT '' COMMENT '作者',
`version` varchar(20) DEFAULT '' COMMENT '版本号',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '安装时间',
`has_adminlist` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否有后台列表',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='插件表' AUTO_INCREMENT=22 ;
--
-- 转存表中的数据 `diygw_addons`
--
INSERT INTO `diygw_addons` (`id`, `name`, `title`, `description`, `status`, `config`, `author`, `version`, `create_time`, `has_adminlist`) VALUES
(19, 'systeminfo', '系统环境信息', '用于显示一些服务器的信息', 1, '{"title":"\\u7cfb\\u7edf\\u4fe1\\u606f","width":"2","display":"1"}', 'diygw', '0.1', 1543895835, 0),
(20, 'sitestat', '站点统计信息', '统计站点的基础信息', 0, '{"title":"\\u7cfb\\u7edf\\u4fe1\\u606f","width":"2","display":"1"}', 'diygw', '0.1', 1543896403, 0),
(21, 'devteam', '开发团队信息', '开发团队成员信息', 1, '{"title":"diygw\\u5f00\\u53d1\\u56e2\\u961f","width":"2","display":"1"}', 'diygw', '0.1', 1543896421, 0);
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_address`
--
DROP TABLE IF EXISTS `diygw_app_address`;
CREATE TABLE IF NOT EXISTS `diygw_app_address` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`dashboard_id` int(10) NOT NULL COMMENT '应用ID',
`mpid` int(10) DEFAULT NULL,
`user_id` int(10) NOT NULL COMMENT '用户ID',
`gender` varchar(10) DEFAULT '1' COMMENT '性别',
`name` varchar(100) NOT NULL DEFAULT '' COMMENT '姓名',
`tel` varchar(50) NOT NULL COMMENT '电话',
`is_def` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否默认1:为默认',
`address` varchar(500) NOT NULL DEFAULT '1.00' COMMENT '收货地址(不加省市区)',
`address_xq` varchar(600) DEFAULT NULL COMMENT '省市区+详细地址',
`sheng` int(10) DEFAULT NULL,
`quyu` int(10) DEFAULT NULL,
`city` int(10) DEFAULT NULL,
`code` varchar(20) DEFAULT '1' COMMENT '状态1为有效,0为无效',
`create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建人',
`update_time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=56 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_attribute`
--
DROP TABLE IF EXISTS `diygw_app_attribute`;
CREATE TABLE IF NOT EXISTS `diygw_app_attribute` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`mpid` int(10) DEFAULT NULL,
`name` varchar(30) NOT NULL DEFAULT '' COMMENT '字段名',
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '字段注释',
`type` varchar(20) DEFAULT '' COMMENT '数据类型',
`valids` text,
`model_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '模型id',
`value` varchar(100) DEFAULT '' COMMENT '字段默认值',
`remark` varchar(100) DEFAULT '' COMMENT '备注',
`update_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
`create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
`dashboard_id` int(10) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `model_id` (`model_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='模型属性表' AUTO_INCREMENT=24117 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_cart`
--
DROP TABLE IF EXISTS `diygw_app_cart`;
CREATE TABLE IF NOT EXISTS `diygw_app_cart` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`dbid` int(10) NOT NULL,
`dashboard_id` int(10) NOT NULL COMMENT '应用ID',
`form_id` varchar(100) NOT NULL,
`page_id` int(10) DEFAULT NULL,
`page_name` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '页面标识',
`user_id` int(10) NOT NULL COMMENT '用户ID',
`pkey` varchar(100) DEFAULT NULL,
`link_id` varchar(200) NOT NULL COMMENT '关联商品ID',
`link_title` varchar(1000) CHARACTER SET utf8 NOT NULL COMMENT '关联商品标题',
`link_json` varchar(4000) CHARACTER SET utf8 DEFAULT NULL COMMENT '关联商品备注',
`link_price` decimal(15,2) unsigned NOT NULL DEFAULT '1.00' COMMENT '关联商品价格',
`link_img` varchar(2000) CHARACTER SET utf8 DEFAULT NULL COMMENT '关联商品缩略图',
`link_total` int(5) NOT NULL DEFAULT '1' COMMENT '购买商品数',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态:1为有效,0为无效',
`mpid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='购物车' AUTO_INCREMENT=5 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_config`
--
DROP TABLE IF EXISTS `diygw_app_config`;
CREATE TABLE IF NOT EXISTS `diygw_app_config` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`mpid` int(11) DEFAULT NULL,
`name` varchar(100) DEFAULT NULL COMMENT '配置名称',
`value` text COMMENT '配置值',
`create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_dashboard`
--
DROP TABLE IF EXISTS `diygw_app_dashboard`;
CREATE TABLE IF NOT EXISTS `diygw_app_dashboard` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
`status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态',
`mpid` int(11) DEFAULT NULL,
`title` varchar(100) DEFAULT NULL COMMENT '应用名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='应用' AUTO_INCREMENT=17107 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_dashboard_extend`
--
DROP TABLE IF EXISTS `diygw_app_dashboard_extend`;
CREATE TABLE IF NOT EXISTS `diygw_app_dashboard_extend` (
`id` varchar(30) NOT NULL,
`label` varchar(100) DEFAULT NULL COMMENT '配置文本',
`name` varchar(100) DEFAULT NULL COMMENT '配置名称',
`value` text COMMENT '配置值',
`scene_id` int(10) DEFAULT NULL COMMENT '场景ID',
`dashboard_id` varchar(10) DEFAULT NULL,
`create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
`mpid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_dashboard_scene`
--
DROP TABLE IF EXISTS `diygw_app_dashboard_scene`;
CREATE TABLE IF NOT EXISTS `diygw_app_dashboard_scene` (
`id` varchar(30) NOT NULL,
`title` varchar(500) DEFAULT NULL COMMENT '应用名称',
`description` varchar(1000) DEFAULT NULL COMMENT '描述',
`dashboard_id` int(10) NOT NULL DEFAULT '0',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '最后修改时间',
`mpid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='应用场景秀';
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_menu`
--
DROP TABLE IF EXISTS `diygw_app_menu`;
CREATE TABLE IF NOT EXISTS `diygw_app_menu` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '文档ID',
`title` varchar(50) NOT NULL DEFAULT '' COMMENT '标题',
`pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级分类ID',
`sort` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序(同级有效)',
`url` char(255) NOT NULL DEFAULT '' COMMENT '链接地址',
`hide` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否隐藏',
`tip` varchar(255) NOT NULL DEFAULT '' COMMENT '提示',
`group` varchar(50) DEFAULT '' COMMENT '分组',
`is_web` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否后台',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态',
`dashboard_id` int(10) DEFAULT NULL,
`mpid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `pid` (`pid`),
KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_model`
--
DROP TABLE IF EXISTS `diygw_app_model`;
CREATE TABLE IF NOT EXISTS `diygw_app_model` (
`id` varchar(30) NOT NULL COMMENT '模型ID',
`name` char(30) NOT NULL DEFAULT '' COMMENT '模型标识',
`title` char(30) NOT NULL DEFAULT '' COMMENT '模型名称',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
`dashboard_id` int(10) DEFAULT NULL,
`mpid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文档模型表';
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_order`
--
DROP TABLE IF EXISTS `diygw_app_order`;
CREATE TABLE IF NOT EXISTS `diygw_app_order` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`order_id` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
`mpid` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`dashboard_id` int(10) NOT NULL COMMENT '应用ID',
`cart_price` decimal(15,2) unsigned NOT NULL DEFAULT '1.00' COMMENT '购物车总价',
`pay_price` decimal(15,2) NOT NULL DEFAULT '1.00' COMMENT '实际支付总价',
`pay_title` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,
`pay_detail` varchar(6000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`transaction_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支付单号(微信、支付宝等)',
`trade_no` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pay_time` datetime DEFAULT NULL,
`order_pay_id` int(10) DEFAULT NULL,
`pay_attach` varchar(127) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pay_ip` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`cart_list` text CHARACTER SET utf8 NOT NULL COMMENT '购物车商品列表',
`user_id` int(10) NOT NULL COMMENT '用户ID',
`create_time` datetime NOT NULL,
`update_time` datetime DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
`status` tinyint(1) unsigned DEFAULT '1' COMMENT '订单状态:0:已取消;1(默认):未付款;2:已付款;3:已发货;4:已收货;',
`client_name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '客户名称',
`client_tel` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '联系电话',
`client_gender` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`client_address` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '联系地址',
`client_remark` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注(买家备注)',
`way_type` int(11) DEFAULT '1' COMMENT '配送方式(1快递,2无物流)',
`express_com` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '快递公司',
`express_num` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '快递单号',
`express_price` int(11) DEFAULT '0' COMMENT '快递费(单位:分)',
`express_remark` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '快递备注',
`express_time` datetime DEFAULT NULL COMMENT '快递时间',
`finish_time` datetime DEFAULT NULL COMMENT '订单完成时间',
PRIMARY KEY (`id`),
UNIQUE KEY `orderid` (`order_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT COMMENT='订单信息' AUTO_INCREMENT=7 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_order_info`
--
DROP TABLE IF EXISTS `diygw_app_order_info`;
CREATE TABLE IF NOT EXISTS `diygw_app_order_info` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`order_id` int(10) NOT NULL,
`dbid` int(10) NOT NULL,
`dashboard_id` int(10) NOT NULL COMMENT '应用ID',
`form_id` varchar(100) NOT NULL,
`page_id` int(10) DEFAULT NULL,
`page_name` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '页面标识',
`user_id` int(10) NOT NULL COMMENT '用户ID',
`pkey` varchar(100) DEFAULT NULL,
`link_id` varchar(200) NOT NULL COMMENT '关联商品ID',
`link_title` varchar(1000) CHARACTER SET utf8 NOT NULL COMMENT '关联商品标题',
`link_json` varchar(4000) CHARACTER SET utf8 DEFAULT NULL COMMENT '关联商品备注',
`link_price` decimal(15,2) unsigned NOT NULL DEFAULT '1.00' COMMENT '关联商品价格',
`link_img` varchar(2000) CHARACTER SET utf8 DEFAULT NULL COMMENT '关联商品缩略图',
`link_total` int(5) NOT NULL DEFAULT '1' COMMENT '购买商品数',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态:1为有效,0为无效',
`mpid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='购物车' AUTO_INCREMENT=7 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_order_pay`
--
DROP TABLE IF EXISTS `diygw_app_order_pay`;
CREATE TABLE IF NOT EXISTS `diygw_app_order_pay` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`order_id` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` int(10) DEFAULT NULL,
`openid` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户Openid',
`pay_title` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pay_attach` varchar(127) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pay_detail` varchar(600) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pay_price` decimal(15,2) NOT NULL DEFAULT '1.00' COMMENT '实际支付总价',
`pay_ip` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`payment` decimal(15,2) DEFAULT NULL,
`trade_no` varchar(32) CHARACTER SET utf8 NOT NULL COMMENT '支付单号',
`transaction_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支付单号(微信、支付宝等)',
`pay_type` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '支付方式:0:微信:1支付宝;',
`pay_time` datetime DEFAULT NULL COMMENT '购买时间(下单时间)',
`pay_end_time` datetime DEFAULT NULL,
`mpid` int(11) DEFAULT NULL,
`status` tinyint(1) unsigned DEFAULT '1' COMMENT '订单状态:0:已取消;1(默认):未付款;2:已付款;',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT COMMENT='订单信息' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_order_refund`
--
DROP TABLE IF EXISTS `diygw_app_order_refund`;
CREATE TABLE IF NOT EXISTS `diygw_app_order_refund` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`order_id` varchar(32) NOT NULL COMMENT '订单项id',
`trade_no` varchar(32) NOT NULL COMMENT '退款交易号',
`refund_trade_no` varchar(32) DEFAULT NULL,
`refund_money` decimal(10,2) NOT NULL COMMENT '退款金额',
`refund_way` int(11) NOT NULL COMMENT '退款方式0:微信:1支付宝;10:线下',
`refund_time` datetime NOT NULL COMMENT '退款时间',
`remark` varchar(255) DEFAULT '' COMMENT '备注',
`mpid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单退款账户记录' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_app_page`
--
DROP TABLE IF EXISTS `diygw_app_page`;
CREATE TABLE IF NOT EXISTS `diygw_app_page` (
`id` varchar(30) NOT NULL,
`dashboard_id` int(10) DEFAULT NULL,
`name` varchar(100) DEFAULT NULL,
`title` varchar(100) DEFAULT NULL,
`scene_id` int(10) DEFAULT NULL,
`template_type` varchar(1) DEFAULT '0',
`template` varchar(100) DEFAULT NULL,
`attributes` longtext,
`content` longtext,
`is_home` int(1) DEFAULT '0',
`orderlist` int(5) DEFAULT NULL,
`create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
`mpid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_db`
--
DROP TABLE IF EXISTS `diygw_db`;
CREATE TABLE IF NOT EXISTS `diygw_db` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`title` varchar(200) DEFAULT '',
`remark` varchar(2000) DEFAULT NULL,
`type` varchar(20) NOT NULL DEFAULT '',
`database` varchar(100) NOT NULL,
`hostname` varchar(1000) NOT NULL DEFAULT '',
`username` varchar(200) NOT NULL DEFAULT '',
`password` varchar(200) NOT NULL,
`create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '安装时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='插件表' AUTO_INCREMENT=72 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_hooks`
--
DROP TABLE IF EXISTS `diygw_hooks`;
CREATE TABLE IF NOT EXISTS `diygw_hooks` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(40) NOT NULL DEFAULT '' COMMENT '钩子名称',
`description` text COMMENT '描述',
`type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '类型',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`addons` varchar(255) NOT NULL DEFAULT '' COMMENT '钩子挂载的插件 '',''分割',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ;
--
-- 转存表中的数据 `diygw_hooks`
--
INSERT INTO `diygw_hooks` (`id`, `name`, `description`, `type`, `update_time`, `addons`, `status`) VALUES
(1, 'pageHeader', '页面header钩子,一般用于加载插件CSS文件和代码', 1, 0, '', 1),
(2, 'pageFooter', '页面footer钩子,一般用于加载插件JS文件和JS代码', 1, 0, '', 1),
(3, 'AdminIndex', '首页小格子个性化显示', 1, 1479394250, 'systeminfo,devteam', 1);
-- --------------------------------------------------------
--
-- 表的结构 `diygw_member`
--
DROP TABLE IF EXISTS `diygw_member`;
CREATE TABLE IF NOT EXISTS `diygw_member` (
`uid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`mpid` int(10) DEFAULT '1' COMMENT '公众号ID',
`dashboardid` int(10) DEFAULT NULL,
`username` varchar(500) NOT NULL COMMENT '用户名',
`password` varchar(200) CHARACTER SET utf8 NOT NULL COMMENT '密码',
`rand` varchar(10) CHARACTER SET utf8 NOT NULL COMMENT '随机码',
`email` varchar(200) CHARACTER SET utf8 DEFAULT NULL COMMENT '邮箱',
`nickname` varchar(500) DEFAULT NULL COMMENT '昵称',
`sex` int(1) DEFAULT '0' COMMENT '性别',
`headimgurl` varchar(1000) CHARACTER SET utf8 DEFAULT NULL COMMENT '头像',
`mobile` varchar(20) CHARACTER SET utf8 DEFAULT NULL COMMENT '电话',
`address` varchar(200) CHARACTER SET utf8 DEFAULT NULL COMMENT '地址',
`birth` varchar(15) CHARACTER SET utf8 DEFAULT NULL COMMENT '生日',
`status` int(1) DEFAULT '1' COMMENT '状态',
`register_ip` varchar(22) CHARACTER SET utf8 DEFAULT '0' COMMENT '注册IP',
`refresh_time` int(10) DEFAULT '0' COMMENT '注册时间',
`last_login_ip` varchar(22) CHARACTER SET utf8 DEFAULT '0' COMMENT '最后登录IP',
`last_login_time` int(11) DEFAULT '0' COMMENT '最后登录时间',
PRIMARY KEY (`uid`),
KEY `sex` (`sex`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT AUTO_INCREMENT=8 ;
--
-- 转存表中的数据 `diygw_member`
--
INSERT INTO `diygw_member` (`uid`, `mpid`, `dashboardid`, `username`, `password`, `rand`, `email`, `nickname`, `sex`, `headimgurl`, `mobile`, `address`, `birth`, `status`, `register_ip`, `refresh_time`, `last_login_ip`, `last_login_time`) VALUES
(1, 1, NULL, 'lk', '3a0d69db2ce09917e31ef93d08682646', 'EYz1', NULL, 'lk', 0, 'https://wx.qlogo.cn/mmopen/vi_32/UPGlgUiaSPVG3PSicYIdcNHg62RECnz9mLLrLepfVhsBFfMYQD4dD4ZEDgWib7Eib2CT0icfkbsPN802vgrQpNic5NPQ/132', NULL, NULL, NULL, 1, '127.0.0.1', 1546411166, '127.0.0.1', 1546411167),
(2, 1, NULL, 'lk', '285befb13e05819b49bf7f40bbe48321', 'Cq6J', NULL, 'lk', 0, 'https://wx.qlogo.cn/mmopen/vi_32/UPGlgUiaSPVG3PSicYIdcNHg62RECnz9mLLrLepfVhsBFfMYQD4dD4ZEDgWib7Eib2CT0icfkbsPN802vgrQpNic5NPQ/132', NULL, NULL, NULL, 1, '127.0.0.1', 1546414339, '127.0.0.1', 1546414339),
(3, 1, 13067, 'test', '41aa5f8fcd4c28115865c901be6ea820', 'xh1C', NULL, 't', 0, NULL, NULL, NULL, NULL, 1, '127.0.0.1', 1546418238, '127.0.0.1', 1546418238),
(4, 1, 13067, 'test1', '96023cab3d44f28f2db88954356f418e', 'AkSm', NULL, 't', 0, NULL, NULL, NULL, NULL, 1, '127.0.0.1', 1546418300, '127.0.0.1', 1546418301),
(5, 1, NULL, 'lk', 'f9902e9eedb6fd480e69ec2ed9fece0f', 'qrFJ', NULL, 'lk', 0, 'https://wx.qlogo.cn/mmopen/vi_32/UPGlgUiaSPVG3PSicYIdcNHg62RECnz9mLLrLepfVhsBFfMYQD4dD4ZEDgWib7Eib2CT0icfkbsPN802vgrQpNic5NPQ/132', NULL, NULL, NULL, 1, '127.0.0.1', 1546442030, '127.0.0.1', 1546442030),
(6, 1, NULL, 'lk', '89021a03265a5862e00df632b9848c11', 'YLZp', NULL, 'lk', 0, 'https://wx.qlogo.cn/mmopen/vi_32/UPGlgUiaSPVG3PSicYIdcNHg62RECnz9mLLrLepfVhsBFfMYQD4dD4ZEDgWib7Eib2CT0icfkbsPN802vgrQpNic5NPQ/132', NULL, NULL, NULL, 1, '127.0.0.1', 1546442419, '127.0.0.1', 1546442419),
(7, 1, NULL, 'lk', 'c7b44f0e26b0d9d99c71f546c412afc1', 'IN7n', NULL, 'lk', 0, 'https://wx.qlogo.cn/mmopen/vi_32/UPGlgUiaSPVG3PSicYIdcNHg62RECnz9mLLrLepfVhsBFfMYQD4dD4ZEDgWib7Eib2CT0icfkbsPN802vgrQpNic5NPQ/132', NULL, NULL, NULL, 1, '127.0.0.1', 1546442540, '127.0.0.1', 1546442540);
-- --------------------------------------------------------
--
-- 表的结构 `diygw_member_auth`
--
DROP TABLE IF EXISTS `diygw_member_auth`;
CREATE TABLE IF NOT EXISTS `diygw_member_auth` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`openid` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT '1' COMMENT '公众号用户ID',
`mpid` int(10) NOT NULL COMMENT '公众号ID',
`uid` int(10) NOT NULL COMMENT '用户ID',
`type` tinyint(1) NOT NULL COMMENT '1:微信',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT AUTO_INCREMENT=6 ;
--
-- 转存表中的数据 `diygw_member_auth`
--
INSERT INTO `diygw_member_auth` (`id`, `openid`, `mpid`, `uid`, `type`) VALUES
(1, '', 1, 1, 2),
(2, '', 1, 2, 2),
(3, '', 1, 5, 2),
(4, '', 1, 6, 2),
(5, 'olpjs0KkW2vbesPywdiVK9A94j7Q', 1, 7, 2);
-- --------------------------------------------------------
--
-- 表的结构 `diygw_payment`
--
DROP TABLE IF EXISTS `diygw_payment`;
CREATE TABLE IF NOT EXISTS `diygw_payment` (
`payment_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增 ID',
`dashboard_id` int(11) DEFAULT NULL,
`member_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户 ID',
`openid` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT 'OPENID',
`title` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '标题|商品名称',
`trade_no` varchar(32) NOT NULL DEFAULT '0' COMMENT '订单号',
`money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '金额',
`pay_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '交易类型(1为微信2为支付宝)',
`from_addon` varchar(50) DEFAULT NULL,
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态(0:未完成交易1:完成关键交易)',
`create_time` int(10) NOT NULL COMMENT '交易时间',
`mpid` int(11) NOT NULL COMMENT '公众号标识',
`remark` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '备注',
`attach` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '附加数据',
`refund` tinyint(1) DEFAULT NULL COMMENT '1:申请退款中2:退款完成',
PRIMARY KEY (`payment_id`),
KEY `openid` (`openid`),
KEY `member_id` (`member_id`),
KEY `mpid` (`mpid`),
KEY `order_number` (`trade_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_system_auth`
--
DROP TABLE IF EXISTS `diygw_system_auth`;
CREATE TABLE IF NOT EXISTS `diygw_system_auth` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(20) NOT NULL COMMENT '权限名称',
`status` tinyint(1) unsigned DEFAULT '1' COMMENT '状态(1:禁用,2:启用)',
`sort` smallint(6) unsigned DEFAULT '0' COMMENT '排序权重',
`desc` varchar(255) DEFAULT NULL COMMENT '备注说明',
`create_by` bigint(11) unsigned DEFAULT '0' COMMENT '创建人',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `index_system_auth_title` (`title`) USING BTREE,
KEY `index_system_auth_status` (`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统权限表' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_system_auth_node`
--
DROP TABLE IF EXISTS `diygw_system_auth_node`;
CREATE TABLE IF NOT EXISTS `diygw_system_auth_node` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`auth` bigint(20) unsigned DEFAULT NULL COMMENT '角色ID',
`node` varchar(200) DEFAULT NULL COMMENT '节点路径',
PRIMARY KEY (`id`),
KEY `index_system_auth_auth` (`auth`) USING BTREE,
KEY `index_system_auth_node` (`node`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统角色与节点绑定' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_system_config`
--
DROP TABLE IF EXISTS `diygw_system_config`;
CREATE TABLE IF NOT EXISTS `diygw_system_config` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) DEFAULT NULL COMMENT '配置编码',
`value` varchar(500) DEFAULT NULL COMMENT '配置值',
PRIMARY KEY (`id`),
KEY `index_system_config_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统参数配置' AUTO_INCREMENT=44 ;
--
-- 转存表中的数据 `diygw_system_config`
--
INSERT INTO `diygw_system_config` (`id`, `name`, `value`) VALUES
(1, 'app_name', 'DIYGW.COM'),
(2, 'site_name', 'DIY官网'),
(3, 'app_version', 'V1.0'),
(4, 'site_copy', '©版权所有 2014-2018 DIY官网'),
(5, 'browser_icon', 'http://wx.diygw.com/static/upload/95d51ddab6601a89/51905192984e48cb.ico'),
(6, 'tongji_baidu_key', ''),
(7, 'miitbeian', '粤ICP备12026349号'),
(8, 'storage_type', 'local'),
(9, 'storage_local_exts', 'png,jpg,rar,doc,icon,mp4,ico'),
(10, 'storage_qiniu_bucket', ''),
(11, 'storage_qiniu_domain', ''),
(12, 'storage_qiniu_access_key', ''),
(13, 'storage_qiniu_secret_key', ''),
(14, 'storage_oss_bucket', 'cuci'),
(15, 'storage_oss_endpoint', 'oss-cn-beijing.aliyuncs.com'),
(16, 'storage_oss_domain', 'cuci.oss-cn-beijing.aliyuncs.com'),
(17, 'storage_oss_keyid', '用你自己的吧'),
(18, 'storage_oss_secret', '用你自己的吧'),
(34, 'wechat_appid', 'wx60a43dd8161666d4'),
(35, 'wechat_appkey', '9890a0d7c91801a609d151099e95b61a'),
(36, 'storage_oss_is_https', 'http'),
(37, 'wechat_type', 'thr'),
(38, 'wechat_token', 'test'),
(39, 'wechat_appsecret', 'a041bec98ed015d52b99acea5c6a16ef'),
(40, 'wechat_encodingaeskey', 'BJIUzE0gqlWy0GxfPp4J1oPTBmOrNDIGPNav1YFH5Z5'),
(41, 'wechat_thr_appid', 'wx60a43dd8161666d4'),
(42, 'wechat_thr_appkey', '05db2aa335382c66ab56d69b1a9ad0ee'),
(43, 'wechat_default', '1');
-- --------------------------------------------------------
--
-- 表的结构 `diygw_system_log`
--
DROP TABLE IF EXISTS `diygw_system_log`;
CREATE TABLE IF NOT EXISTS `diygw_system_log` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`ip` char(15) NOT NULL DEFAULT '' COMMENT '操作者IP地址',
`node` char(200) NOT NULL DEFAULT '' COMMENT '当前操作节点',
`username` varchar(32) NOT NULL DEFAULT '' COMMENT '操作人用户名',
`action` varchar(200) NOT NULL DEFAULT '' COMMENT '操作行为',
`content` text NOT NULL COMMENT '操作内容描述',
`create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统操作日志表' AUTO_INCREMENT=87 ;
--
-- 转存表中的数据 `diygw_system_log`
--
INSERT INTO `diygw_system_log` (`id`, `ip`, `node`, `username`, `action`, `content`, `create_at`) VALUES
(1, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-11-26 02:23:00'),
(2, '127.0.0.1', 'admin/config/index', 'admin', '系统管理', '系统参数配置成功', '2018-11-26 08:49:14'),
(3, '127.0.0.1', 'admin/config/index', 'admin', '系统管理', '系统参数配置成功', '2018-11-26 08:49:28'),
(4, '127.0.0.1', 'admin/config/index', 'admin', '系统管理', '系统参数配置成功', '2018-11-26 08:50:54'),
(5, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-11-26 13:30:18'),
(6, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-11-27 01:59:11'),
(7, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-11-27 07:30:54'),
(8, '127.0.0.1', 'admin/login/out', 'admin', '系统管理', '用户退出系统成功', '2018-11-27 07:35:33'),
(9, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-11-27 08:23:24'),
(10, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-11-27 11:47:39'),
(11, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-11-28 01:12:07'),
(12, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-11-28 07:07:31'),
(13, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-11-30 01:16:24'),
(14, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-11-30 04:50:38'),
(15, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-11-30 07:57:59'),
(16, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-01 03:45:47'),
(17, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-02 01:43:10'),
(18, '127.0.0.1', 'admin/login/out', 'admin', '系统管理', '用户退出系统成功', '2018-12-02 01:43:18'),
(19, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-02 01:47:10'),
(20, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-02 06:34:09'),
(21, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-02 08:16:00'),
(22, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-03 02:08:30'),
(23, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-03 06:54:39'),
(24, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-03 12:07:05'),
(25, '127.0.0.1', 'admin/login/out', 'admin', '系统管理', '用户退出系统成功', '2018-12-03 12:16:59'),
(26, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-03 12:18:25'),
(27, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-03 12:35:46'),
(28, '127.0.0.1', 'admin/config/index', 'admin', '系统管理', '系统参数配置成功', '2018-12-03 13:18:47'),
(29, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-03 14:13:15'),
(30, '127.0.0.1', 'admin/config/index', 'admin', '系统管理', '系统参数配置成功', '2018-12-03 14:22:55'),
(31, '127.0.0.1', 'admin/config/index', 'admin', '系统管理', '系统参数配置成功', '2018-12-03 14:23:31'),
(32, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-04 01:03:36'),
(33, '127.0.0.1', 'admin/login/out', 'admin', '系统管理', '用户退出系统成功', '2018-12-04 01:30:50'),
(34, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-04 01:30:56'),
(35, '127.0.0.1', 'admin/login/out', 'admin', '系统管理', '用户退出系统成功', '2018-12-04 01:35:26'),
(36, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-04 01:36:02'),
(37, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-04 02:28:33'),
(38, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-04 02:31:38'),
(39, '127.0.0.1', 'admin/login/out', 'admin', '系统管理', '用户退出系统成功', '2018-12-04 02:38:43'),
(40, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-04 02:38:49'),
(41, '127.0.0.1', 'admin/login/out', 'admin', '系统管理', '用户退出系统成功', '2018-12-04 03:01:19'),
(42, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-04 03:01:26'),
(43, '127.0.0.1', 'admin/login/out', 'admin', '系统管理', '用户退出系统成功', '2018-12-04 03:01:55'),
(44, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-04 03:02:17'),
(45, '127.0.0.1', 'admin/login/out', 'admin', '系统管理', '用户退出系统成功', '2018-12-04 03:03:12'),
(46, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-04 03:03:20'),
(47, '127.0.0.1', 'admin/login/out', 'admin', '系统管理', '用户退出系统成功', '2018-12-04 03:04:16'),
(48, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-04 03:04:22'),
(49, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-04 14:36:56'),
(50, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-05 02:26:17'),
(51, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-05 12:43:20'),
(52, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-07 01:06:56'),
(53, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-07 08:18:38'),
(54, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-11 08:10:11'),
(55, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-12 05:15:33'),
(56, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-12 08:10:42'),
(57, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-12 09:27:09'),
(58, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-12 12:20:18'),
(59, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-14 12:19:32'),
(60, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-15 01:21:14'),
(61, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-15 08:42:58'),
(62, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-15 09:11:10'),
(63, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-15 14:31:29'),
(64, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-16 04:13:45'),
(65, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-16 12:41:22'),
(66, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-17 01:48:53'),
(67, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-17 03:33:55'),
(68, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-17 12:46:39'),
(69, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-18 12:41:38'),
(70, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-18 14:40:12'),
(71, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-19 01:31:08'),
(72, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-19 03:00:18'),
(73, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-19 03:43:11'),
(74, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-19 03:47:43'),
(75, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-19 13:56:25'),
(76, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-19 14:48:15'),
(77, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-20 06:34:53'),
(78, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-20 07:31:22'),
(79, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-20 12:22:34'),
(80, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2018-12-31 13:38:58'),
(81, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2019-01-02 04:05:22'),
(82, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2019-01-02 06:48:43'),
(83, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2019-01-02 08:34:21'),
(84, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2019-01-03 03:23:54'),
(85, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2019-01-03 07:00:55'),
(86, '127.0.0.1', 'admin/login/index', 'admin', '系统管理', '用户登录系统成功', '2019-01-04 02:12:49');
-- --------------------------------------------------------
--
-- 表的结构 `diygw_system_menu`
--
DROP TABLE IF EXISTS `diygw_system_menu`;
CREATE TABLE IF NOT EXISTS `diygw_system_menu` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`pid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '父id',
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '名称',
`node` varchar(200) NOT NULL DEFAULT '' COMMENT '节点代码',
`icon` varchar(100) NOT NULL DEFAULT '' COMMENT '菜单图标',
`url` varchar(400) NOT NULL DEFAULT '' COMMENT '链接',
`params` varchar(500) DEFAULT '' COMMENT '链接参数',
`target` varchar(20) NOT NULL DEFAULT '_self' COMMENT '链接打开方式',
`sort` int(11) unsigned DEFAULT '0' COMMENT '菜单排序',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态(0:禁用,1:启用)',
`create_by` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '创建人',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `index_system_menu_node` (`node`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统菜单表' AUTO_INCREMENT=56 ;
--
-- 转存表中的数据 `diygw_system_menu`
--
INSERT INTO `diygw_system_menu` (`id`, `pid`, `title`, `node`, `icon`, `url`, `params`, `target`, `sort`, `status`, `create_by`, `create_at`) VALUES
(1, 0, '系统设置', '', '', '#', '', '_self', 9000, 1, 10000, '2018-01-19 07:27:00'),
(2, 10, '后台菜单', '', 'fa fa-leaf', 'admin/menu/index', '', '_self', 10, 1, 10000, '2018-01-19 07:27:17'),
(3, 10, '系统参数', '', 'fa fa-modx', 'admin/config/index', '', '_self', 20, 1, 10000, '2018-01-19 07:27:57'),
(4, 11, '访问授权', '', 'fa fa-group', 'admin/auth/index', '', '_self', 20, 1, 10000, '2018-01-22 03:13:02'),
(5, 11, '用户管理', '', 'fa fa-user', 'admin/user/index', '', '_self', 10, 1, 0, '2018-01-23 04:15:12'),
(6, 11, '访问节点', '', 'fa fa-fort-awesome', 'admin/node/index', '', '_self', 30, 1, 0, '2018-01-23 04:36:54'),
(7, 0, '后台首页', '', '', '#', '', '_self', 0, 1, 0, '2018-01-23 05:42:30'),
(8, 16, '系统日志', '', 'fa fa-code', 'admin/log/index', '', '_self', 10, 1, 0, '2018-01-24 05:52:58'),
(9, 10, '文件存储', '', 'fa fa-stop-circle', 'admin/config/file', '', '_self', 30, 1, 0, '2018-01-25 02:54:28'),
(10, 1, '系统管理', '', '', '#', '', '_self', 200, 1, 0, '2018-01-25 10:14:28'),
(11, 1, '访问权限', '', '', '#', '', '_self', 300, 1, 0, '2018-01-25 10:15:08'),
(16, 1, '日志管理', '', '', '#', '', '_self', 400, 1, 0, '2018-02-10 08:31:15'),
(17, 0, '微信管理', '', '', '#', '', '_self', 8000, 1, 0, '2018-03-06 06:42:49'),
(18, 17, '公众号配置', '', '', '#', '', '_self', 0, 1, 0, '2018-03-06 06:43:05'),
(19, 18, '支付配置', '', 'fa fa-cog', 'wechat/config/index', '', '_self', 4, 1, 0, '2018-03-06 06:43:26'),
(20, 18, '关注默认回复', '', 'fa fa-comment-o', 'wechat/keys/subscribe', '', '_self', 0, 1, 0, '2018-03-06 06:44:45'),
(21, 18, '无反馈默认回复', '', 'fa fa-commenting', 'wechat/keys/defaults', '', '_self', 0, 1, 0, '2018-03-06 06:45:55'),
(22, 18, '微信关键字管理', '', 'fa fa-hashtag', 'wechat/keys/index', '', '_self', 0, 1, 0, '2018-03-06 06:46:23'),
(23, 17, '微信服务定制', '', '', '#', '', '_self', 0, 1, 0, '2018-03-06 06:47:11'),
(24, 23, '微信菜单管理', '', 'fa fa-gg-circle', 'wechat/menu/index', '', '_self', 0, 1, 0, '2018-03-06 06:47:39'),
(25, 23, '微信图文管理', '', 'fa fa-map-o', 'wechat/news/index', '', '_self', 0, 1, 0, '2018-03-06 06:48:14'),
(26, 17, '微信粉丝管理', '', '', '#', '', '_self', 0, 1, 0, '2018-03-06 06:48:33'),
(27, 26, '微信粉丝列表', '', 'fa fa-users', 'wechat/fans/index', '', '_self', 20, 1, 0, '2018-03-06 06:49:04'),
(28, 26, '微信黑名单管理', '', 'fa fa-user-times', 'wechat/fans_block/index', '', '_self', 30, 1, 0, '2018-03-06 06:49:22'),
(29, 26, '微信标签管理', '', 'fa fa-tags', 'wechat/tags/index', '', '_self', 10, 1, 0, '2018-03-06 06:49:39'),
(43, 1, '微信平台', '', '', '#', '', '_self', 0, 1, 0, '2018-11-26 02:24:29'),
(44, 43, '公众号管理', '', 'layui-icon layui-icon-login-wechat', 'admin/wechat/index', '', '_self', 0, 1, 0, '2018-11-26 02:25:37'),
(45, 49, '插件管理', '', 'fa fa-plug', 'admin/addons/index', '', '_self', 0, 1, 0, '2018-11-27 08:50:20'),
(47, 7, '快键菜单', '', '', '#', '', '_self', 0, 1, 0, '2018-12-04 01:05:50'),
(48, 47, '后台首页', '', '', 'admin/index/index', '', '_self', 0, 1, 0, '2018-12-04 01:06:29'),
(49, 1, '系统扩展', '', '', '#', '', '_self', 0, 1, 0, '2018-12-04 07:20:26'),
(50, 49, '钩子管理', '', 'layui-icon layui-icon-ok', 'admin/hooks/index', '', '_self', 0, 1, 0, '2018-12-04 07:23:00'),
(51, 0, '应用管理', '', '', '#', '', '_self', 1001, 1, 0, '2018-12-04 14:38:32'),
(52, 51, '应用管理', '', '', '#', '', '_self', 0, 1, 0, '2018-12-04 14:38:57'),
(53, 52, '应用管理', '', 'layui-icon layui-icon-app', 'diygw/dashboard/index', '', '_self', 0, 1, 0, '2018-12-04 14:40:15'),
(54, 52, '云服务授权', '', 'fa fa-key', 'diygw/dashboard/auth', '', '_self', 0, 1, 0, '2018-12-04 14:42:15'),
(55, 18, '小程序配置', '', 'fa fa-wechat', 'wechat/config/xcx', '', '_self', 0, 1, 0, '2019-01-02 07:08:56');
-- --------------------------------------------------------
--
-- 表的结构 `diygw_system_node`
--
DROP TABLE IF EXISTS `diygw_system_node`;
CREATE TABLE IF NOT EXISTS `diygw_system_node` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`node` varchar(100) DEFAULT NULL COMMENT '节点代码',
`title` varchar(500) DEFAULT NULL COMMENT '节点标题',
`is_menu` tinyint(1) unsigned DEFAULT '0' COMMENT '是否可设置为菜单',
`is_auth` tinyint(1) unsigned DEFAULT '1' COMMENT '是否启动RBAC权限控制',
`is_login` tinyint(1) unsigned DEFAULT '1' COMMENT '是否启动登录控制',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `index_system_node_node` (`node`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统节点表' AUTO_INCREMENT=146 ;
--
-- 转存表中的数据 `diygw_system_node`
--
INSERT INTO `diygw_system_node` (`id`, `node`, `title`, `is_menu`, `is_auth`, `is_login`, `create_at`) VALUES
(13, 'admin', '系统设置', 0, 1, 1, '2018-05-04 03:02:34'),
(14, 'admin/auth', '权限管理', 0, 1, 1, '2018-05-04 03:06:55'),
(15, 'admin/auth/index', '权限列表', 1, 1, 1, '2018-05-04 03:06:56'),
(16, 'admin/auth/apply', '权限配置', 0, 1, 1, '2018-05-04 03:06:56'),
(17, 'admin/auth/add', '添加权限', 0, 1, 1, '2018-05-04 03:06:56'),
(18, 'admin/auth/edit', '编辑权限', 0, 1, 1, '2018-05-04 03:06:56'),
(19, 'admin/auth/forbid', '禁用权限', 0, 1, 1, '2018-05-04 03:06:56'),
(20, 'admin/auth/resume', '启用权限', 0, 1, 1, '2018-05-04 03:06:56'),
(21, 'admin/auth/del', '删除权限', 0, 1, 1, '2018-05-04 03:06:56'),
(22, 'admin/config', '系统配置', 0, 1, 1, '2018-05-04 03:08:18'),
(23, 'admin/config/index', '系统参数', 1, 1, 1, '2018-05-04 03:08:25'),
(24, 'admin/config/file', '文件存储', 1, 1, 1, '2018-05-04 03:08:27'),
(25, 'admin/log', '日志管理', 0, 1, 1, '2018-05-04 03:08:43'),
(26, 'admin/log/index', '日志管理', 1, 1, 1, '2018-05-04 03:08:43'),
(28, 'admin/log/del', '日志删除', 0, 1, 1, '2018-05-04 03:08:43'),
(29, 'admin/menu', '系统菜单', 0, 1, 1, '2018-05-04 03:09:54'),
(30, 'admin/menu/index', '菜单列表', 1, 1, 1, '2018-05-04 03:09:54'),
(31, 'admin/menu/add', '添加菜单', 0, 1, 1, '2018-05-04 03:09:55'),
(32, 'admin/menu/edit', '编辑菜单', 0, 1, 1, '2018-05-04 03:09:55'),
(33, 'admin/menu/del', '删除菜单', 0, 1, 1, '2018-05-04 03:09:55'),
(34, 'admin/menu/forbid', '禁用菜单', 0, 1, 1, '2018-05-04 03:09:55'),
(35, 'admin/menu/resume', '启用菜单', 0, 1, 1, '2018-05-04 03:09:55'),
(36, 'admin/node', '节点管理', 0, 1, 1, '2018-05-04 03:10:20'),
(37, 'admin/node/index', '节点列表', 1, 1, 1, '2018-05-04 03:10:20'),
(38, 'admin/node/clear', '清理节点', 0, 1, 1, '2018-05-04 03:10:21'),
(39, 'admin/node/save', '更新节点', 0, 1, 1, '2018-05-04 03:10:21'),
(40, 'admin/user', '系统用户', 0, 1, 1, '2018-05-04 03:10:43'),
(41, 'admin/user/index', '用户列表', 1, 1, 1, '2018-05-04 03:10:43'),
(42, 'admin/user/auth', '用户授权', 0, 1, 1, '2018-05-04 03:10:43'),
(43, 'admin/user/add', '添加用户', 0, 1, 1, '2018-05-04 03:10:43'),
(44, 'admin/user/edit', '编辑用户', 0, 1, 1, '2018-05-04 03:10:43'),
(45, 'admin/user/pass', '修改密码', 0, 1, 1, '2018-05-04 03:10:43'),
(46, 'admin/user/del', '删除用户', 0, 1, 1, '2018-05-04 03:10:43'),
(47, 'admin/user/forbid', '禁用启用', 0, 1, 1, '2018-05-04 03:10:43'),
(48, 'admin/user/resume', '启用用户', 0, 1, 1, '2018-05-04 03:10:44'),
(49, 'store', '商城管理', 0, 1, 1, '2018-05-04 03:11:28'),
(50, 'store/express', '快递公司管理', 0, 1, 1, '2018-05-04 03:11:39'),
(51, 'store/express/index', '快递公司列表', 1, 1, 1, '2018-05-04 03:11:39'),
(52, 'store/express/add', '添加快递公司', 0, 1, 1, '2018-05-04 03:11:39'),
(53, 'store/express/edit', '编辑快递公司', 0, 1, 1, '2018-05-04 03:11:39'),
(54, 'store/express/del', '删除快递公司', 0, 1, 1, '2018-05-04 03:11:39'),
(55, 'store/express/forbid', '禁用快递公司', 0, 1, 1, '2018-05-04 03:11:39'),
(56, 'store/express/resume', '启用快递公司', 0, 1, 1, '2018-05-04 03:11:40'),
(57, 'store/order', '订单管理', 0, 1, 1, '2018-05-04 03:12:14'),
(58, 'store/order/index', '订单列表', 1, 1, 1, '2018-05-04 03:12:17'),
(59, 'store/order/address', '修改地址', 0, 1, 1, '2018-05-04 03:12:19'),
(76, 'wechat', '微信管理', 0, 1, 1, '2018-05-04 03:14:59'),
(78, 'wechat/config', '微信对接管理', 0, 1, 1, '2018-05-04 03:16:20'),
(79, 'wechat/config/index', '微信对接配置', 1, 1, 1, '2018-05-04 03:16:23'),
(80, 'wechat/fans', '微信粉丝管理', 0, 1, 1, '2018-05-04 03:16:31'),
(81, 'wechat/fans/index', '微信粉丝列表', 1, 1, 1, '2018-05-04 03:16:32'),
(82, 'wechat/fans/backadd', '微信粉丝拉黑', 0, 1, 1, '2018-05-04 03:16:32'),
(83, 'wechat/fans/tagset', '设置粉丝标签', 0, 1, 1, '2018-05-04 03:16:32'),
(84, 'wechat/fans/tagadd', '添加粉丝标签', 0, 1, 1, '2018-05-04 03:16:32'),
(85, 'wechat/fans/tagdel', '删除粉丝标签', 0, 1, 1, '2018-05-04 03:16:32'),
(86, 'wechat/fans/sync', '同步粉丝列表', 0, 1, 1, '2018-05-04 03:16:32'),
(87, 'wechat/fans_block', '粉丝黑名单管理', 0, 1, 1, '2018-05-04 03:17:25'),
(88, 'wechat/fans_block/index', '粉丝黑名单列表', 1, 1, 1, '2018-05-04 03:17:50'),
(89, 'wechat/fans_block/backdel', '移除粉丝黑名单', 0, 1, 1, '2018-05-04 03:17:51'),
(90, 'wechat/keys', '微信关键字', 0, 1, 1, '2018-05-04 03:18:09'),
(91, 'wechat/keys/index', '关键字列表', 1, 1, 1, '2018-05-04 03:18:09'),
(92, 'wechat/keys/add', '添加关键字', 0, 1, 1, '2018-05-04 03:18:09'),
(93, 'wechat/keys/edit', '编辑关键字', 0, 1, 1, '2018-05-04 03:18:09'),
(94, 'wechat/keys/del', '删除关键字', 0, 1, 1, '2018-05-04 03:18:09'),
(95, 'wechat/keys/forbid', '禁用关键字', 0, 1, 1, '2018-05-04 03:18:09'),
(96, 'wechat/keys/resume', '启用关键字', 0, 1, 1, '2018-05-04 03:18:09'),
(97, 'wechat/keys/subscribe', '关注回复', 1, 1, 1, '2018-05-04 03:18:09'),
(98, 'wechat/keys/defaults', '默认回复', 1, 1, 1, '2018-05-04 03:18:09'),
(99, 'wechat/menu', '微信菜单管理', 0, 1, 1, '2018-05-04 03:18:57'),
(100, 'wechat/menu/index', '微信菜单展示', 1, 1, 1, '2018-05-04 03:19:10'),
(101, 'wechat/menu/edit', '编辑微信菜单', 0, 1, 1, '2018-05-04 03:19:22'),
(102, 'wechat/menu/cancel', '取消微信菜单', 0, 1, 1, '2018-05-04 03:19:26'),
(103, 'wechat/news/index', '微信图文列表', 1, 1, 1, '2018-05-04 03:19:28'),
(104, 'wechat/news/select', '微信图文选择', 0, 1, 1, '2018-05-04 03:19:28'),
(105, 'wechat/news/image', '微信图片选择', 0, 1, 1, '2018-05-04 03:19:28'),
(106, 'wechat/news/add', '添加微信图文', 0, 1, 1, '2018-05-04 03:19:28'),
(107, 'wechat/news/edit', '编辑微信图文', 0, 1, 1, '2018-05-04 03:19:28'),
(108, 'wechat/news/del', '删除微信图文', 0, 1, 1, '2018-05-04 03:19:28'),
(109, 'wechat/news/push', '推送微信图文', 0, 1, 1, '2018-05-04 03:19:28'),
(110, 'wechat/news', '微信图文管理', 0, 1, 1, '2018-05-04 03:19:35'),
(111, 'wechat/tags', '微信粉丝标签管理', 0, 1, 1, '2018-05-04 03:20:28'),
(112, 'wechat/tags/index', '粉丝标签列表', 1, 1, 1, '2018-05-04 03:20:28'),
(113, 'wechat/tags/add', '添加粉丝标签', 0, 1, 1, '2018-05-04 03:20:28'),
(114, 'wechat/tags/edit', '编辑粉丝标签', 0, 1, 1, '2018-05-04 03:20:29'),
(115, 'wechat/tags/del', '删除粉丝标签', 0, 1, 1, '2018-05-04 03:20:29'),
(116, 'wechat/tags/sync', '同步粉丝标签', 0, 1, 1, '2018-05-04 03:20:29'),
(117, 'store/goods', '商品管理', 0, 1, 1, '2018-05-04 03:29:55'),
(118, 'store/goods/index', '商品列表', 1, 1, 1, '2018-05-04 03:29:56'),
(119, 'store/goods/add', '添加商品', 0, 1, 1, '2018-05-04 03:29:56'),
(120, 'store/goods/edit', '编辑商品', 0, 1, 1, '2018-05-04 03:29:56'),
(121, 'store/goods/del', '删除商品', 0, 1, 1, '2018-05-04 03:29:56'),
(122, 'store/goods/forbid', '下架商品', 0, 1, 1, '2018-05-04 03:29:56'),
(123, 'store/goods/resume', '上架商品', 0, 1, 1, '2018-05-04 03:29:57'),
(124, 'store/goods_brand', '商品品牌管理', 0, 1, 1, '2018-05-04 03:30:44'),
(125, 'store/goods_brand/index', '商品品牌列表', 1, 1, 1, '2018-05-04 03:30:52'),
(126, 'store/goods_brand/add', '添加商品品牌', 0, 1, 1, '2018-05-04 03:30:55'),
(127, 'store/goods_brand/edit', '编辑商品品牌', 0, 1, 1, '2018-05-04 03:30:56'),
(128, 'store/goods_brand/del', '删除商品品牌', 0, 1, 1, '2018-05-04 03:30:56'),
(129, 'store/goods_brand/forbid', '禁用商品品牌', 0, 1, 1, '2018-05-04 03:30:56'),
(130, 'store/goods_brand/resume', '启用商品品牌', 0, 1, 1, '2018-05-04 03:30:56'),
(131, 'store/goods_cate', '商品分类管理', 0, 1, 1, '2018-05-04 03:31:19'),
(132, 'store/goods_cate/index', '商品分类列表', 1, 1, 1, '2018-05-04 03:31:23'),
(133, 'store/goods_cate/add', '添加商品分类', 0, 1, 1, '2018-05-04 03:31:23'),
(134, 'store/goods_cate/edit', '编辑商品分类', 0, 1, 1, '2018-05-04 03:31:23'),
(135, 'store/goods_cate/del', '删除商品分类', 0, 1, 1, '2018-05-04 03:31:24'),
(136, 'store/goods_cate/forbid', '禁用商品分类', 0, 1, 1, '2018-05-04 03:31:24'),
(137, 'store/goods_cate/resume', '启用商品分类', 0, 1, 1, '2018-05-04 03:31:24'),
(138, 'store/goods_spec', '商品规格管理', 0, 1, 1, '2018-05-04 03:31:47'),
(139, 'store/goods_spec/index', '商品规格列表', 1, 1, 1, '2018-05-04 03:31:47'),
(140, 'store/goods_spec/add', '添加商品规格', 0, 1, 1, '2018-05-04 03:31:47'),
(141, 'store/goods_spec/edit', '编辑商品规格', 0, 1, 1, '2018-05-04 03:31:48'),
(142, 'store/goods_spec/del', '删除商品规格', 0, 1, 1, '2018-05-04 03:31:48'),
(143, 'store/goods_spec/forbid', '禁用商品规格', 0, 1, 1, '2018-05-04 03:31:48'),
(144, 'store/goods_spec/resume', '启用商品规格', 0, 1, 1, '2018-05-04 03:31:48'),
(145, 'diygw', '应用管理', 0, 1, 1, '2018-12-19 15:05:26');
-- --------------------------------------------------------
--
-- 表的结构 `diygw_system_sequence`
--
DROP TABLE IF EXISTS `diygw_system_sequence`;
CREATE TABLE IF NOT EXISTS `diygw_system_sequence` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) DEFAULT NULL COMMENT '序号类型',
`sequence` char(50) NOT NULL COMMENT '序号值',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `index_system_sequence_unique` (`type`,`sequence`) USING BTREE,
KEY `index_system_sequence_type` (`type`),
KEY `index_system_sequence_number` (`sequence`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统序号表' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_system_user`
--
DROP TABLE IF EXISTS `diygw_system_user`;
CREATE TABLE IF NOT EXISTS `diygw_system_user` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL DEFAULT '' COMMENT '用户登录名',
`password` char(32) NOT NULL DEFAULT '' COMMENT '用户登录密码',
`qq` varchar(16) DEFAULT NULL COMMENT '联系QQ',
`mail` varchar(32) DEFAULT NULL COMMENT '联系邮箱',
`phone` varchar(16) DEFAULT NULL COMMENT '联系手机号',
`desc` varchar(255) DEFAULT '' COMMENT '备注说明',
`login_num` bigint(20) unsigned DEFAULT '0' COMMENT '登录次数',
`login_at` datetime DEFAULT NULL,
`status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态(0:禁用,1:启用)',
`authorize` varchar(255) DEFAULT NULL,
`is_deleted` tinyint(1) unsigned DEFAULT '0' COMMENT '删除状态(1:删除,0:未删)',
`create_by` bigint(20) unsigned DEFAULT NULL COMMENT '创建人',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `index_system_user_username` (`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统用户表' AUTO_INCREMENT=2 ;
--
-- 转存表中的数据 `diygw_system_user`
--
INSERT INTO `diygw_system_user` (`id`, `username`, `password`, `qq`, `mail`, `phone`, `desc`, `login_num`, `login_at`, `status`, `authorize`, `is_deleted`, `create_by`, `create_at`) VALUES
(1, 'admin', '21232f297a57a5a743894a0e4a801fc3', '280160522', 'diygwcom@foxmail.com', '', '', 23043, '2019-01-04 10:12:49', 1, '2,4', 0, NULL, '2015-11-13 07:14:22');
-- --------------------------------------------------------
--
-- 表的结构 `diygw_wechat`
--
DROP TABLE IF EXISTS `diygw_wechat`;
CREATE TABLE IF NOT EXISTS `diygw_wechat` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`user_id` int(10) NOT NULL COMMENT '用户ID',
`name` varchar(50) NOT NULL COMMENT '公众号名称',
`appid` varchar(50) DEFAULT NULL COMMENT 'AppId',
`appsecret` varchar(50) DEFAULT NULL COMMENT 'AppSecret',
`origin_id` varchar(50) NOT NULL COMMENT '公众号原始ID',
`type` int(1) NOT NULL DEFAULT '0' COMMENT '公众号类型(1:普通订阅号;2:认证订阅号;3:普通服务号;4:认证服务号',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(0:禁用,1:正常,2:审核中)',
`autologin` tinyint(1) DEFAULT '1' COMMENT '1:自动登录并注册用户 0表示手动注册用户 ',
`valid_token` varchar(40) DEFAULT NULL COMMENT '接口验证Token',
`valid_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1已接入;0未接入',
`token` varchar(50) DEFAULT NULL COMMENT '公众号标识',
`encodingaeskey` varchar(50) DEFAULT NULL COMMENT '消息加解密秘钥',
`mp_number` varchar(50) DEFAULT NULL COMMENT '微信号',
`desc` text COMMENT '描述',
`logo` varchar(255) DEFAULT NULL COMMENT 'logo',
`qrcode` varchar(255) DEFAULT NULL COMMENT '二维码',
`create_time` int(10) NOT NULL COMMENT '创建时间',
`login_name` varchar(50) DEFAULT NULL COMMENT '公众号登录名',
`is_use` tinyint(1) NOT NULL DEFAULT '0' COMMENT '当前使用',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公众号表' AUTO_INCREMENT=2 ;
--
-- 转存表中的数据 `diygw_wechat`
--
INSERT INTO `diygw_wechat` (`id`, `user_id`, `name`, `appid`, `appsecret`, `origin_id`, `type`, `status`, `autologin`, `valid_token`, `valid_status`, `token`, `encodingaeskey`, `mp_number`, `desc`, `logo`, `qrcode`, `create_time`, `login_name`, `is_use`) VALUES
(1, 1, '测试公众号', '1', '1', '1', 1, 1, 0, 'hv5Ri9lkNrUXdNRZEHuFU1ejDpQUlrFG', 0, 'coZZbWvWyMbdiv4rqLGwQVkkvo8eUJ5L', 'lEGVThSs1vxwlVmftbinFhvLevTzaGgh4o5gZKUI2uB', '1', '1', '', '', 1543221891, NULL, 0);
-- --------------------------------------------------------
--
-- 表的结构 `diygw_wechat_config`
--
DROP TABLE IF EXISTS `diygw_wechat_config`;
CREATE TABLE IF NOT EXISTS `diygw_wechat_config` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`mpid` int(11) NOT NULL COMMENT '公众号标识',
`name` varchar(180) NOT NULL COMMENT '配置项名称',
`value` text NOT NULL COMMENT '配置值',
`cate` varchar(30) DEFAULT NULL COMMENT '分类',
`dashboard_id` int(11) NULL DEFAULT NULL ,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_wechat_fans`
--
DROP TABLE IF EXISTS `diygw_wechat_fans`;
CREATE TABLE IF NOT EXISTS `diygw_wechat_fans` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`mpid` int(10) NOT NULL DEFAULT '1' COMMENT '公众号ID',
`appid` char(50) DEFAULT '' COMMENT '公众号Appid',
`unionid` char(100) DEFAULT '' COMMENT 'unionid',
`openid` char(100) DEFAULT '' COMMENT '用户的标识,对当前公众号唯一',
`spread_openid` char(100) DEFAULT '' COMMENT '推荐人OPENID',
`spread_at` datetime DEFAULT NULL COMMENT '推荐时间',
`tagid_list` varchar(100) DEFAULT '' COMMENT '标签id',
`is_black` tinyint(1) unsigned DEFAULT '0' COMMENT '是否为黑名单用户',
`subscribe` tinyint(1) unsigned DEFAULT '0' COMMENT '用户是否关注该公众号(0:未关注, 1:已关注)',
`nickname` varchar(200) DEFAULT '' COMMENT '用户的昵称',
`sex` tinyint(1) unsigned DEFAULT NULL COMMENT '用户的性别,值为1时是男性,值为2时是女性,值为0时是未知',
`country` varchar(50) DEFAULT '' COMMENT '用户所在国家',
`province` varchar(50) DEFAULT '' COMMENT '用户所在省份',
`city` varchar(50) DEFAULT '' COMMENT '用户所在城市',
`language` varchar(50) DEFAULT '' COMMENT '用户的语言,简体中文为zh_CN',
`headimgurl` varchar(500) DEFAULT '' COMMENT '用户头像',
`subscribe_time` bigint(20) unsigned DEFAULT '0' COMMENT '用户关注时间',
`subscribe_at` datetime DEFAULT NULL COMMENT '关注时间',
`remark` varchar(50) DEFAULT '' COMMENT '备注',
`expires_in` bigint(20) unsigned DEFAULT '0' COMMENT '有效时间',
`refresh_token` varchar(200) DEFAULT '' COMMENT '刷新token',
`access_token` varchar(200) DEFAULT '' COMMENT '访问token',
`subscribe_scene` varchar(200) DEFAULT '' COMMENT '扫码关注场景',
`qr_scene` varchar(100) DEFAULT '' COMMENT '二维码场景值',
`qr_scene_str` varchar(200) DEFAULT '' COMMENT '二维码场景内容',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `index_wechat_fans_spread_openid` (`spread_openid`) USING BTREE,
KEY `index_wechat_fans_openid` (`openid`) USING BTREE,
KEY `index_wechat_fans_unionid` (`unionid`),
KEY `index_wechat_fans_is_back` (`is_black`),
KEY `index_wechat_fans_subscribe` (`subscribe`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信粉丝' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_wechat_fans_tags`
--
DROP TABLE IF EXISTS `diygw_wechat_fans_tags`;
CREATE TABLE IF NOT EXISTS `diygw_wechat_fans_tags` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '标签ID',
`mpid` int(11) DEFAULT '1' COMMENT '公众号ID',
`appid` char(50) DEFAULT NULL COMMENT '公众号APPID',
`name` varchar(35) DEFAULT NULL COMMENT '标签名称',
`count` int(11) unsigned DEFAULT NULL COMMENT '总数',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
KEY `index_wechat_fans_tags_id` (`id`) USING BTREE,
KEY `index_wechat_fans_tags_appid` (`appid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信会员标签' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_wechat_keys`
--
DROP TABLE IF EXISTS `diygw_wechat_keys`;
CREATE TABLE IF NOT EXISTS `diygw_wechat_keys` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`mpid` int(10) NOT NULL DEFAULT '1' COMMENT '公众号ID',
`appid` char(100) DEFAULT '' COMMENT '公众号APPID',
`type` varchar(20) DEFAULT '' COMMENT '类型,text 文件消息,image 图片消息,news 图文消息',
`keys` varchar(100) DEFAULT NULL COMMENT '关键字',
`content` text COMMENT '文本内容',
`image_url` varchar(255) DEFAULT '' COMMENT '图片链接',
`voice_url` varchar(255) DEFAULT '' COMMENT '语音链接',
`music_title` varchar(100) DEFAULT '' COMMENT '音乐标题',
`music_url` varchar(255) DEFAULT '' COMMENT '音乐链接',
`music_image` varchar(255) DEFAULT '' COMMENT '音乐缩略图链接',
`music_desc` varchar(255) DEFAULT '' COMMENT '音乐描述',
`video_title` varchar(100) DEFAULT '' COMMENT '视频标题',
`video_url` varchar(255) DEFAULT '' COMMENT '视频URL',
`video_desc` varchar(255) DEFAULT '' COMMENT '视频描述',
`news_id` bigint(20) unsigned DEFAULT NULL COMMENT '图文ID',
`sort` bigint(20) unsigned DEFAULT '0' COMMENT '排序字段',
`status` tinyint(1) unsigned DEFAULT '1' COMMENT '0 禁用,1 启用',
`create_by` bigint(20) unsigned DEFAULT NULL COMMENT '创建人',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `index_wechat_keys_appid` (`appid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信关键字' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_wechat_menu`
--
DROP TABLE IF EXISTS `diygw_wechat_menu`;
CREATE TABLE IF NOT EXISTS `diygw_wechat_menu` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`mpid` int(10) NOT NULL DEFAULT '1' COMMENT '公众号ID',
`index` bigint(20) DEFAULT NULL,
`pindex` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '父id',
`type` varchar(24) NOT NULL DEFAULT '' COMMENT '菜单类型 null主菜单 link链接 keys关键字',
`name` varchar(256) NOT NULL DEFAULT '' COMMENT '菜单名称',
`content` text NOT NULL COMMENT '文字内容',
`sort` bigint(20) unsigned DEFAULT '0' COMMENT '排序',
`status` tinyint(1) unsigned DEFAULT '1' COMMENT '状态(0禁用1启用)',
`create_by` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '创建人',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `index_wechat_menu_pindex` (`pindex`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信菜单配置' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_wechat_news`
--
DROP TABLE IF EXISTS `diygw_wechat_news`;
CREATE TABLE IF NOT EXISTS `diygw_wechat_news` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`mpid` int(10) NOT NULL DEFAULT '1' COMMENT '公众号ID',
`media_id` varchar(100) DEFAULT '' COMMENT '永久素材MediaID',
`local_url` varchar(300) DEFAULT '' COMMENT '永久素材显示URL',
`article_id` varchar(60) DEFAULT '' COMMENT '关联图文ID,用,号做分割',
`is_deleted` tinyint(1) unsigned DEFAULT '0' COMMENT '是否删除',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`create_by` bigint(20) DEFAULT NULL COMMENT '创建人',
PRIMARY KEY (`id`),
KEY `index_wechat_news_artcle_id` (`article_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信图文表' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_wechat_news_article`
--
DROP TABLE IF EXISTS `diygw_wechat_news_article`;
CREATE TABLE IF NOT EXISTS `diygw_wechat_news_article` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`mpid` int(10) NOT NULL DEFAULT '1' COMMENT '公众号ID',
`title` varchar(50) DEFAULT '' COMMENT '素材标题',
`local_url` varchar(300) DEFAULT '' COMMENT '永久素材显示URL',
`show_cover_pic` tinyint(4) unsigned DEFAULT '0' COMMENT '是否显示封面 0不显示,1 显示',
`author` varchar(20) DEFAULT '' COMMENT '作者',
`digest` varchar(300) DEFAULT '' COMMENT '摘要内容',
`content` longtext COMMENT '图文内容',
`content_source_url` varchar(200) DEFAULT '' COMMENT '图文消息原文地址',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`create_by` bigint(20) DEFAULT NULL COMMENT '创建人',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信素材表' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_wechat_news_image`
--
DROP TABLE IF EXISTS `diygw_wechat_news_image`;
CREATE TABLE IF NOT EXISTS `diygw_wechat_news_image` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`mpid` int(10) NOT NULL DEFAULT '1' COMMENT '公众号ID',
`md5` varchar(32) DEFAULT '' COMMENT '文件md5',
`local_url` varchar(300) DEFAULT '' COMMENT '本地文件链接',
`media_url` varchar(300) DEFAULT '' COMMENT '远程图片链接',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `index_wechat_news_image_md5` (`md5`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信服务器图片' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `diygw_wechat_news_media`
--
DROP TABLE IF EXISTS `diygw_wechat_news_media`;
CREATE TABLE IF NOT EXISTS `diygw_wechat_news_media` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`mpid` int(10) NOT NULL DEFAULT '1' COMMENT '公众号ID',
`appid` varchar(100) DEFAULT '' COMMENT '公众号ID',
`md5` varchar(32) DEFAULT '' COMMENT '文件md5',
`type` varchar(20) DEFAULT '' COMMENT '媒体类型',
`media_id` varchar(100) DEFAULT '' COMMENT '永久素材MediaID',
`local_url` varchar(300) DEFAULT '' COMMENT '本地文件链接',
`media_url` varchar(300) DEFAULT '' COMMENT '远程图片链接',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信素材表' AUTO_INCREMENT=1 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | the_stack |
-- 2017-07-19T14:34:22.897
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES ('W',0,540895,0,540026,TO_TIMESTAMP('2017-07-19 14:34:22','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.letters','540026 (Todo: Set Internal Name for UI testing)','Y','N','N','N','N','Textvariablen',TO_TIMESTAMP('2017-07-19 14:34:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T14:34:22.907
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=540895 AND NOT EXISTS (SELECT 1 FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 2017-07-19T14:34:22.915
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 540895, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=540895)
;
-- 2017-07-19T14:34:23.503
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=265 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.505
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=104 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.506
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=105 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.506
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=384 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.507
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=111 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.507
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=106 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.508
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=117 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.508
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540675 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.508
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=418 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.509
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=102 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.510
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=103 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.511
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=270 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.512
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=121 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.512
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=476 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.512
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=540715 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.513
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=409 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.514
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=151 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.514
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=53087 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.515
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=464 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.516
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=19, Updated=now(), UpdatedBy=100 WHERE Node_ID=124 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.516
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=20, Updated=now(), UpdatedBy=100 WHERE Node_ID=123 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.517
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=21, Updated=now(), UpdatedBy=100 WHERE Node_ID=547 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.517
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=22, Updated=now(), UpdatedBy=100 WHERE Node_ID=53189 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.518
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=23, Updated=now(), UpdatedBy=100 WHERE Node_ID=174 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.518
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=24, Updated=now(), UpdatedBy=100 WHERE Node_ID=254 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.519
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=25, Updated=now(), UpdatedBy=100 WHERE Node_ID=120 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.519
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=26, Updated=now(), UpdatedBy=100 WHERE Node_ID=135 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.520
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=27, Updated=now(), UpdatedBy=100 WHERE Node_ID=550 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.520
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=28, Updated=now(), UpdatedBy=100 WHERE Node_ID=551 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.520
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=29, Updated=now(), UpdatedBy=100 WHERE Node_ID=306 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.521
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=30, Updated=now(), UpdatedBy=100 WHERE Node_ID=53091 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.521
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=31, Updated=now(), UpdatedBy=100 WHERE Node_ID=417 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.521
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=32, Updated=now(), UpdatedBy=100 WHERE Node_ID=307 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.522
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=33, Updated=now(), UpdatedBy=100 WHERE Node_ID=393 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.522
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=34, Updated=now(), UpdatedBy=100 WHERE Node_ID=53248 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:23.523
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=35, Updated=now(), UpdatedBy=100 WHERE Node_ID=540895 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.443
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=265 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.444
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=104 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.444
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540895 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.445
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=105 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.445
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=384 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.446
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=111 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.446
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=106 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.447
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=117 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.447
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=540675 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.448
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=418 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.448
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=102 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.449
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=103 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.449
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=270 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.449
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=121 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.450
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=476 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.450
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=540715 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.451
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=409 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.451
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=151 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.451
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=53087 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.452
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=19, Updated=now(), UpdatedBy=100 WHERE Node_ID=464 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.452
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=20, Updated=now(), UpdatedBy=100 WHERE Node_ID=124 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.453
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=21, Updated=now(), UpdatedBy=100 WHERE Node_ID=123 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.453
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=22, Updated=now(), UpdatedBy=100 WHERE Node_ID=547 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.453
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=23, Updated=now(), UpdatedBy=100 WHERE Node_ID=53189 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.454
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=24, Updated=now(), UpdatedBy=100 WHERE Node_ID=174 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.454
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=25, Updated=now(), UpdatedBy=100 WHERE Node_ID=254 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.455
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=26, Updated=now(), UpdatedBy=100 WHERE Node_ID=120 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.455
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=27, Updated=now(), UpdatedBy=100 WHERE Node_ID=135 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.456
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=28, Updated=now(), UpdatedBy=100 WHERE Node_ID=550 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.456
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=29, Updated=now(), UpdatedBy=100 WHERE Node_ID=551 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.456
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=30, Updated=now(), UpdatedBy=100 WHERE Node_ID=306 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.456
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=31, Updated=now(), UpdatedBy=100 WHERE Node_ID=53091 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.457
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=32, Updated=now(), UpdatedBy=100 WHERE Node_ID=417 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.457
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=33, Updated=now(), UpdatedBy=100 WHERE Node_ID=307 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.457
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=34, Updated=now(), UpdatedBy=100 WHERE Node_ID=393 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:39.458
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=164, SeqNo=35, Updated=now(), UpdatedBy=100 WHERE Node_ID=53248 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.256
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540892 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.258
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=150 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.259
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=147 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.259
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=145 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.260
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=144 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.260
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=540743 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.260
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540784 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.261
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540826 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.261
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=540895 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.262
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=540827 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.262
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540828 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.263
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540849 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.263
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=540894 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.264
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000099 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.264
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000100 AND AD_Tree_ID=10
;
-- 2017-07-19T14:34:45.264
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000101 AND AD_Tree_ID=10
;
-- 2017-07-19T14:38:42.697
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET WEBUI_NameBrowse='Textvariablen',Updated=TO_TIMESTAMP('2017-07-19 14:38:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=540895
;
-- 2017-07-19T15:10:24.481
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-19 15:10:24','YYYY-MM-DD HH24:MI:SS'),Name='Text Variable',WEBUI_NameBrowse='Text Variable' WHERE AD_Menu_ID=540895 AND AD_Language='en_US'
;
-- 2017-07-19T15:19:11.690
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy,Value) VALUES (0,0,540104,540370,TO_TIMESTAMP('2017-07-19 15:19:06','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-07-19 15:19:06','YYYY-MM-DD HH24:MI:SS'),100,'main')
;
-- 2017-07-19T15:19:11.694
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section_Trl (AD_Language,AD_UI_Section_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_UI_Section_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_UI_Section t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_UI_Section_ID=540370 AND NOT EXISTS (SELECT 1 FROM AD_UI_Section_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_UI_Section_ID=t.AD_UI_Section_ID)
;
-- 2017-07-19T15:19:11.742
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540499,540370,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:11.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540500,540370,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:11.811
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540499,540859,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:11.856
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542306,0,540104,540859,546662,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100,'Organisatorische Einheit des Mandanten','Eine Organisation ist ein Bereich ihres Mandanten - z.B. Laden oder Abteilung. Sie können Daten über Organisationen hinweg gemeinsam verwenden.','Y','N','Y','Y','N','Sektion',10,10,0,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:11.883
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542308,0,540104,540859,546663,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100,'Search key for the record in the format required - must be unique','A search key allows you a fast method of finding a particular record.
If you leave the search key empty, the system automatically creates a numeric number. The document sequence used for this fallback number is defined in the "Maintain Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table (e.g. C_Order).','Y','N','Y','Y','N','Variablenname',20,20,0,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:11.913
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542305,0,540104,540859,546664,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100,'Alphanumeric identifier of the entity','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','Y','N','Y','Y','N','Name',30,30,0,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:11.950
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542309,0,540104,540859,546665,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100,'Type of Validation (SQL, Java Script, Java Language)','The Type indicates the type of validation that will occur. This can be SQL, Java Script or Java Language.','Y','N','Y','Y','N','Typ',40,40,0,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:11.985
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542307,0,540104,540859,546666,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Regel',50,50,0,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:12.022
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542310,0,540104,540859,546667,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100,'Validation Code','The Validation Code displays the date, time and message of the error.','Y','N','Y','Y','N','Validierungs Code',60,60,0,TO_TIMESTAMP('2017-07-19 15:19:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:12.058
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy,Value) VALUES (0,0,540134,540371,TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100,'main')
;
-- 2017-07-19T15:19:12.060
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section_Trl (AD_Language,AD_UI_Section_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_UI_Section_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_UI_Section t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_UI_Section_ID=540371 AND NOT EXISTS (SELECT 1 FROM AD_UI_Section_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_UI_Section_ID=t.AD_UI_Section_ID)
;
-- 2017-07-19T15:19:12.095
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540501,540371,TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:12.135
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540501,540860,TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:12.170
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542910,0,540134,540860,546668,TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100,'Document type or rules','The Document Type determines document sequence and processing rules','Y','N','N','Y','N','Document Type',0,10,0,TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:12.197
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542911,0,540134,540860,546669,TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','Evaluation Time',0,20,0,TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:19:12.224
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542907,0,540134,540860,546670,TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100,'The record is active in the system','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports.
There are two reasons for de-activating and not deleting records:
(1) The system requires the record for audit purposes.
(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','N','N','Y','N','Active',0,30,0,TO_TIMESTAMP('2017-07-19 15:19:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:24:32.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-07-19 15:24:32','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Menu_ID=540895 AND AD_Language='en_US'
;
-- 2017-07-19T15:30:54.636
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Column SET SeqNo=20,Updated=TO_TIMESTAMP('2017-07-19 15:30:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Column_ID=540499
;
-- 2017-07-19T15:30:59.015
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Column SET SeqNo=10,Updated=TO_TIMESTAMP('2017-07-19 15:30:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Column_ID=540500
;
-- 2017-07-19T15:31:36.816
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540500,540861,TO_TIMESTAMP('2017-07-19 15:31:36','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-07-19 15:31:36','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:33:21.781
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Column SET SeqNo=10,Updated=TO_TIMESTAMP('2017-07-19 15:33:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Column_ID=540499
;
-- 2017-07-19T15:33:24.796
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Column SET SeqNo=20,Updated=TO_TIMESTAMP('2017-07-19 15:33:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Column_ID=540500
;
-- 2017-07-19T15:33:33.676
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540861
;
-- 2017-07-19T15:33:52.243
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-07-19 15:33:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546664
;
-- 2017-07-19T15:33:59.018
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-07-19 15:33:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546665
;
-- 2017-07-19T15:34:23.012
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Column SET SeqNo=20,Updated=TO_TIMESTAMP('2017-07-19 15:34:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Column_ID=540499
;
-- 2017-07-19T15:34:26.704
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Column SET SeqNo=10,Updated=TO_TIMESTAMP('2017-07-19 15:34:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Column_ID=540500
;
-- 2017-07-19T15:34:34.409
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540500,540862,TO_TIMESTAMP('2017-07-19 15:34:34','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-07-19 15:34:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:34:49.510
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542305,0,540104,540862,546671,TO_TIMESTAMP('2017-07-19 15:34:49','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Name',10,0,0,TO_TIMESTAMP('2017-07-19 15:34:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:35:17.515
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542308,0,540104,540862,546672,TO_TIMESTAMP('2017-07-19 15:35:17','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Variablenname',20,0,0,TO_TIMESTAMP('2017-07-19 15:35:17','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:36:48.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540499,540863,TO_TIMESTAMP('2017-07-19 15:36:48','YYYY-MM-DD HH24:MI:SS'),100,'Y','type',20,TO_TIMESTAMP('2017-07-19 15:36:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:37:30.912
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542309,0,540104,540863,546673,TO_TIMESTAMP('2017-07-19 15:37:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Typ',10,0,0,TO_TIMESTAMP('2017-07-19 15:37:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:39:46.057
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540499,540864,TO_TIMESTAMP('2017-07-19 15:39:45','YYYY-MM-DD HH24:MI:SS'),100,'Y','org',30,TO_TIMESTAMP('2017-07-19 15:39:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:40:01.748
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542306,0,540104,540864,546674,TO_TIMESTAMP('2017-07-19 15:40:01','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2017-07-19 15:40:01','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:40:26.307
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540502,540370,TO_TIMESTAMP('2017-07-19 15:40:26','YYYY-MM-DD HH24:MI:SS'),100,'Y',30,TO_TIMESTAMP('2017-07-19 15:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:41:50.891
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Column WHERE AD_UI_Column_ID=540502
;
-- 2017-07-19T15:42:41.857
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540500,540865,TO_TIMESTAMP('2017-07-19 15:42:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','sql',20,TO_TIMESTAMP('2017-07-19 15:42:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:43:07.617
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542310,0,540104,540865,546675,TO_TIMESTAMP('2017-07-19 15:43:07','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Validierungs Code',10,0,0,TO_TIMESTAMP('2017-07-19 15:43:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:43:31.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542307,0,540104,540863,546676,TO_TIMESTAMP('2017-07-19 15:43:31','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Regel',20,0,0,TO_TIMESTAMP('2017-07-19 15:43:31','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:44:47.001
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546662
;
-- 2017-07-19T15:44:47.020
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546663
;
-- 2017-07-19T15:44:47.030
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546665
;
-- 2017-07-19T15:44:47.048
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546666
;
-- 2017-07-19T15:44:47.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546667
;
-- 2017-07-19T15:44:47.069
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546664
;
-- 2017-07-19T15:44:51.283
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540859
;
-- 2017-07-19T15:44:56.208
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=10,Updated=TO_TIMESTAMP('2017-07-19 15:44:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540863
;
-- 2017-07-19T15:46:03.976
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=20,Updated=TO_TIMESTAMP('2017-07-19 15:46:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540864
;
-- 2017-07-19T15:46:15.941
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546676
;
-- 2017-07-19T15:46:34.070
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542307,0,540104,540865,546677,TO_TIMESTAMP('2017-07-19 15:46:34','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Regel',20,0,0,TO_TIMESTAMP('2017-07-19 15:46:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T15:49:54.657
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-07-19 15:49:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546674
;
-- 2017-07-19T15:49:54.659
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-07-19 15:49:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546672
;
-- 2017-07-19T15:49:54.661
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-07-19 15:49:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546671
;
-- 2017-07-19T15:49:54.663
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-07-19 15:49:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546673
;
-- 2017-07-19T15:49:54.665
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-07-19 15:49:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546677
;
-- 2017-07-19T15:49:54.667
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-07-19 15:49:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546675
;
-- 2017-07-19T15:50:15.592
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=10,Updated=TO_TIMESTAMP('2017-07-19 15:50:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546672
;
-- 2017-07-19T15:50:15.594
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=20,Updated=TO_TIMESTAMP('2017-07-19 15:50:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546671
;
-- 2017-07-19T15:50:24.402
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=30,Updated=TO_TIMESTAMP('2017-07-19 15:50:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546673
;
-- 2017-07-19T16:01:09.395
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Column SET SeqNo=20,Updated=TO_TIMESTAMP('2017-07-19 16:01:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Column_ID=540501
;
-- 2017-07-19T16:01:22.526
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540503,540371,TO_TIMESTAMP('2017-07-19 16:01:22','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-07-19 16:01:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:02:55.448
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540503,540866,TO_TIMESTAMP('2017-07-19 16:02:55','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-07-19 16:02:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:03:39.140
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542910,0,540134,540866,546678,TO_TIMESTAMP('2017-07-19 16:03:39','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Document Type',10,0,0,TO_TIMESTAMP('2017-07-19 16:03:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:03:54.524
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542911,0,540134,540866,546679,TO_TIMESTAMP('2017-07-19 16:03:54','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Evaluation Time',20,0,0,TO_TIMESTAMP('2017-07-19 16:03:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:04:16.491
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=30,Updated=TO_TIMESTAMP('2017-07-19 16:04:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540860
;
-- 2017-07-19T16:04:27.399
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540501,540867,TO_TIMESTAMP('2017-07-19 16:04:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','active',10,TO_TIMESTAMP('2017-07-19 16:04:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:04:41.333
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542907,0,540134,540867,546680,TO_TIMESTAMP('2017-07-19 16:04:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Active',10,0,0,TO_TIMESTAMP('2017-07-19 16:04:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:04:58.792
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540501,540868,TO_TIMESTAMP('2017-07-19 16:04:58','YYYY-MM-DD HH24:MI:SS'),100,'Y','org',20,TO_TIMESTAMP('2017-07-19 16:04:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:05:29.250
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542912,0,540134,540868,546681,TO_TIMESTAMP('2017-07-19 16:05:29','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2017-07-19 16:05:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:05:44.898
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542909,0,540134,540868,546682,TO_TIMESTAMP('2017-07-19 16:05:44','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',20,0,0,TO_TIMESTAMP('2017-07-19 16:05:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:06:56.016
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546668
;
-- 2017-07-19T16:06:56.026
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546669
;
-- 2017-07-19T16:06:56.034
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546670
;
-- 2017-07-19T16:07:15.925
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540860
;
-- 2017-07-19T16:16:19.957
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546681
;
-- 2017-07-19T16:16:21.801
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546682
;
-- 2017-07-19T16:16:28.458
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540868
;
-- 2017-07-19T16:23:58.822
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-07-19 16:23:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546678
;
-- 2017-07-19T16:23:58.827
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-07-19 16:23:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546679
;
-- 2017-07-19T16:23:58.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-07-19 16:23:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546680
;
-- 2017-07-19T16:36:27.260
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542912,0,540134,540867,546683,TO_TIMESTAMP('2017-07-19 16:36:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',20,0,0,TO_TIMESTAMP('2017-07-19 16:36:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:37:00.340
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542909,0,540134,540867,546684,TO_TIMESTAMP('2017-07-19 16:37:00','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',30,0,0,TO_TIMESTAMP('2017-07-19 16:37:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:40:45.571
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542304,0,540104,540864,546685,TO_TIMESTAMP('2017-07-19 16:40:45','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',20,0,0,TO_TIMESTAMP('2017-07-19 16:40:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T16:43:19.506
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542908,0,540134,540866,546686,TO_TIMESTAMP('2017-07-19 16:43:19','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','boiler plate variable',30,0,0,TO_TIMESTAMP('2017-07-19 16:43:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T17:22:32.982
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546686
;
-- 2017-07-19T17:22:45.607
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546683
;
-- 2017-07-19T17:22:47.869
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=546684
;
-- 2017-07-19T17:22:56.023
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540501,540869,TO_TIMESTAMP('2017-07-19 17:22:55','YYYY-MM-DD HH24:MI:SS'),100,'Y','org',20,TO_TIMESTAMP('2017-07-19 17:22:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T17:23:10.623
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542912,0,540134,540869,546687,TO_TIMESTAMP('2017-07-19 17:23:10','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2017-07-19 17:23:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-19T17:23:18.297
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,542909,0,540134,540869,546688,TO_TIMESTAMP('2017-07-19 17:23:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',20,0,0,TO_TIMESTAMP('2017-07-19 17:23:18','YYYY-MM-DD HH24:MI:SS'),100)
; | the_stack |
--
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You under the Apache License, Version 2.0
-- (the "License"); you may not use this file except in compliance with
-- the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
-- this test shows the current supported join functionality
--
-- create some tables
create table t1 (t1_c1 int, t1_c2 char(10));
create table t2 (t2_c1 int, t2_c2 char(10));
create table t3 (t3_c1 int, t3_c2 char(10));
create table t4 (t4_c1 int, t4_c2 char(10));
-- populate the tables
insert into t1 values (1, 't1-row1');
insert into t1 values (2, 't1-row2');
insert into t2 values (1, 't2-row1');
insert into t2 values (2, 't2-row2');
insert into t3 values (1, 't3-row1');
insert into t3 values (2, 't3-row2');
insert into t4 values (1, 't4-row1');
insert into t4 values (2, 't4-row2');
-- negative test, same exposed name
select * from t1, t1;
-- cartesian products
-- full projection
select * from t1, t2;
select * from t1 a, t2 b, t3 cc, t4 d order by 1,2,3,4,5,6;
-- reorder columns
select t2.*, t1.* from t1, t2;
select t2_c2, t1_c2, t1_c1, t2_c1 from t1, t2;
-- project out columns
select t2_c2, t1_c1 from t1, t2;
select a.t1_c1, cc.t1_c1, e.t1_c1, g.t1_c1, i.t1_c1 from t1 a, t1 cc, t1 e, t1 g, t1 i;
-- project/restricts
select a.t1_c1, b.t1_c1, cc.t1_c1, d.t1_c1, e.t1_c1, f.t1_c1, g.t1_c1, h.t1_c1, i.t1_c1, j.t1_c1
from t1 a, t1 b, t1 cc, t1 d, t1 e, t1 f, t1 g, t1 h, t1 i, t1 j
where a.t1_c2 = b.t1_c2 and b.t1_c2 = cc.t1_c2 and cc.t1_c2 = d.t1_c2 and
d.t1_c2 = e.t1_c2 and e.t1_c2 = f.t1_c2 and f.t1_c2 = g.t1_c2 and
g.t1_c2 = h.t1_c2 and h.t1_c2 = i.t1_c2 and i.t1_c2 = j.t1_c2;
select a.t1_c1, b.t1_c1, cc.t1_c1, d.t1_c1, e.t1_c1, f.t1_c1, g.t1_c1, h.t1_c1, i.t1_c1, j.t1_c1
from t1 a, t1 b, t1 cc, t1 d, t1 e, t1 f, t1 g, t1 h, t1 i, t1 j
where a.t1_c1 = 1 and b.t1_c1 = 1 and cc.t1_c1 = 1 and d.t1_c1 = 1 and e.t1_c1 = 1 and
f.t1_c1 = 1 and g.t1_c1 = 1 and h.t1_c1 = 1 and i.t1_c1 = 1 and
a.t1_c2 = b.t1_c2 and b.t1_c2 = cc.t1_c2 and cc.t1_c2 = d.t1_c2 and
d.t1_c2 = e.t1_c2 and e.t1_c2 = f.t1_c2 and f.t1_c2 = g.t1_c2 and
g.t1_c2 = h.t1_c2 and h.t1_c2 = i.t1_c2 and i.t1_c2 = j.t1_c2;
-- project out entire tables
select 1, 2 from t1, t2;
select 1, t1.t1_c1 from t1, t2;
select t2.t2_c2,1 from t1, t2;
-- bug #306
select c.t1_c1 from (select a.t1_c1 from t1 a, t1 b) c, t1 d where c.t1_c1 = d.t1_c1;
-- create a table for testing inserts
create table instab (instab_c1 int, instab_c2 char(10), instab_c3 int,
instab_c4 char(10));
-- insert select with joins
-- cartesian product
insert into instab select * from t1, t2;
select * from instab;
delete from instab;
insert into instab (instab_c1, instab_c2, instab_c3, instab_c4)
select * from t1, t2;
select * from instab;
delete from instab;
insert into instab (instab_c1, instab_c2, instab_c3, instab_c4)
select t2_c1, t2_c2, t1_c1, t1_c2 from t1, t2;
select * from instab;
delete from instab;
insert into instab (instab_c3, instab_c1, instab_c2, instab_c4)
select t2_c1, t1_c1, t1_c2, t2_c2 from t1, t2;
select * from instab;
delete from instab;
-- projection
insert into instab (instab_c1, instab_c3)
select t1_c1, t2_c1 from t1, t2;
select * from instab;
delete from instab;
-- project out 1 or more tables from join
insert into instab select 1, '2', 3, '4' from t1, t2;
select * from instab;
delete from instab;
insert into instab select 1, t1.t1_c2, 3, t1.t1_c2 from t1, t2;
select * from instab;
delete from instab;
insert into instab select t2.t2_c1, '2', t2.t2_c1, '4' from t1, t2;
select * from instab;
delete from instab;
------------------------------------------
-- test optimizations where we push around
-- predicates (remapColumnReferences)
------------------------------------------
-- case
select t1_c1 from t1, t2 where (case when t1_c1 = 1 then t2_c2 end) = t2_c2;
-- CHAR built-in function
select t1_c1 from t1, t2 where CHAR(t1_c1) = t2_c2;
-- logical operator OR
select t1_c1 from t1, t2 where t1_c1 = 1 or t2_c1 = 2;
-- logical operator AND
select t1_c1 from t1, t2 where t1_c1 = 2147483647 and 2147483647 = t2_c1;
-- beetle 5421
-- INT built-in function
select t1_c1 from t1, t2 where INT(t1_c1) = t2_c1;
select t1_c1 from t1, t2 where t1_c1 = INT(2147483647) and INT(2147483647) = t2_c1;
-- transitive closure - verify join condition doesn't get dropped
create table x(c1 int);
create table y(c1 int);
insert into x values 1, 2, null;
insert into y values 1, 2, null;
select * from x,y where x.c1 = y.c1 and x.c1 = 1 and y.c1 = 2;
select * from x,y where x.c1 = y.c1 and x.c1 is null;
select * from x,y where x.c1 = y.c1 and x.c1 is null and y.c1 = 2;
select * from x,y where x.c1 = y.c1 and x.c1 is null and y.c1 is null;
-- DERBY-2526: join node flattening leads to incorrect transitive closure,
-- which in turn results in incorrect results.
-- Ex. 1: As posted to DERBY-2526:
create table b2 (c1 int, c2 int, c3 char(1), c4 int, c5 int, c6 int);
create table b4 (c7 int, c4 int, c6 int);
create table b3 (c8 int, c9 int, c5 int, c6 int);
create table b (c1 int, c2 int, c3 char(1), c4 int, c5 int, c6 int);
create view bvw (c5, c1 ,c2 ,c3 ,c4) as
select c5, c1 ,c2 ,c3 ,c4 from b2 union
select c5, c1 ,c2 ,c3 ,c4 from b;
create view bvw2 (c1 ,c2 ,c3 ,c4 ,c5) as
select c1 ,c2 ,c3 ,c4 ,c5 from b2 union
select c1 ,c2 ,c3 ,c4 ,c5 from b;
insert into b4 (c7,c4,c6) values (4, 42, 31);
insert into b2 (c5,c1,c3,c4,c6) values (3,4, 'F',43,23);
insert into b3 (c5,c8,c9,c6) values (2,3,19,28);
-- Should see 1 row for *both* of these queries.
select b3.* from b3 join bvw on (b3.c8 = bvw.c5) join b4 on (bvw.c1 = b4.c7) where b4.c4 = 42;
select b3.* from b3 join bvw2 on (b3.c8 = bvw2.c5) join b4 on (bvw2.c1 = b4.c7) where b4.c4 = 42;
-- Cleanup.
drop view bvw;
drop view bvw2;
drop table b;
drop table b2;
drop table b3;
drop table b4;
-- Ex. 2: Simplified repro.
create table b1 (c0 int);
create table xx (c1 int, c2 int);
create table b2 (c3 int, c4 int);
insert into b1 values 1;
insert into xx values (0, 1);
insert into b2 values (0, 2);
-- Following should return 1 row.
select b1.* from
b1 JOIN (select * from xx) VW(c1,c2) on (b1.c0 = vw.c2)
JOIN b2 on (vw.c1 = b2.c3);
-- Try out various correlation name combinations to make sure that
-- correct column remapping occurs regardless of correlation name.
select b1.* from
b1 JOIN (select * from xx) VW(ccx1,ccx2) on (b1.c0 = vw.ccx2)
JOIN b2 on (vw.ccx1 = b2.c3);
select b1.* from
b1 JOIN (select c1 as ccx1, c2 as ccx2 from xx) VW(ccx1,ccx2) on (b1.c0 = vw.ccx2)
JOIN b2 on (vw.ccx1 = b2.c3);
select b1.* from
b1 JOIN (select c1 as ccx1, c2 as ccx2 from xx) VW(x1,x2) on (b1.c0 = vw.x2)
JOIN b2 on (vw.x1 = b2.c3);
select b1.* from
b1 JOIN (select c1 as ccx1, c2 as ccx2 from xx) VW(c1,c2) on (b1.c0 = vw.c2)
JOIN b2 on (vw.c1 = b2.c3);
-- Cleanup.
drop table b1;
drop table b2;
drop table xx;
-- DERBY-3023: join node flattening leads to incorrect search transitive
-- closure, which in turn leads to incorrect results.
CREATE TABLE d3023_t1 (A INTEGER, B INTEGER);
insert into d3023_t1 values (1, 1), (-2, 2), (3, 3);
CREATE TABLE d3023_t2 (C INTEGER, D INTEGER);
insert into d3023_t2 values (1, -1), (2, -2), (3, -3);
CREATE TABLE d3023_t3 (I INTEGER, J INTEGER);
insert into d3023_t3 values (-2, 1), (-3, -2);
CREATE TABLE d3023_t4 (X INTEGER, Y INTEGER);
insert into d3023_t4 values (1, 1), (2, 2), (3, 3);
-- Incremental queries building up to the query in question...
select distinct * from
d3023_t1 left outer join d3023_t2 on d3023_t1.a = d3023_t2.d;
select distinct * from
d3023_t1 left outer join d3023_t2 on d3023_t1.a = d3023_t2.d
where d3023_t1.a = -2;
select distinct * from
d3023_t1 left outer join d3023_t2 on d3023_t1.a = d3023_t2.d
inner join d3023_t3 on d3023_t1.a = d3023_t3.j;
select distinct * from
d3023_t1 left outer join d3023_t2 on d3023_t1.a = d3023_t2.d
inner join d3023_t3 on d3023_t1.a = d3023_t3.j
where d3023_t1.a = -2;
-- This query only returns a single row, even without the
-- explicit search predicate.
select distinct * from
d3023_t1 left outer join d3023_t2 on d3023_t1.a = d3023_t2.d
inner join d3023_t3 on d3023_t1.a = d3023_t3.j
inner join d3023_t4 on d3023_t2.c = d3023_t4.x;
-- Slight variation of the same query. Add a search predicate
-- enforcing "d3023_t1.a = -2" to the join condition. Since the
-- row we saw in the previous query satisifies that predicate,
-- we should see the same row again.
select distinct * from
d3023_t1 left outer join d3023_t2
on d3023_t1.a = d3023_t2.d AND d3023_t1.a = -2
inner join d3023_t3 on d3023_t1.a = d3023_t3.j
inner join d3023_t4 on d3023_t2.c = d3023_t4.x;
-- Same query as above, but with the predicate "d3023_t1.a = -2"
-- sitting at the top-most (outer) SELECT. That makes the predicate
-- available for inclusion in the "search transitive closure" logic
-- for the outer SELECT. That said, prior to the fix for DERBY-3023,
-- search transitive closure was incorrectly adding a new predicate,
-- d3023_t4.x = -2, to the query. This was because two different
-- column references were incorrectly mapped to the same column
-- position w.r.t. the outer join: i.e. "d3023_t1.a" in the search
-- predicate "d3023_t1.a = -2" AND "d3023_t2.c" in the join predicate
-- "d3023_t2.c = d3023_t4.x" were BOTH referencing the first column
-- in the HalfOuterJoinNode. As a result, the search transitive
-- closure logic thought that there was transitive equality between
-- the two predicates, which was incorrect. That in turn caused the
-- query to return incorrect results (no rows). With the fix for
-- DERBY-3023, this query should now return a single row.
select distinct * from
d3023_t1 left outer join d3023_t2 on d3023_t1.a = d3023_t2.d
inner join d3023_t3 on d3023_t1.a = d3023_t3.j
inner join d3023_t4 on d3023_t2.c = d3023_t4.x
where d3023_t1.a = -2;
-- Cleanup.
drop table d3023_t1;
drop table d3023_t2;
drop table d3023_t3;
drop table d3023_t4;
-- Beetle task 5000. Bug found by Websphere. Should not return any rows.
select t1_c1, t1_c2, t2_c1, t2_c2
from t1, t2
where t1_c1 = t2_c1
and t1_c1 = 1
and t2_c1 <> 1;
-- Beetle task 4736
create table a (a1 int not null primary key, a2 int, a3 int, a4 int, a5 int, a6 int);
create table b (b1 int not null primary key, b2 int, b3 int, b4 int, b5 int, b6 int);
create table c (c1 int not null, c2 int, c3 int not null, c4 int, c5 int, c6 int);
create table d (d1 int not null, d2 int, d3 int not null, d4 int, d5 int, d6 int);
alter table c add primary key (c1,c3);
alter table d add primary key (d1,d3);
insert into a values (1,1,3,6,NULL,2),(2,3,2,4,2,2),(3,4,2,NULL,NULL,NULL),
(4,NULL,4,2,5,2),(5,2,3,5,7,4),(7,1,4,2,3,4),
(8,8,8,8,8,8),(6,7,3,2,3,4);
insert into b values (6,7,2,3,NULL,1),(4,5,9,6,3,2),(1,4,2,NULL,NULL,NULL),
(5,NULL,2,2,5,2),(3,2,3,3,1,4),(7,3,3,3,3,3),(9,3,3,3,3,3);
insert into c values (3,7,7,3,NULL,1),(8,3,9,1,3,2),(1,4,1,NULL,NULL,NULL),
(3,NULL,1,2,4,2),(2,2,5,3,2,4),(1,7,2,3,1,1),(3,8,4,2,4,6);
insert into d values (1,7,2,3,NULL,3),(2,3,9,1,1,2),(2,2,2,NULL,3,2),
(1,NULL,3,2,2,1),(2,2,5,3,2,3),(2,5,6,3,7,2);
select a1,b1,c1,c3,d1,d3
from D join (A left outer join (B join C on b2=c2) on a1=b1)
on d3=b3 and d1=a2;
select a1,b1,c1,c3,d1,d3
from D join ((B join C on b2=c2) right outer join A on a1=b1)
on d3=b3 and d1=a2;
-- JIRA 1089: demonstrate that a table with an identity column generated
-- always can be used as the target of an insert-as-select join:
create table j1089_source (source_id int);
insert into j1089_source values (0);
create table j1089_dest (
dest_id int not null primary key generated always as identity,
source_id_1 int not null,
source_id_2 int not null);
insert into j1089_dest (source_id_1, source_id_2)
select s1.source_id, s2.source_id
from j1089_source as s1
join j1089_source as s2 on 1 = 1;
select * from j1089_dest;
-- DERBY-3538 NullPointerException during execution for query with LEFT
-- OUTER JOIN whose inner table selects all constants.
create table t3538 (i int, j int);
insert into t3538 values (-1, -2), (-2, -4), (-3, -9);
select * from
t3538 left outer join
(select -1 a, 1 b from t3538) x0 --DERBY-PROPERTIES joinStrategy=NESTEDLOOP
on x0.a = t3538.i;
--- regression test for an old optimizer problem; when the bug occurred,
-- hash join queries with 'or' would return incorrect results.
create table t5929_1 ( i int, j int, k int);
create table t5929_2 ( i int, j int, k int);
insert into t5929_1 values (1, 1, 1), (2, 1, 2);
insert into t5929_1 select i+2, j, k from t5929_1;
insert into t5929_1 select i+4, j, k from t5929_1;
insert into t5929_2 select * from t5929_1;
-- This query should return 32 rows, but it returned 64 before fix
select * from --DERBY-PROPERTIES joinOrder=fixed
t5929_1, t5929_2 --DERBY-PROPERTIES joinStrategy=nestedLoop
where t5929_1.j=t5929_2.j and (t5929_2.j=1 and (t5929_2.k=1 or t5929_2.j=4));
-- This query should return identical to the above query
select * from --DERBY-PROPERTIES joinOrder=fixed
t5929_1, t5929_2 --DERBY-PROPERTIES joinStrategy=hash
where t5929_1.j=t5929_2.j and (t5929_2.j=1 and t5929_2.k=1);
select * from --DERBY-PROPERTIES joinOrder=fixed
t5929_1, t5929_2 --DERBY-PROPERTIES joinStrategy=hash
where t5929_1.j=t5929_2.j and (t5929_2.j=1 and (t5929_2.k=1 or t5929_2.j+1=5));
select * from --DERBY-PROPERTIES joinOrder=fixed
t5929_2, t5929_1 --DERBY-PROPERTIES joinStrategy=hash
where t5929_1.j=t5929_2.j and (t5929_2.j=1 and (t5929_2.k=1 or t5929_2.j=4));
-----------------------------------
-- clean up
----------------------------------
drop table a;
drop table b;
drop table c;
drop table d;
drop table t1;
drop table t2;
drop table t3;
drop table t4;
drop table instab;
drop table x;
drop table y;
drop table j1089_source;
drop table j1089_dest;
drop table t3538;
drop table t5929_1;
drop table t5929_2; | the_stack |
-- regression test cases from all bug reports in trac.
-- bug 17 The command does not return the number of affected records
create table tx1(id int primary key, c char(50));
insert into tx1 values(1,'1');
insert into tx1 values(2, '2');
insert into tx1 values(3, '3');
delete from tx1;
drop table tx1;
-- bug 30
create table uv_iocu_tab (a serial primary key, b varchar(50));
insert into uv_iocu_tab (b) values('abc'),('bcd'),('xyz');
create view uv_iocu_view as select b as bb, a as aa, uv_iocu_tab::varchar(50) as cc from uv_iocu_tab;
select * from uv_iocu_view;
drop view uv_iocu_view;
create view uv_iocu_view as select a as aa, b as bb, uv_iocu_tab::varchar(50) as cc from uv_iocu_tab;
select * from uv_iocu_view;
drop table uv_iocu_tab cascade;
-- bug 31
CREATE TABLE base_tbl(id serial primary key, a float);
INSERT INTO base_tbl (a) SELECT i/10.0 FROM generate_series(1,10) g(i);
CREATE VIEW rw_view1 AS SELECT ctid, sin(a) s, a, cos(a) c FROM base_tbl WHERE a != 0 ORDER BY abs(a);
select*from rw_view1;
drop view rw_view1;
CREATE VIEW rw_view1 AS SELECT sin(a) s, a, cos(a) c FROM base_tbl WHERE a != 0 ORDER BY abs(a);
select*from rw_view1;
INSERT INTO rw_view1 (a) VALUES (1.1) RETURNING a, s, c;
select*from rw_view1;
drop table base_tbl cascade;
-- bug 29
CREATE TABLE base_tbl (a int PRIMARY KEY, b varchar(50) DEFAULT 'Unspecified');
INSERT INTO base_tbl SELECT i, 'Row ' i FROM generate_series(-2, 2) g(i);
CREATE VIEW rw_view16 AS SELECT a, b, a AS aa FROM base_tbl;
UPDATE rw_view16 SET aa=-3 WHERE a=3;
UPDATE rw_view16 SET aa=-5 WHERE a=5;
select*from rw_view16;
delete from rw_view16 where aa=2;
insert into rw_view16 values(4,'new row');
UPDATE rw_view16 SET aa=-4 WHERE a=4;
select*from rw_view16;
drop table base_tbl cascade;
CREATE TABLE base_tbl(a int primary key, b varchar(50), c float);
CREATE VIEW rw_view2 AS SELECT b AS bb, c AS cc, a AS aa FROM base_tbl;
UPDATE base_tbl SET a=a, c=c;
UPDATE rw_view2 SET bb=bb, cc=cc;
select*from base_tbl;
select*from rw_view2;
drop table base_tbl cascade;
-- bug 39
CREATE TABLE SUBSELECT_TBL ( id serial primary key, f1 integer, f2 integer, f3 float );
INSERT INTO SUBSELECT_TBL (f1, f2, f3) VALUES (1, 2, 3), (2, 3, 4), (3, 4, 5), (1, 1, 1), (2, 2, 2), (3, 3, 3), (6, 7, 8), (8, 9, NULL);
SELECT f1 AS "Correlated Field", f2 AS "Second Field" FROM SUBSELECT_TBL upper WHERE f1 IN (SELECT f2 FROM SUBSELECT_TBL WHERE f1 = upper.f1);
drop table SUBSELECT_TBL;
create temp table rngfunc(f1 int8, f2 int8);
create function testrngfunc() returns record as $$
insert into rngfunc values (1,2) returning *;
$$ language sql;
select testrngfunc();
select * from testrngfunc() as t(f1 int8,f2 int8);
select * from testrngfunc() as t(f1 int8,f2 int8);
-- bug 48
create user userw;
SELECT SESSION_USER, CURRENT_USER;
SET SESSION AUTHORIZATION userw;
create table testu1(id integer primary key, name varchar(50));
insert into testu1 values(1, 'userx');
insert into testu1 values(2, 'userw');
SELECT SESSION_USER, CURRENT_USER;
drop table testu1;
SET SESSION AUTHORIZATION dzw;
-- bug 51
CREATE TABLE r1 (id serial primary key, a int);
CREATE TABLE r2 (id serial primary key, a int);
INSERT INTO r1 (a) VALUES (10), (20);
INSERT INTO r2 (a) VALUES (10), (20);
INSERT INTO r1 (a) SELECT a + 1 FROM r2;
INSERT INTO r1 (a) SELECT a + 1 FROM r2 RETURNING *;
select*from r1;
select*from r2;
drop table r1;
drop table r2;
-- bug 60
create table at_base_table(id int primary key, stuff text);
insert into at_base_table values (23, 'skidoo');
create view at_view_1 as select * from at_base_table bt;
create view at_view_2 as select *, to_json(v1) as j from at_view_1 v1;
explain (verbose, costs off) select * from at_view_2;
explain (verbose, costs off) select * from at_view_1;
select * from at_view_2;
select * from at_view_1;
drop table at_base_table cascade;
-- bug 69
drop table if exists pagg_tab_m;
CREATE TABLE pagg_tab_m (id serial , a int, b int, c int, primary key(id, a,b)) PARTITION BY RANGE(a, b);
CREATE TABLE pagg_tab_m_p1 PARTITION OF pagg_tab_m FOR VALUES FROM (0, 0) TO (10, 10);
CREATE TABLE pagg_tab_m_p2 PARTITION OF pagg_tab_m FOR VALUES FROM (10, 10) TO (20, 20);
CREATE TABLE pagg_tab_m_p3 PARTITION OF pagg_tab_m FOR VALUES FROM (20, 20) TO (30, 30);
INSERT INTO pagg_tab_m(a,b,c) SELECT i % 30, i % 40, i % 50 FROM generate_series(0, 2999) i;
EXPLAIN (COSTS OFF)
SELECT a, sum(b), avg(c), count(*) FROM pagg_tab_m GROUP BY a, (a+b)/2 HAVING sum(b) < 50 ORDER BY 1, 2, 3;
SELECT a, sum(b), avg(c), count(*) FROM pagg_tab_m GROUP BY a, (a+b)/2 HAVING sum(b) < 50 ORDER BY 1, 2, 3;
EXPLAIN (COSTS OFF)
SELECT a, c, sum(b), avg(c), count(*) FROM pagg_tab_m GROUP BY (a+b)/2, 2, 1 HAVING sum(b) = 50 AND avg(c) > 25 ORDER BY 1, 2, 3;
SELECT a, c, sum(b), avg(c), count(*) FROM pagg_tab_m GROUP BY (a+b)/2, 2, 1 HAVING sum(b) = 50 AND avg(c) > 25 ORDER BY 1, 2, 3;
drop table if exists pagg_tab_m;
-- bug 53
drop table if exists trunc_stats_test1;
CREATE TABLE trunc_stats_test1(id serial primary key, stuff text);
insert into trunc_stats_test1 (stuff) values('abc'), ('xyz');
select*from trunc_stats_test1;
UPDATE trunc_stats_test1 SET id = id + 10 WHERE id IN (1, 2);
select*from trunc_stats_test1;
drop table if exists itest1;
CREATE TABLE itest1 (a int generated by default as identity primary key, b text);
INSERT INTO itest1 DEFAULT VALUES;
insert into itest1 values(DEFAULT, 'bbb');
INSERT INTO itest1 VALUES (2, 'b');
INSERT INTO itest1 VALUES (10, 'xyz');
UPDATE itest1 SET a = DEFAULT WHERE a = 2;
select*from itest1;
alter table itest1 add column c int default 3;
UPDATE itest1 SET c = DEFAULT WHERE a = 2;
select*from itest1;
insert into itest1(b,c) values('aaa', 44);
select*from itest1;
UPDATE itest1 SET c = DEFAULT WHERE a = 2;
select*from itest1;
insert into itest1(b,c) values('aaa', 44);
select*from itest1;
UPDATE itest1 SET c = DEFAULT WHERE a = 3;
select*from itest1;
UPDATE itest1 SET a = DEFAULT WHERE a = 3;
select*from itest1;
insert into itest1 values(DEFAULT, 'xxx', 333), (DEFAULT, 'yyy', 444);
select*from itest1;
-- bug 28
CREATE TABLE base_tbl (a int PRIMARY KEY, b varchar(50) DEFAULT 'Unspecified');
INSERT INTO base_tbl SELECT i, 'Row ' i FROM generate_series(-2, 2) g(i);
CREATE VIEW rw_view1 AS SELECT * FROM base_tbl WHERE a>0;
EXPLAIN (costs off) UPDATE rw_view1 SET a=6 WHERE a=5;
EXPLAIN (costs off) DELETE FROM rw_view1 WHERE a=5;
DROP table if exists T;
CREATE TABLE T (pk INT NOT NULL PRIMARY KEY);
INSERT INTO T SELECT * FROM generate_series(1, 10) a;
EXPLAIN (VERBOSE TRUE, COSTS FALSE) DELETE FROM T WHERE pk BETWEEN 10 AND 20 RETURNING *;
drop table if exists mvtest_t;
CREATE TABLE mvtest_t (id int NOT NULL PRIMARY KEY, type varchar(50) NOT NULL, amt numeric NOT NULL);
EXPLAIN (costs off)
CREATE MATERIALIZED VIEW mvtest_tm AS SELECT type, sum(amt) AS totamt FROM mvtest_t GROUP BY type WITH NO DATA;
-- bug 36
create table parted_conflict (a int primary key, b text) partition by range (a);
create table parted_conflict_1 partition of parted_conflict for values from (0) to (1000) partition by range (a);
create table parted_conflict_1_1 partition of parted_conflict_1 for values from (0) to (500);
insert into parted_conflict values (40, 'forty'), (30, 'thirty');
alter table parted_conflict add column c int default 3;
select*from parted_conflict;
delete from parted_conflict where a = 30;
update parted_conflict set c=c+10 where a=40;
select*from parted_conflict;
drop table parted_conflict;
-- bug 43
drop table int4_tbl cascade;
drop table int8_tbl cascade;
drop table text_tbl cascade;
CREATE TABLE INT4_TBL(id serial primary key, f1 int4);
CREATE TABLE INT8_TBL(id serial primary key, q1 int8, q2 int8);
CREATE TABLE TEXT_TBL (id serial primary key, f1 text);
insert into int4_tbl(f1) values(1),(2),(3),(4);
insert into int8_tbl(q1, q2) values(1,2),(2,3),(3,4),(4,5);
insert into text_tbl values('abc'),('bcd'),('def');
explain (verbose, costs off)
select * from
text_tbl t1
left join int8_tbl i8
on i8.q2 = 123,
lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss1,
lateral (select ss1.* from text_tbl t3 limit 1) as ss2
where t1.f1 = ss2.f1;
-- AND no explain--
select * from
text_tbl t1
left join int8_tbl i8
on i8.q2 = 123,
lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss1,
lateral (select ss1.* from text_tbl t3 limit 1) as ss2
where t1.f1 = ss2.f1;
-- AND --
explain (verbose)
select * from
text_tbl t1
left join int8_tbl i8
on i8.q2 = 2,
lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss1,
lateral (select ss1.* from text_tbl t3 limit 1) as ss2
where t1.f1 = ss2.f1;
select * from
text_tbl t1
left join int8_tbl i8
on i8.q2 = 2,
lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss1,
lateral (select ss1.* from text_tbl t3 limit 1) as ss2
where t1.f1 = ss2.f1;
-- AND --
explain (verbose)
select ss2.* from
int4_tbl i41
left join int8_tbl i8
join (select i42.f1 as c1, i43.f1 as c2, 42 as c3
from int4_tbl i42, int4_tbl i43) ss1
on i8.q1 = ss1.c2
on i41.f1 = ss1.c1,
lateral (select i41.*, i8.*, ss1.* from text_tbl limit 1) ss2
where ss1.c2 = 0;
select ss2.* from
int4_tbl i41
left join int8_tbl i8
join (select i42.f1 as c1, i43.f1 as c2, 42 as c3
from int4_tbl i42, int4_tbl i43) ss1
on i8.q1 = ss1.c2
on i41.f1 = ss1.c1,
lateral (select i41.*, i8.*, ss1.* from text_tbl limit 1) ss2
where ss1.c2 = 0;
-----------------------------
drop table if exists rngfunc2 cascade;
CREATE TABLE rngfunc2(id serial primary key, rngfuncid int, f2 int);
INSERT INTO rngfunc2(rngfuncid, f2) VALUES(1, 11);
INSERT INTO rngfunc2(rngfuncid, f2) VALUES(2, 22);
INSERT INTO rngfunc2(rngfuncid, f2) VALUES(1, 111);
drop function if exists rngfunct;
CREATE FUNCTION rngfunct(int) returns setof rngfunc2 as 'SELECT * FROM rngfunc2 WHERE rngfuncid = $1 ORDER BY f2;' LANGUAGE SQL;
select * from rngfunc2, rngfunct(rngfunc2.rngfuncid) z where rngfunc2.f2 = z.f2;
select * from rngfunc2, rngfunct(rngfunc2.rngfuncid) with ordinality as z(rngfuncid,f2,ord) where rngfunc2.f2 = z.f2;
select * from rngfunc2 where f2 in (select f2 from rngfunct(rngfunc2.rngfuncid) z where z.rngfuncid = rngfunc2.rngfuncid) ORDER BY 1,2;
select * from rngfunc2 where f2 in (select f2 from rngfunct(1) z where z.rngfuncid = rngfunc2.rngfuncid) ORDER BY 1,2;
select * from rngfunc2 where f2 in (select f2 from rngfunct(rngfunc2.rngfuncid) z where z.rngfuncid = 1) ORDER BY 1,2;
DROP TABLE if exists prt1_l cascade;
CREATE TABLE prt1_l (a int , b int, c varchar, primary key(a,c,b)) PARTITION BY RANGE(a);
CREATE TABLE prt1_l_p1 PARTITION OF prt1_l FOR VALUES FROM (0) TO (250);
CREATE TABLE prt1_l_p2 PARTITION OF prt1_l FOR VALUES FROM (250) TO (500) PARTITION BY LIST (c);
CREATE TABLE prt1_l_p2_p1 PARTITION OF prt1_l_p2 FOR VALUES IN ('0000', '0001');
CREATE TABLE prt1_l_p2_p2 PARTITION OF prt1_l_p2 FOR VALUES IN ('0002', '0003');
CREATE TABLE prt1_l_p3 PARTITION OF prt1_l FOR VALUES FROM (500) TO (600) PARTITION BY RANGE (b);
CREATE TABLE prt1_l_p3_p1 PARTITION OF prt1_l_p3 FOR VALUES FROM (0) TO (13);
CREATE TABLE prt1_l_p3_p2 PARTITION OF prt1_l_p3 FOR VALUES FROM (13) TO (25);
INSERT INTO prt1_l SELECT i, i % 25, to_char(i % 4, 'FM0000') FROM generate_series(0, 599, 2) i;
DROP TABLE if exists prt2_l;
CREATE TABLE prt2_l (a int, b int , c varchar, primary key(b,c,a)) PARTITION BY RANGE(b);
CREATE TABLE prt2_l_p1 PARTITION OF prt2_l FOR VALUES FROM (0) TO (250);
CREATE TABLE prt2_l_p2 PARTITION OF prt2_l FOR VALUES FROM (250) TO (500) PARTITION BY LIST (c);
CREATE TABLE prt2_l_p2_p1 PARTITION OF prt2_l_p2 FOR VALUES IN ('0000', '0001');
CREATE TABLE prt2_l_p2_p2 PARTITION OF prt2_l_p2 FOR VALUES IN ('0002', '0003');
CREATE TABLE prt2_l_p3 PARTITION OF prt2_l FOR VALUES FROM (500) TO (600) PARTITION BY RANGE (a);
CREATE TABLE prt2_l_p3_p1 PARTITION OF prt2_l_p3 FOR VALUES FROM (0) TO (13);
CREATE TABLE prt2_l_p3_p2 PARTITION OF prt2_l_p3 FOR VALUES FROM (13) TO (25);
INSERT INTO prt2_l SELECT i % 25, i, to_char(i % 4, 'FM0000') FROM generate_series(0, 599, 3) i;
SELECT * FROM prt1_l t1 LEFT JOIN LATERAL (SELECT t2.a AS t2a, t2.c AS t2c, t2.b AS t2b, t3.b AS t3b, least(t1.a,t2.a,t3.b) FROM prt1_l t2 JOIN prt2_l t3 ON (t2.a = t3.b AND t2.c = t3.c)) ss ON t1.a = ss.t2a AND t1.c = ss.t2c WHERE t1.b = 0 ORDER BY t1.a;
-- bug 66
DROP TABLE if exists prt1;
DROP TABLE if exists prt2;
CREATE TABLE prt1 (a int primary key, b int, c varchar) PARTITION BY RANGE(a);
CREATE TABLE prt1_p1 PARTITION OF prt1 FOR VALUES FROM (0) TO (250);
CREATE TABLE prt1_p3 PARTITION OF prt1 FOR VALUES FROM (500) TO (600);
CREATE TABLE prt1_p2 PARTITION OF prt1 FOR VALUES FROM (250) TO (500);
INSERT INTO prt1 SELECT i, i % 25, to_char(i, 'FM0000') FROM generate_series(0, 599) i WHERE i % 2 = 0;
CREATE TABLE prt2 (a int, b int primary key, c varchar) PARTITION BY RANGE(b);
CREATE TABLE prt2_p1 PARTITION OF prt2 FOR VALUES FROM (0) TO (250);
CREATE TABLE prt2_p2 PARTITION OF prt2 FOR VALUES FROM (250) TO (500);
CREATE TABLE prt2_p3 PARTITION OF prt2 FOR VALUES FROM (500) TO (600);
INSERT INTO prt2 SELECT i % 25, i, to_char(i, 'FM0000') FROM generate_series(0, 599) i WHERE i % 3 = 0;
SELECT t1, t2 FROM prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b WHERE t1.b = 0 ORDER BY t1.a, t2.b;
SELECT t1.a, t2.b FROM prt1 t1, prt2 t2 WHERE t1::text = t2::text AND t1.a = t2.b ORDER BY t1.a;
SELECT * FROM prt1 t1 LEFT JOIN (SELECT t2.a AS t2a, t3.a AS t3a, least(t2.a,t3.b) FROM prt1 t2 JOIN prt2 t3 ON (t2.a = t3.b)) ss ON t1.a = ss.t2a WHERE t1.b = 0 ORDER BY t1.a;
SELECT * FROM prt1 t1 LEFT JOIN LATERAL (SELECT t2.a AS t2a, t3.a AS t3a, least(t1.a,t2.a,t3.b) FROM prt1 t2 JOIN prt2 t3 ON (t2.a = t3.b)) ss ON t1.a = ss.t2a WHERE t1.b = 0 ORDER BY t1.a;
-- bug 67
SET enable_partitionwise_join to true;
DROP TABLE if exists prt1_l;
CREATE TABLE prt1_l (a int, b int, c varchar, primary key(a,b,c)) PARTITION BY RANGE(a);
CREATE TABLE prt1_l_p1 PARTITION OF prt1_l FOR VALUES FROM (0) TO (250);
CREATE TABLE prt1_l_p2 PARTITION OF prt1_l FOR VALUES FROM (250) TO (500) PARTITION BY LIST (c);
CREATE TABLE prt1_l_p2_p1 PARTITION OF prt1_l_p2 FOR VALUES IN ('0000', '0001');
CREATE TABLE prt1_l_p2_p2 PARTITION OF prt1_l_p2 FOR VALUES IN ('0002', '0003');
CREATE TABLE prt1_l_p3 PARTITION OF prt1_l FOR VALUES FROM (500) TO (600) PARTITION BY RANGE (b);
CREATE TABLE prt1_l_p3_p1 PARTITION OF prt1_l_p3 FOR VALUES FROM (0) TO (13);
CREATE TABLE prt1_l_p3_p2 PARTITION OF prt1_l_p3 FOR VALUES FROM (13) TO (25);
INSERT INTO prt1_l SELECT i, i % 25, to_char(i % 4, 'FM0000') FROM generate_series(0, 599, 2) i;
DROP TABLE if exists prt2_l;
CREATE TABLE prt2_l (a int, b int, c varchar, primary key(a,b,c)) PARTITION BY RANGE(b);
CREATE TABLE prt2_l_p1 PARTITION OF prt2_l FOR VALUES FROM (0) TO (250);
CREATE TABLE prt2_l_p2 PARTITION OF prt2_l FOR VALUES FROM (250) TO (500) PARTITION BY LIST (c);
CREATE TABLE prt2_l_p2_p1 PARTITION OF prt2_l_p2 FOR VALUES IN ('0000', '0001');
CREATE TABLE prt2_l_p2_p2 PARTITION OF prt2_l_p2 FOR VALUES IN ('0002', '0003');
CREATE TABLE prt2_l_p3 PARTITION OF prt2_l FOR VALUES FROM (500) TO (600) PARTITION BY RANGE (a);
CREATE TABLE prt2_l_p3_p1 PARTITION OF prt2_l_p3 FOR VALUES FROM (0) TO (13);
CREATE TABLE prt2_l_p3_p2 PARTITION OF prt2_l_p3 FOR VALUES FROM (13) TO (25);
INSERT INTO prt2_l SELECT i % 25, i, to_char(i % 4, 'FM0000') FROM generate_series(0, 599, 3) i;
EXPLAIN (COSTS OFF) SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1, prt2_l t2 WHERE t1.a = t2.b AND t1.b = 0 ORDER BY t1.a, t2.b;
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1, prt2_l t2 WHERE t1.a = t2.b AND t1.b = 0 ORDER BY t1.a, t2.b;
-- bug 16
create table insertconflicttest1(key1 int4, fruit text);
create index idx1 on insertconflicttest1(fruit);
-- bug 40
drop table SUBSELECT_TBL cascade;
CREATE TABLE SUBSELECT_TBL ( id serial primary key, f1 integer, f2 integer, f3 float );
INSERT INTO SUBSELECT_TBL (f1, f2, f3) VALUES (1, 2, 3), (2, 3, 4), (3, 4, 5), (1, 1, 1), (2, 2, 2), (3, 3, 3), (6, 7, 8), (8, 9, NULL);
SELECT f1 AS "Correlated Field", f3 AS "Second Field" FROM SUBSELECT_TBL upper WHERE f3 IN (SELECT upper.f1 + f2 FROM SUBSELECT_TBL WHERE f2 = CAST(f3 AS integer));
-- bug 33
begin;
savepoint sa;
release savepoint sa;
commit;
-- bug 42
drop table if exists tenk1;
drop table if exists INT4_TBL;
drop table if exists FLOAT8_TBL;
CREATE TABLE tenk1 (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 name,
stringu2 name,
string4 name
);
CREATE TABLE INT4_TBL(f1 int4);
CREATE TABLE FLOAT8_TBL(f1 float8);
begin;
select count(*) from tenk1 x where x.unique1 in (select a.f1 from int4_tbl a,float8_tbl b where a.f1=b.f1) and
x.unique1 = 0 and x.unique1 in (select aa.f1 from int4_tbl aa,float8_tbl bb where aa.f1=bb.f1);
rollback;
-- bug 81
drop table if exists INT8_TBL;
CREATE TABLE INT8_TBL(id serial primary key, q1 int8, q2 int8);
INSERT INTO INT8_TBL(q1, q2) VALUES(' 123 ',' 456');
INSERT INTO INT8_TBL(q1, q2) VALUES('123 ','4567890123456789');
INSERT INTO INT8_TBL(q1, q2) VALUES('4567890123456789','123');
INSERT INTO INT8_TBL(q1, q2) VALUES(+4567890123456789,'4567890123456789');
INSERT INTO INT8_TBL(q1, q2) VALUES('+4567890123456789','-4567890123456789');
select t1.q2, count(t2.*) from int8_tbl t1 left join (select * from int8_tbl) t2 on (t1.q2 = t2.q1) group by t1.q2 order by 1;
explain select t1.q2, count(t2.*) from int8_tbl t1 left join (select * from int8_tbl) t2 on (t1.q2 = t2.q1) group by t1.q2 order by 1;
select t1.q2, count(t2.*) from int8_tbl t1 left join (select q1, case when q2=1 then 1 else q2 end as q2 from int8_tbl) t2 on (t1.q2 = t2.q1) group by t1.q2 order by 1;
explain select t1.q2, count(t2.*) from int8_tbl t1 left join (select q1, case when q2=1 then 1 else q2 end as q2 from int8_tbl) t2 on (t1.q2 = t2.q1) group by t1.q2 order by 1;
select t1.q2, count(t2.*) from int8_tbl t1 left join int8_tbl t2 on (t1.q2 = t2.q1) group by t1.q2 order by 1;
explain select t1.q2, count(t2.*) from int8_tbl t1 left join int8_tbl t2 on (t1.q2 = t2.q1) group by t1.q2 order by 1;
-- bug 71
DROP table if exists T;
CREATE TABLE T(pk INT NOT NULL PRIMARY KEY);
INSERT INTO T VALUES (1);
ALTER TABLE T ADD COLUMN c1 TIMESTAMP DEFAULT now();
select*from T;
insert into T values(2);
select*from T;
CREATE OR REPLACE FUNCTION foo(a INT) RETURNS TEXT AS $$
DECLARE res TEXT = 'xyz';
i INT;
BEGIN
i = 0;
WHILE (i < a) LOOP
res = res || chr(ascii('a') + i);
i = i + 1;
END LOOP;
RETURN res;
END; $$ LANGUAGE PLPGSQL STABLE;
DROP table if exists T;
CREATE TABLE T(pk INT NOT NULL PRIMARY KEY, c_int INT DEFAULT LENGTH(foo(6)));
INSERT INTO T VALUES (1), (2);
select*from t;
ALTER TABLE T ADD COLUMN c_bpchar BPCHAR(50) DEFAULT foo(4), ALTER COLUMN c_int SET DEFAULT LENGTH(foo(8));
select*from t;
-- bug 21
drop table if exists mlparted;
drop table if exists mlparted1;
create table mlparted(id integer primary key);
create table mlparted1(id integer primary key);
select attrelid::regclass, attname, attnum from pg_attribute where attname = 'a' and (attrelid = 'mlparted'::regclass or attrelid = 'mlparted1'::regclass);
insert into mlparted values(1),(2),(3),(4);
insert into mlparted1 values(5),(2),(3),(4);
select attrelid::regclass, attname, attnum from pg_attribute where attname = 'a' and (attrelid = 'mlparted'::regclass or attrelid = 'mlparted1'::regclass);
-- bug 32
drop table if exists test_missing_target;
CREATE TABLE test_missing_target (a int primary key, b int, c char(8), d char);
INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A'), (1, 2, 'ABAB', 'b'), (2, 2, 'ABAB', 'c'), (3, 3, 'BBBB', 'D'), (4, 3, 'BBBB', 'e'), (5, 3, 'bbbb', 'F'), (6, 4, 'cccc', 'g'), (7, 4, 'cccc', 'h'), (8, 4, 'CCCC', 'I'), (9, 4, 'CCCC', 'j');
SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y WHERE x.a = y.a GROUP BY x.b ORDER BY x.b;
SELECT count(*) FROM test_missing_target x, test_missing_target y WHERE x.a = y.a GROUP BY x.b ORDER BY x.b;
SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y WHERE x.a = y.a GROUP BY x.b/2 ORDER BY x.b/2;
-- bug 64
drop table if exists itest7;
CREATE TABLE itest7 (id int primary key, a int GENERATED ALWAYS AS IDENTITY);
insert into itest7 (id) values(1),(2),(3);
insert into itest7 values(4, 40),(5, 50);
select*from itest7;
ALTER TABLE itest7 ALTER COLUMN a SET GENERATED BY DEFAULT;
insert into itest7 values(6, 60),(7, 70);
select*from itest7;
-- bug 65
drop table if exists itest13;
CREATE TABLE itest13 (a int primary key);
ALTER TABLE itest13 ADD COLUMN b int GENERATED BY DEFAULT AS IDENTITY;
INSERT INTO itest13 VALUES (1), (2), (3);
SELECT * FROM itest13;
ALTER TABLE itest13 ADD COLUMN c int GENERATED BY DEFAULT AS IDENTITY;
SELECT * FROM itest13;
drop table if exists itest6;
CREATE TABLE itest6 (a int GENERATED ALWAYS AS IDENTITY primary key, b text);
INSERT INTO itest6 DEFAULT VALUES;
ALTER TABLE itest6 ALTER COLUMN a SET GENERATED BY DEFAULT SET INCREMENT BY 2 SET START WITH 100 RESTART;
SELECT * FROM itest6;
INSERT INTO itest6 DEFAULT VALUES;
INSERT INTO itest6 DEFAULT VALUES;
SELECT * FROM itest6;
-- bug 68
drop table if exists t2;
create table t2(a int);
create index on t2(a,a);
-- bug 83
drop table if exists revalidate_bug cascade;
drop function if exists inverse(int);
create function inverse(int) returns float8 as
$$
begin
return 1::float8/$1;
exception
when division_by_zero then return 0;
end$$ language plpgsql volatile;
create table revalidate_bug (id serial primary key, c float8 unique);
insert into revalidate_bug (c) values (1);
insert into revalidate_bug (c) values (inverse(0));
select*from revalidate_bug ;
-- bug 61
drop schema if exists s1 cascade;
create schema s1;
create table s1.t1(id int);
alter table s1.t1 set schema s1;
drop schema if exists s1 cascade;
--bug 80
drop table if exists SUBSELECT_TBL;
CREATE TABLE SUBSELECT_TBL ( id serial primary key, f1 integer, f2 integer, f3 float );
INSERT INTO SUBSELECT_TBL (f1, f2, f3) VALUES (1, 2, 3), (2, 3, 4), (3, 4, 5), (1, 1, 1), (2, 2, 2), (3, 3, 3), (6, 7, 8), (8, 9, NULL);
SELECT f1, f2 FROM SUBSELECT_TBL WHERE (f1, f2) NOT IN (SELECT f2, CAST(f3 AS int4) FROM SUBSELECT_TBL WHERE f3 IS NOT NULL);
-- bug 33
begin;
savepoint sa;
release savepoint sa;
commit;
begin;
savepoint sa;
release savepoint sa;
rollback;
-- bug 13
SELECT SESSION_USER, CURRENT_USER;
drop schema if exists testschema cascade;
CREATE SCHEMA if not exists testschema;
SELECT SESSION_USER, CURRENT_USER;
CREATE TABLE testschema.foo (i serial primary key, j serial);
insert into testschema.foo default values;
insert into testschema.foo default values;
select*from testschema.foo;
create sequence testschema.seq1;
select testschema.seq1.nextval, nextval('testschema.seq1');
drop schema testschema cascade;
-- bug 44 todo
drop table if exists tenk1;
drop table if exists INT4_TBL;
CREATE TABLE tenk1 (
id serial primary key,
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 name,
stringu2 name,
string4 name
);
-- unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1 , stringu2 ,string4
CREATE TABLE INT4_TBL(id serial primary key, f1 int4);
COPY tenk1(unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1 , stringu2 ,string4) FROM '/home/dzw/work/postgresql-11.5/src/test/regress/data/tenk.data';
insert into int4_tbl (f1) select generate_series(1,13);
explain (costs off)
select b.unique1 from
tenk1 a join tenk1 b on a.unique1 = b.unique2
left join tenk1 c on b.unique1 = 42 and c.thousand = a.thousand
join int4_tbl i1 on b.thousand = f1
right join int4_tbl i2 on i2.f1 = b.tenthous
order by 1;
explain (costs off)
select b.unique1 from
tenk1 a join tenk1 b on a.unique1 = b.unique2
join int4_tbl i1 on b.thousand = f1
right join int4_tbl i2 on i2.f1 = b.tenthous
order by 1;
set enable_nestloop=false;
select b.unique1 from
tenk1 a join tenk1 b on a.unique1 = b.unique2
left join tenk1 c on b.unique1 = 42 and c.thousand = a.thousand
join int4_tbl i1 on b.thousand = f1
right join int4_tbl i2 on i2.f1 = b.tenthous
order by 1;
set enable_nestloop=false;
select b.unique1 from
tenk1 a join tenk1 b on a.unique1 = b.unique2
join int4_tbl i1 on b.thousand = f1
right join int4_tbl i2 on i2.f1 = b.tenthous
order by 1;
-- below portion is fixed, above portion not yet. TODO
drop table if exists mlparted;
drop table if exists mlparted1;
drop table if exists mlparted11;
create table mlparted (a int, b int) partition by range (a, b);
create table mlparted1 (b int not null, a int not null) partition by range ((b+0));
create table mlparted11 (like mlparted1);
alter table mlparted1 attach partition mlparted11 for values from (2) to (5);
alter table mlparted attach partition mlparted1 for values from (1, 2) to (1, 10);
with ins (a, b, c) as (insert into mlparted (b, a) select s.a, 1 from generate_series(2, 39) s(a) returning tableoid::regclass, *) select a, b, min(c), max(c) from ins group by a, b order by 1;
with ins (a, b, c) as (insert into mlparted (b, a) select s.a, 1 from generate_series(2, 39) s(a) returning tableoid::regclass, *) select a, b, min(c), max(c) from ins group by a, b order by 1;
-- bug 41
drop table if exists INT8_TBL;
CREATE TABLE INT8_TBL(id serial primary key, q1 int8, q2 int8);
INSERT INTO INT8_TBL (q1, q2) VALUES(' 123 ',' 456');
INSERT INTO INT8_TBL (q1, q2) VALUES('123 ','4567890123456789');
INSERT INTO INT8_TBL (q1, q2) VALUES('4567890123456789','123');
INSERT INTO INT8_TBL (q1, q2) VALUES(+4567890123456789,'4567890123456789');
INSERT INTO INT8_TBL (q1, q2) VALUES('+4567890123456789','-4567890123456789');
select q1, float8(count(*)) / (select count(*) from int8_tbl) from int8_tbl group by q1 order by q1;
-- bug 78
create table b1(v box);
-- bug 50 THIS BUG Is postponed
create user user1;
SET SESSION AUTHORIZATION user1;
SET row_security = on;
drop table if exists r1;
CREATE TABLE r1 (a int primary key);
INSERT INTO r1 VALUES (10), (20);
CREATE POLICY p1 ON r1 USING (false);
ALTER TABLE r1 ENABLE ROW LEVEL SECURITY;
ALTER TABLE r1 FORCE ROW LEVEL SECURITY;
TABLE r1;
INSERT INTO r1 VALUES (1);
UPDATE r1 SET a = 1;
DELETE FROM r1;
SET SESSION AUTHORIZATION dzw;
-- bug 57
drop table if exists temptest1;
begin;
CREATE TEMP TABLE temptest1(col int PRIMARY KEY);
insert into temptest1 values (1),(2);
select*from temptest1;
commit;
drop table if exists temptest2;
begin;
CREATE TEMP TABLE temptest2(col int PRIMARY KEY) ON COMMIT DELETE ROWS;
insert into temptest2 values (1),(2);
select*from temptest2;
commit;
-- bug 84
drop table if exists collate_test10;
CREATE TABLE collate_test10 (
a int primary key,
x varchar(50) COLLATE "C",
y varchar(50) COLLATE "POSIX"
);
INSERT INTO collate_test10 VALUES (1, 'hij', 'hij'), (2, 'HIJ', 'HIJ');
select x < y from collate_test10;
drop table if exists collate_test1;
drop table if exists collate_test2;
CREATE TABLE collate_test1 (id serial primary key, a int, b varchar(50) COLLATE "C" NOT NULL);
CREATE TABLE collate_test2 (id serial primary key, a int, b varchar(50) COLLATE "POSIX" );
INSERT INTO collate_test1 (a,b) VALUES (1, 'abc'), (2, 'Abc'), (3, 'bbc'), (4, 'ABD');
INSERT INTO collate_test2 (a,b) SELECT a,b FROM collate_test1;
SELECT a, b FROM collate_test2 WHERE a < 4 INTERSECT SELECT a, b FROM collate_test2 WHERE a > 1 ORDER BY 2;
-- bug 37
CREATE TABLE moneyp (a money) PARTITION BY LIST (a);
CREATE TABLE moneyp_10 PARTITION OF moneyp FOR VALUES IN (10);
drop table if exists list_parted;
CREATE TABLE list_parted (a int) PARTITION BY LIST (a);
CREATE TABLE part_1 PARTITION OF list_parted FOR VALUES IN ('1');
CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES IN (int '1');
CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES IN ('1'::int);
-- bug 72
drop table if exists onek;
CREATE TABLE onek (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 name,
stringu2 name,
string4 name
);
CREATE UNIQUE INDEX onek_idx ON onek (unique2 nulls first,unique1);
-- bug 34
drop table if exists part_attmp cascade;
CREATE TABLE part_attmp (a int primary key) partition by range (a);
CREATE TABLE part_attmp1 PARTITION OF part_attmp FOR VALUES FROM (0) TO (100);
ALTER INDEX part_attmp_pkey RENAME TO part_attmp_index;
ALTER INDEX part_attmp1_pkey RENAME TO part_attmp1_index;
alter table part_attmp add column b int;
create index part_attmp_b_idx on part_attmp(b);
ALTER INDEX part_attmp_b_idx RENAME TO part_attmp_b_index;
ALTER INDEX part_attmp1_b_idx RENAME TO part_attmp1_b_index;
-- bug 14
drop table if exists test_default_tab cascade;
CREATE TABLE test_default_tab(pk serial primary key, id int);
CREATE INDEX test_index1 on test_default_tab (id);
ALTER TABLE test_default_tab ALTER id TYPE bigint;
drop table if exists anothertab cascade;
create table anothertab(f1 int primary key, f2 int unique,f3 int, f4 int, f5 int);
alter table anothertab add unique(f1,f4);
create index on anothertab(f2,f3);
create unique index on anothertab(f4);
alter table anothertab alter column f1 type bigint;
alter table anothertab
alter column f2 type bigint,
alter column f3 type bigint,
alter column f4 type bigint;
create table at_partitioned(id int primary key, name varchar(64), unique (id, name)) partition by hash(id);
create table at_partitioned_1 partition of at_partitioned for values with (modulus 2, remainder 1);
alter table at_partitioned alter column name type varchar(127);
-- bug 24 this doesn't pass now. we have to disable DEFAULT partitions now.
-- drop table if exists range_parted2 cascade;
-- CREATE TABLE range_parted2 (a int primary key) PARTITION BY RANGE (a);
-- CREATE TABLE range2_default PARTITION OF range_parted2 DEFAULT;
-- INSERT INTO range_parted2 VALUES (85);
-- CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (80) TO (90);
-- CREATE TABLE part4 PARTITION OF range_parted2 FOR VALUES FROM (90) TO (100);
--
--
-- drop table if exists pc_list_parted cascade;
-- create table pc_list_parted (a int primary key) partition by list(a);
-- create table pc_list_part_1 partition of pc_list_parted for values in (1);
-- create table pc_list_part_2 partition of pc_list_parted for values in (2);
-- create table pc_list_part_def partition of pc_list_parted default;
-- create table pc_list_part_3 partition of pc_list_parted for values in (3);
--
-- drop table if exists quuux cascade;
-- CREATE TABLE quuux (a int primary key, b text) PARTITION BY LIST (a);
-- CREATE TABLE quuux_default PARTITION OF quuux DEFAULT PARTITION BY LIST (b);
-- CREATE TABLE quuux_default1 PARTITION OF quuux_default FOR VALUES IN ('b');
-- CREATE TABLE quuux1 (a int, b text);
-- ALTER TABLE quuux ATTACH PARTITION quuux1 FOR VALUES IN (1);
-- CREATE TABLE quuux2 (a int, b text);
-- ALTER TABLE quuux ATTACH PARTITION quuux2 FOR VALUES IN (2);
-- DROP TABLE quuux1;
-- DROP TABLE quuux2;
-- CREATE TABLE quuux1 PARTITION OF quuux FOR VALUES IN (1);
-- CREATE TABLE quuux2 PARTITION OF quuux FOR VALUES IN (2);
-- bug 62 this doesn't pass now. we have to disable 'ALTER TABLE ... ATTACH PARTITION' now.
-- CREATE TABLE list_parted2 (a int,b char) PARTITION BY LIST (a);
-- CREATE TABLE part_2 (LIKE list_parted2);
-- INSERT INTO part_2 VALUES (3, 'a');
-- ALTER TABLE list_parted2 ATTACH PARTITION part_2 FOR VALUES IN (2);
--
-- bug 56
drop table if exists pc_list_parted cascade;
create table pc_list_parted (a int primary key) partition by list(a);
create table pc_list_part_null partition of pc_list_parted for values in (null);
create table pc_list_part_1 partition of pc_list_parted for values in (1);
insert into pc_list_part_1 values(2);
-- bug 25
drop table if exists concur_heap;
CREATE TABLE concur_heap (id serial primary key, f1 int, f2 int);
insert into concur_heap (f1, f2) values(2,3),(3,5),(5,7),(7,11);
CREATE INDEX CONCURRENTLY concur_index1 ON concur_heap(f2,f1);
select*from concur_heap;
-- bug 110
drop table if exists INT8_TBL cascade;
CREATE TABLE INT8_TBL(q1 int8, q2 int8);
INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
INSERT INTO INT8_TBL VALUES('4567890123456789','123');
INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
create view tt17v as select * from int8_tbl i where i in (values(i));
select * from tt17v;
-- bug 111
drop table if exists persons;
drop type if exists person_type cascade;
CREATE TYPE person_type AS (id int, name varchar(50));
CREATE TABLE persons OF person_type;
-- bug 112
drop table if exists base_tbl cascade;
drop view if existrs rw_view1;
CREATE TABLE base_tbl (a int, b int DEFAULT 10);
INSERT INTO base_tbl VALUES (1,2), (2,3), (1,-1);
CREATE VIEW rw_view1 AS SELECT * FROM base_tbl WHERE a < b WITH LOCAL CHECK OPTION;
INSERT INTO rw_view1 values(3,2),(4,3), (3,4);
-- bug 114
drop table if exists update_test;
CREATE TABLE update_test (a INT DEFAULT 10, b INT, c TEXT);
INSERT INTO update_test VALUES (5, 10, 'foo');
INSERT INTO update_test(b, a) VALUES (15, 10);
UPDATE update_test t SET (a, b) = (SELECT b, a FROM update_test s WHERE s.a = t.a) WHERE CURRENT_USER = SESSION_USER;
-- bug 116
drop table if exists t1;
create table t1(pk int not null primary key);
ALTER TABLE t1 ADD COLUMN c_num NUMERIC DEFAULT 1.00000000001;
insert into t1 values(1),(2),(3),(4),(5);
select * from t1;
-- bug 126
drop table if exists t1;
create table t1(a int);
insert into t1 values(1),(2),(3);
update t1 set a=3 returning *;
delete from t1 returning *;
-- bug 127
-- TODO: verify the stmt is sent to ddl log after each ddl stmt. so far we don't have such test facility.
DROP SCHEMA if exists testschema cascade;
CREATE SCHEMA testschema;
CREATE TABLE testschema.part0 (a int) PARTITION BY LIST (a);
drop table testschema.part0;
CREATE TABLE testschema.part1 (a serial primary key, b int, c varchar(32), unique (b,a)) PARTITION BY LIST (a);
create index part1_b_c2 on testschema.part1(b,c);
create table testschema.part1_0 partition of testschema.part1 for values in (1,2,3,4);
create table testschema.part1_1 partition of testschema.part1 for values in (5,6,7,8);
insert into testschema.part1 (b,c) values(14, 'def'),(15,'efg'),(16,'fgh');
select*from testschema.part1 ;
create index part1_b_c on testschema.part1(b,c);
insert into testschema.part1 (b,c) values(17, 'ghi'),(18,'hij'),(19,'ijk');
select*from testschema.part1 ;
drop index testschema.part1_b_c;
insert into testschema.part1 (b,c) values(11, 'abc'),(12,'bcd'),(13,'cde');
select*from testschema.part1 ;
drop schema testschema cascade;
-- bug 121
drop table if exists indext1;
create table indext1(id integer);
ALTER TABLE indext1 ADD CONSTRAINT oindext1_id_constraint UNIQUE (id);
ALTER TABLE indext1 DROP CONSTRAINT oindext1_id_constraint;
CREATE TABLE part1 (a serial primary key, b int, c varchar(32), unique (b,a)) PARTITION BY LIST (a);
create index part1_b_c2 on part1(b,c);
create table part1_0 partition of part1 for values in (1,2,3,4);
insert into part1 (b,c) values(11, 'abc'),(12,'bcd'),(13,'cde');
select*from part1;
ALTER TABLE part1 ADD CONSTRAINT opart1_c_constraint UNIQUE (c,a);
create table part1_1 partition of part1 for values in (5,6,7,8);
insert into part1 (b,c) values(14, 'def'),(15,'efg'),(16,'fgh');
alter table part1 add column d int not null;
select*from part1;
create table part1_2 partition of part1 for values in (9,10,11,12);
insert into part1 (b,c,d) values(17, 'ghi', 21),(18,'hij',22),(19,'ijk',23);
select*from part1;
ALTER TABLE part1 ADD CONSTRAINT opart1_b_constraint UNIQUE (b,a);
create table part1_3 partition of part1 for values in (13,14,15,16);
insert into part1 (b,c,d) values(20, 'jkl', 24),(21,'klm',25),(22,'lmn',26);
ALTER TABLE part1 ADD CONSTRAINT opart1_d_constraint UNIQUE (d,a);
ALTER TABLE part1 DROP CONSTRAINT opart1_c_constraint;
ALTER TABLE part1 DROP CONSTRAINT opart1_d_constraint;
ALTER TABLE part1 DROP CONSTRAINT opart1_b_constraint;
drop index part1_b_c2;
drop table part1;
-- bug 135
drop table if exists t1 cascade;
create table t1(v1 decimal(10,2));
insert into t1 values(1.1), (2.2);
select*from t1;
update t1 set v1 = v1 + 1;
select*from t1;
PREPARE pq1(int, int) AS SELECT * FROM t1 WHERE v1 between $1 and $2;
EXECUTE pq1(-4, 4);
PREPARE pq2(int) AS update t1 set v1=v1+$1;
EXECUTE pq2(1);
select*from t1;
PREPARE pq3(float) AS update t1 set v1=v1+$1;
EXECUTE pq3(2.0);
PREPARE pq4(float, float) AS SELECT * FROM t1 WHERE v1 between $1 and $2;
EXECUTE pq4(-8.0, 8.0);
-- bug 190
drop table if exists t2 cascade;
create table t2(id int primary key, good boolean);
insert into t2 values(1, true);
insert into t2 values(2, false);
update t2 set good = false where id = 1;
-- bug 199
drop table if exists t4 cascade;
create table t4(a money);
insert into t4 values(999);
insert into t4 values(1000);
insert into t4 values (-92233720368547758.08);
insert into t4 values (+92233720368547758.07);
select*from t4;
insert into t4 values (-92233720368547758.09); -- bigint out of range
insert into t4 values (+92233720368547758.08); -- bigint out of range
insert into t4 values (-1111);
select*from t4;
-- bug 94
drop table if exists FLOAT4_TBL cascade;
CREATE TABLE FLOAT4_TBL (f1 float4);
INSERT INTO FLOAT4_TBL(f1) VALUES (' 0.0');
INSERT INTO FLOAT4_TBL(f1) VALUES ('1004.30 ');
INSERT INTO FLOAT4_TBL(f1) VALUES (' -34.84 ');
INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e+20');
INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20');
select f1 from float4_tbl;
SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 = 1004.3;
SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3';
-- bug 118 Bad results for partition join query when SET enable_partitionwise_join to true
SET enable_partitionwise_join TO true;
drop table if exists pagg_tab1;
CREATE TABLE pagg_tab1(x int, y int) PARTITION BY RANGE(x);
CREATE TABLE pagg_tab1_p1 PARTITION OF pagg_tab1 FOR VALUES FROM (0) TO (10);
CREATE TABLE pagg_tab1_p2 PARTITION OF pagg_tab1 FOR VALUES FROM (10) TO (20);
CREATE TABLE pagg_tab1_p3 PARTITION OF pagg_tab1 FOR VALUES FROM (20) TO (30);
drop table if exists pagg_tab2;
CREATE TABLE pagg_tab2(x int, y int) PARTITION BY RANGE(y);
CREATE TABLE pagg_tab2_p1 PARTITION OF pagg_tab2 FOR VALUES FROM (0) TO (10);
CREATE TABLE pagg_tab2_p2 PARTITION OF pagg_tab2 FOR VALUES FROM (10) TO (20);
CREATE TABLE pagg_tab2_p3 PARTITION OF pagg_tab2 FOR VALUES FROM (20) TO (30);
INSERT INTO pagg_tab1 SELECT i % 30, i % 20 FROM generate_series(0, 299, 2) i;
INSERT INTO pagg_tab2 SELECT i % 20, i % 30 FROM generate_series(0, 299, 3) i;
DROP TABLE if exists prt1 cascade;
CREATE TABLE prt1 (a int, b int, c varchar) PARTITION BY RANGE(a);
CREATE TABLE prt1_p1 PARTITION OF prt1 FOR VALUES FROM (0) TO (250);
CREATE TABLE prt1_p3 PARTITION OF prt1 FOR VALUES FROM (500) TO (600);
CREATE TABLE prt1_p2 PARTITION OF prt1 FOR VALUES FROM (250) TO (500);
INSERT INTO prt1 SELECT i, i % 25, to_char(i, 'FM0000') FROM generate_series(0, 599) i WHERE i % 2 = 0;
DROP TABLE if exists prt2 cascade;
CREATE TABLE prt2 (a int, b int, c varchar) PARTITION BY RANGE(b);
CREATE TABLE prt2_p1 PARTITION OF prt2 FOR VALUES FROM (0) TO (250);
CREATE TABLE prt2_p2 PARTITION OF prt2 FOR VALUES FROM (250) TO (500);
CREATE TABLE prt2_p3 PARTITION OF prt2 FOR VALUES FROM (500) TO (600);
INSERT INTO prt2 SELECT i % 25, i, to_char(i, 'FM0000') FROM generate_series(0, 599) i WHERE i % 3 = 0;
DROP TABLE if exists prt1_e;
CREATE TABLE prt1_e (a int, b int, c int) PARTITION BY RANGE(((a + b)/2));
CREATE TABLE prt1_e_p1 PARTITION OF prt1_e FOR VALUES FROM (0) TO (250);
CREATE TABLE prt1_e_p2 PARTITION OF prt1_e FOR VALUES FROM (250) TO (500);
CREATE TABLE prt1_e_p3 PARTITION OF prt1_e FOR VALUES FROM (500) TO (600);
INSERT INTO prt1_e SELECT i, i, i % 25 FROM generate_series(0, 599, 2) i;
DROP TABLE if exists prt2_e;
CREATE TABLE prt2_e (a int, b int, c int) PARTITION BY RANGE(((b + a)/2));
CREATE TABLE prt2_e_p1 PARTITION OF prt2_e FOR VALUES FROM (0) TO (250);
CREATE TABLE prt2_e_p2 PARTITION OF prt2_e FOR VALUES FROM (250) TO (500);
CREATE TABLE prt2_e_p3 PARTITION OF prt2_e FOR VALUES FROM (500) TO (600);
INSERT INTO prt2_e SELECT i, i, i % 25 FROM generate_series(0, 599, 3) i;
set enable_hashjoin=false;
set enable_mergejoin=false;
set enable_nestloop=true;
SELECT t1.x, sum(t1.y), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2.y GROUP BY t1.x ORDER BY 1, 2, 3;
SELECT t1.y, sum(t1.x), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2.y GROUP BY t1.y HAVING avg(t1.x) > 10 ORDER BY 1, 2, 3;
SELECT b.y, sum(a.y) FROM pagg_tab1 a LEFT JOIN pagg_tab2 b ON a.x = b.y GROUP BY b.y ORDER BY 1 NULLS LAST;
SELECT b.y, sum(a.y) FROM pagg_tab1 a RIGHT JOIN pagg_tab2 b ON a.x = b.y GROUP BY b.y ORDER BY 1 NULLS LAST;
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1 RIGHT JOIN prt2 t2 ON t1.a = t2.b WHERE t2.a = 0 ORDER BY t1.a, t2.b;
SELECT sum(t1.a), avg(t1.a), sum(t1.b), avg(t1.b) FROM prt1 t1 WHERE NOT EXISTS (SELECT 1 FROM prt2 t2 WHERE t1.a = t2.b);
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_e t1, prt2_e t2 WHERE (t1.a + t1.b)/2 = (t2.b + t2.a)/2 AND t1.c = 0 ORDER BY t1.a, t2.b;
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b) LEFT JOIN prt1_e t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t1.b = 0 ORDER BY t1.a, t2.b, t3.a + t3.b;
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b) RIGHT JOIN prt1_e t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t3.c = 0 ORDER BY t1.a, t2.b, t3.a + t3.b;
EXPLAIN (COSTS OFF)
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b) RIGHT JOIN prt1_e t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t3.c = 0 ORDER BY t1.a, t2.b, t3.a + t3.b;
SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1, prt1_e t2 WHERE t1.a = 0 AND t1.b = (t2.a + t2.b)/2) AND t1.b = 0 ORDER BY t1.a;
explain SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1, prt1_e t2 WHERE t1.a = 0 AND t1.b = (t2.a + t2.b)/2) AND t1.b = 0 ORDER BY t1.a;
set enable_hashjoin=true;
set enable_mergejoin=false;
set enable_nestloop=false;
SELECT t1.x, sum(t1.y), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2.y GROUP BY t1.x ORDER BY 1, 2, 3;
SELECT t1.y, sum(t1.x), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2.y GROUP BY t1.y HAVING avg(t1.x) > 10 ORDER BY 1, 2, 3;
SELECT b.y, sum(a.y) FROM pagg_tab1 a LEFT JOIN pagg_tab2 b ON a.x = b.y GROUP BY b.y ORDER BY 1 NULLS LAST;
SELECT b.y, sum(a.y) FROM pagg_tab1 a RIGHT JOIN pagg_tab2 b ON a.x = b.y GROUP BY b.y ORDER BY 1 NULLS LAST;
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1 RIGHT JOIN prt2 t2 ON t1.a = t2.b WHERE t2.a = 0 ORDER BY t1.a, t2.b;
SELECT sum(t1.a), avg(t1.a), sum(t1.b), avg(t1.b) FROM prt1 t1 WHERE NOT EXISTS (SELECT 1 FROM prt2 t2 WHERE t1.a = t2.b);
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_e t1, prt2_e t2 WHERE (t1.a + t1.b)/2 = (t2.b + t2.a)/2 AND t1.c = 0 ORDER BY t1.a, t2.b;
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b) LEFT JOIN prt1_e t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t1.b = 0 ORDER BY t1.a, t2.b, t3.a + t3.b;
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b) RIGHT JOIN prt1_e t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t3.c = 0 ORDER BY t1.a, t2.b, t3.a + t3.b;
EXPLAIN (COSTS OFF)
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b) RIGHT JOIN prt1_e t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t3.c = 0 ORDER BY t1.a, t2.b, t3.a + t3.b;
SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1, prt1_e t2 WHERE t1.a = 0 AND t1.b = (t2.a + t2.b)/2) AND t1.b = 0 ORDER BY t1.a;
explain SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1, prt1_e t2 WHERE t1.a = 0 AND t1.b = (t2.a + t2.b)/2) AND t1.b = 0 ORDER BY t1.a;
set enable_hashjoin=false;
set enable_mergejoin=true;
set enable_nestloop=false;
SELECT t1.x, sum(t1.y), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2.y GROUP BY t1.x ORDER BY 1, 2, 3;
SELECT t1.y, sum(t1.x), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2.y GROUP BY t1.y HAVING avg(t1.x) > 10 ORDER BY 1, 2, 3;
SELECT b.y, sum(a.y) FROM pagg_tab1 a LEFT JOIN pagg_tab2 b ON a.x = b.y GROUP BY b.y ORDER BY 1 NULLS LAST;
SELECT b.y, sum(a.y) FROM pagg_tab1 a RIGHT JOIN pagg_tab2 b ON a.x = b.y GROUP BY b.y ORDER BY 1 NULLS LAST;
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1 RIGHT JOIN prt2 t2 ON t1.a = t2.b WHERE t2.a = 0 ORDER BY t1.a, t2.b;
SELECT sum(t1.a), avg(t1.a), sum(t1.b), avg(t1.b) FROM prt1 t1 WHERE NOT EXISTS (SELECT 1 FROM prt2 t2 WHERE t1.a = t2.b);
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_e t1, prt2_e t2 WHERE (t1.a + t1.b)/2 = (t2.b + t2.a)/2 AND t1.c = 0 ORDER BY t1.a, t2.b;
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b) LEFT JOIN prt1_e t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t1.b = 0 ORDER BY t1.a, t2.b, t3.a + t3.b;
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b) RIGHT JOIN prt1_e t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t3.c = 0 ORDER BY t1.a, t2.b, t3.a + t3.b;
EXPLAIN (COSTS OFF)
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b) RIGHT JOIN prt1_e t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t3.c = 0 ORDER BY t1.a, t2.b, t3.a + t3.b;
SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1, prt1_e t2 WHERE t1.a = 0 AND t1.b = (t2.a + t2.b)/2) AND t1.b = 0 ORDER BY t1.a;
explain SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1, prt1_e t2 WHERE t1.a = 0 AND t1.b = (t2.a + t2.b)/2) AND t1.b = 0 ORDER BY t1.a; | the_stack |
-- This file is used to setup the database tables and load the NIBRS
-- code lookup tables. It only needs to be run once before you load
-- any data tables using postgres_load.sql
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: count_estimate(text); Type: FUNCTION; Schema: public;
-- A function for doing quick counts if you need it
--
CREATE FUNCTION count_estimate(query text) RETURNS bigint
LANGUAGE plpgsql
AS $$
DECLARE
rec record;
ROWS BIGINT;
BEGIN
FOR rec IN EXECUTE 'EXPLAIN ' || query LOOP
ROWS := SUBSTRING(rec."QUERY PLAN" FROM ' rows=([[:digit:]]+)');
EXIT WHEN ROWS IS NOT NULL;
END LOOP;
RETURN ROWS;
END
$$;
ALTER FUNCTION public.count_estimate(query text) OWNER TO chipmunk;
--
-- CODE TABLES
--
-- This is not a standard UCR table but one derived from the reta_month/nibrs_month
CREATE TABLE agency_participation (
year smallint NOT NULL,
state_name character varying(100),
state_abbr character varying(2),
agency_id bigint NOT NULL,
agency_ori character(9),
agency_name character varying(100),
agency_population bigint,
population_group_code character varying(2),
population_group character varying(150),
reported integer,
months_reported integer,
nibrs_reported integer,
nibrs_months_reported integer,
covered integer,
participated integer,
nibrs_participated integer
);
CREATE TABLE cde_agencies (
agency_id bigint NOT NULL,
ori character(9) NOT NULL,
legacy_ori character(9) NOT NULL,
agency_name text,
short_name text,
agency_type_id smallint NOT NULL,
agency_type_name text,
tribe_id bigint,
campus_id bigint,
city_id bigint,
city_name text,
state_id smallint NOT NULL,
state_abbr character(2) NOT NULL,
primary_county_id bigint,
primary_county text,
primary_county_fips character varying(5),
agency_status character(1),
submitting_agency_id bigint,
submitting_sai character varying(9),
submitting_name text,
submitting_state_abbr character varying(2),
start_year smallint,
dormant_year smallint,
current_year smallint,
revised_rape_start smallint,
current_nibrs_start_year smallint,
population bigint,
population_group_code character varying(2),
population_group_desc text,
population_source_flag character varying(1),
suburban_area_flag character varying(1),
core_city_flag character varying(1),
months_reported smallint,
nibrs_months_reported smallint,
past_10_years_reported smallint,
covered_by_id bigint,
covered_by_ori character(9),
covered_by_name character varying(100),
staffing_year smallint,
total_officers integer,
total_civilians integer,
icpsr_zip character(5),
icpsr_lat numeric,
icpsr_lng numeric
);
CREATE TABLE nibrs_activity_type (
activity_type_id smallint NOT NULL,
activity_type_code character(2),
activity_type_name character varying(100)
);
CREATE TABLE nibrs_age (
age_id smallint NOT NULL,
age_code character(2),
age_name character varying(100)
);
CREATE TABLE nibrs_arrest_type (
arrest_type_id smallint NOT NULL,
arrest_type_code character(1),
arrest_type_name character varying(100)
);
CREATE TABLE nibrs_assignment_type (
assignment_type_id smallint NOT NULL,
assignment_type_code character(1),
assignment_type_name character varying(100)
);
CREATE TABLE nibrs_bias_list (
bias_id smallint NOT NULL,
bias_code character(2),
bias_name character varying(100)
);
CREATE TABLE nibrs_location_type (
location_id bigint NOT NULL,
location_code character(2),
location_name character varying(100)
);
CREATE TABLE nibrs_offense_type (
offense_type_id bigint NOT NULL,
offense_code character varying(5),
offense_name character varying(100),
crime_against character varying(100),
ct_flag character(1),
hc_flag character(1),
hc_code character varying(5),
offense_category_name character varying(100)
);
CREATE TABLE nibrs_prop_desc_type (
prop_desc_id smallint NOT NULL,
prop_desc_code character(2),
prop_desc_name character varying(100)
);
CREATE TABLE nibrs_victim_type (
victim_type_id smallint NOT NULL,
victim_type_code character(1),
victim_type_name character varying(100)
);
CREATE TABLE nibrs_circumstances (
circumstances_id smallint NOT NULL,
circumstances_type character(1),
circumstances_code smallint,
circumstances_name character varying(100)
);
CREATE TABLE nibrs_cleared_except (
cleared_except_id smallint NOT NULL,
cleared_except_code character(1),
cleared_except_name character varying(100)
);
CREATE TABLE nibrs_criminal_act (
criminal_act_id smallint NOT NULL,
offense_id bigint NOT NULL
);
CREATE TABLE nibrs_criminal_act_type (
criminal_act_id smallint NOT NULL,
criminal_act_code character(1),
criminal_act_name character varying(100)
);
CREATE TABLE nibrs_drug_measure_type (
drug_measure_type_id smallint NOT NULL,
drug_measure_code character(2),
drug_measure_name character varying(100)
);
CREATE TABLE nibrs_ethnicity (
ethnicity_id smallint NOT NULL,
ethnicity_code character(1),
ethnicity_name character varying(100),
hc_flag character varying(1) DEFAULT 'Y'::character varying
);
CREATE TABLE nibrs_injury (
injury_id smallint NOT NULL,
injury_code character(1),
injury_name character varying(100)
);
CREATE TABLE nibrs_justifiable_force (
justifiable_force_id smallint NOT NULL,
justifiable_force_code character(1),
justifiable_force_name character varying(100)
);
CREATE TABLE nibrs_prop_loss_type (
prop_loss_id smallint NOT NULL,
prop_loss_name character varying(100)
);
CREATE TABLE nibrs_relationship (
relationship_id smallint NOT NULL,
relationship_code character(2),
relationship_name character varying(100)
);
CREATE TABLE nibrs_suspected_drug_type (
suspected_drug_type_id smallint NOT NULL,
suspected_drug_code character(1),
suspected_drug_name character varying(100)
);
CREATE TABLE nibrs_using_list (
suspect_using_id smallint NOT NULL,
suspect_using_code character(1),
suspect_using_name character varying(100)
);
CREATE TABLE nibrs_weapon_type (
weapon_id smallint NOT NULL,
weapon_code character varying(3),
weapon_name character varying(100),
shr_flag character(1)
);
CREATE TABLE ref_race (
race_id smallint NOT NULL,
race_code character varying(2) NOT NULL,
race_desc character varying(100) NOT NULL,
sort_order smallint,
start_year smallint,
end_year smallint,
notes character varying(1000)
);
CREATE TABLE ref_state (
state_id smallint NOT NULL,
division_id smallint NOT NULL,
state_name character varying(100),
state_code character varying(2),
state_abbr character varying(2),
state_postal_abbr character varying(2),
state_fips_code character varying(2),
state_pub_freq_months smallint
);
--
-- Main NIBRS tables
--
CREATE TABLE nibrs_arrestee (
arrestee_id bigint NOT NULL,
incident_id bigint NOT NULL,
arrestee_seq_num bigint,
arrest_num character varying(12),
arrest_date timestamp without time zone,
arrest_type_id smallint,
multiple_indicator character(1),
offense_type_id bigint NOT NULL,
age_id smallint NOT NULL,
age_num smallint,
sex_code character(1),
race_id smallint NOT NULL,
ethnicity_id smallint,
resident_code character(1),
under_18_disposition_code character(1),
clearance_ind character(1),
ff_line_number bigint,
age_range_low_num smallint,
age_range_high_num smallint
);
CREATE TABLE nibrs_arrestee_weapon (
arrestee_id bigint NOT NULL,
weapon_id smallint NOT NULL,
nibrs_arrestee_weapon_id bigint NOT NULL
);
CREATE TABLE nibrs_bias_motivation (
bias_id smallint NOT NULL,
offense_id bigint NOT NULL
);
CREATE TABLE nibrs_month (
nibrs_month_id bigint NOT NULL,
agency_id bigint NOT NULL,
month_num smallint NOT NULL,
data_year smallint NOT NULL,
reported_status character varying(1),
report_date timestamp without time zone,
prepared_date timestamp without time zone,
update_flag character(1) DEFAULT 'NULL'::bpchar NOT NULL,
orig_format character(1) DEFAULT 'NULL'::bpchar NOT NULL,
ff_line_number bigint,
data_home character varying(1),
ddocname character varying(50),
did bigint
);
COMMENT ON COLUMN nibrs_month.orig_format IS 'This is the format the report was in when it was first submitted to the system. F for Flat File, W for Web Form, U for IEPDXML Upload, S for IEPDXML Service, B for BPEL, N for null or unavailable, and M for Multiple. When summarizing NIBRS data into the _month tables, a single months data could come from multiple sources. If so the entry will be M';
CREATE TABLE nibrs_incident (
agency_id bigint NOT NULL,
incident_id bigint NOT NULL,
nibrs_month_id bigint NOT NULL,
incident_number character varying(15),
cargo_theft_flag character(1),
submission_date timestamp without time zone,
incident_date timestamp without time zone,
report_date_flag character(1),
incident_hour smallint,
cleared_except_id smallint NOT NULL,
cleared_except_date timestamp without time zone,
incident_status smallint,
data_home character(1),
ddocname character varying(100),
orig_format character(1),
ff_line_number bigint,
did bigint
);
COMMENT ON COLUMN nibrs_incident.orig_format IS 'This is the format the report was in when it was first submitted to the system. F for Flat File, W for Web Form, U for IEPDXML Upload, S for IEPDXML Service, B for BPEL, N for null or unavailable.';
CREATE TABLE nibrs_offender (
offender_id bigint NOT NULL,
incident_id bigint NOT NULL,
offender_seq_num smallint,
age_id smallint,
age_num smallint,
sex_code character(1),
race_id smallint,
ethnicity_id smallint,
ff_line_number bigint,
age_range_low_num smallint,
age_range_high_num smallint
);
CREATE TABLE nibrs_offense (
offense_id bigint NOT NULL,
incident_id bigint NOT NULL,
offense_type_id bigint NOT NULL,
attempt_complete_flag character(1),
location_id bigint NOT NULL,
num_premises_entered smallint,
method_entry_code character(1),
ff_line_number bigint
);
CREATE TABLE nibrs_property (
property_id bigint NOT NULL,
incident_id bigint NOT NULL,
prop_loss_id smallint NOT NULL,
stolen_count smallint,
recovered_count smallint,
ff_line_number bigint
);
CREATE TABLE nibrs_property_desc (
property_id bigint NOT NULL,
prop_desc_id smallint NOT NULL,
property_value bigint,
date_recovered timestamp without time zone,
nibrs_prop_desc_id bigint NOT NULL
);
CREATE TABLE nibrs_suspect_using (
suspect_using_id smallint NOT NULL,
offense_id bigint NOT NULL
);
CREATE TABLE nibrs_suspected_drug (
suspected_drug_type_id smallint NOT NULL,
property_id bigint NOT NULL,
est_drug_qty double precision,
drug_measure_type_id smallint,
nibrs_suspected_drug_id bigint NOT NULL
);
CREATE TABLE nibrs_victim (
victim_id bigint NOT NULL,
incident_id bigint NOT NULL,
victim_seq_num smallint,
victim_type_id smallint NOT NULL,
assignment_type_id smallint,
activity_type_id smallint,
outside_agency_id bigint,
age_id smallint,
age_num smallint,
sex_code character(1),
race_id smallint,
ethnicity_id smallint,
resident_status_code character(1),
agency_data_year smallint,
ff_line_number bigint,
age_range_low_num smallint,
age_range_high_num smallint
);
CREATE TABLE nibrs_victim_circumstances (
victim_id bigint NOT NULL,
circumstances_id smallint NOT NULL,
justifiable_force_id smallint
);
CREATE TABLE nibrs_victim_injury (
victim_id bigint NOT NULL,
injury_id smallint NOT NULL
);
CREATE TABLE nibrs_victim_offender_rel (
victim_id bigint NOT NULL,
offender_id bigint NOT NULL,
relationship_id smallint NOT NULL,
nibrs_victim_offender_id bigint NOT NULL
);
CREATE TABLE nibrs_victim_offense (
victim_id bigint NOT NULL,
offense_id bigint NOT NULL
);
CREATE TABLE nibrs_weapon (
weapon_id smallint NOT NULL,
offense_id bigint NOT NULL,
nibrs_weapon_id bigint NOT NULL
);
--
-- Table loading
--
\COPY nibrs_activity_type FROM 'nibrs_activity_type.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_age FROM 'nibrs_age.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_arrest_type FROM 'nibrs_arrest_type.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_assignment_type FROM 'nibrs_assignment_type.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_bias_list FROM 'nibrs_bias_list.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_circumstances FROM 'nibrs_circumstances.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_cleared_except FROM 'nibrs_cleared_except.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_criminal_act_type FROM 'nibrs_criminal_act_type.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_drug_measure_type FROM 'nibrs_drug_measure_type.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_ethnicity FROM 'nibrs_ethnicity.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_injury FROM 'nibrs_injury.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_justifiable_force FROM 'nibrs_justifiable_force.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_location_type FROM 'nibrs_location_type.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_offense_type FROM 'nibrs_offense_type.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_prop_desc_type FROM 'nibrs_prop_desc_type.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_prop_loss_type FROM 'nibrs_prop_loss_type.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_relationship FROM 'nibrs_relationship.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_suspected_drug_type FROM 'nibrs_suspected_drug_type.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_using_list FROM 'nibrs_using_list.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_victim_type FROM 'nibrs_victim_type.csv' DELIMITER ',' HEADER CSV;
\COPY nibrs_weapon_type FROM 'nibrs_weapon_type.csv' DELIMITER ',' HEADER CSV;
\COPY ref_race FROM 'ref_race.csv' DELIMITER ',' HEADER CSV;
\COPY ref_state FROM 'ref_state.csv' DELIMITER ',' HEADER CSV;
--
-- Indexes
--
ALTER TABLE ONLY cde_agencies
ADD CONSTRAINT cde_agencies_pkey PRIMARY KEY (agency_id);
ALTER TABLE ONLY nibrs_activity_type
ADD CONSTRAINT nibrs_activity_type_pkey PRIMARY KEY (activity_type_id);
ALTER TABLE ONLY nibrs_age
ADD CONSTRAINT nibrs_age_pkey PRIMARY KEY (age_id);
ALTER TABLE ONLY nibrs_arrest_type
ADD CONSTRAINT nibrs_arrest_type_pkey PRIMARY KEY (arrest_type_id);
ALTER TABLE ONLY nibrs_arrestee
ADD CONSTRAINT nibrs_arrestee_pkey PRIMARY KEY (arrestee_id);
ALTER TABLE ONLY nibrs_arrestee_weapon
ADD CONSTRAINT nibrs_arrestee_weapon_pkey PRIMARY KEY (nibrs_arrestee_weapon_id);
ALTER TABLE ONLY nibrs_assignment_type
ADD CONSTRAINT nibrs_assignment_type_pkey PRIMARY KEY (assignment_type_id);
ALTER TABLE ONLY nibrs_bias_list
ADD CONSTRAINT nibrs_bias_list_pkey PRIMARY KEY (bias_id);
ALTER TABLE ONLY nibrs_bias_motivation
ADD CONSTRAINT nibrs_bias_motivation_pkey PRIMARY KEY (bias_id, offense_id);
ALTER TABLE ONLY nibrs_circumstances
ADD CONSTRAINT nibrs_circumstances_pkey PRIMARY KEY (circumstances_id);
ALTER TABLE ONLY nibrs_cleared_except
ADD CONSTRAINT nibrs_cleared_except_pkey PRIMARY KEY (cleared_except_id);
ALTER TABLE ONLY nibrs_criminal_act
ADD CONSTRAINT nibrs_criminal_act_pkey PRIMARY KEY (criminal_act_id, offense_id);
ALTER TABLE ONLY nibrs_criminal_act_type
ADD CONSTRAINT nibrs_criminal_act_type_pkey PRIMARY KEY (criminal_act_id);
ALTER TABLE ONLY nibrs_drug_measure_type
ADD CONSTRAINT nibrs_drug_measure_type_pkey PRIMARY KEY (drug_measure_type_id);
ALTER TABLE ONLY nibrs_ethnicity
ADD CONSTRAINT nibrs_ethnicity_pkey PRIMARY KEY (ethnicity_id);
ALTER TABLE ONLY nibrs_incident
ADD CONSTRAINT nibrs_incident_pkey PRIMARY KEY (incident_id);
ALTER TABLE ONLY nibrs_injury
ADD CONSTRAINT nibrs_injury_pkey PRIMARY KEY (injury_id);
ALTER TABLE ONLY nibrs_justifiable_force
ADD CONSTRAINT nibrs_justifiable_force_pkey PRIMARY KEY (justifiable_force_id);
ALTER TABLE ONLY nibrs_location_type
ADD CONSTRAINT nibrs_location_type_pkey PRIMARY KEY (location_id);
ALTER TABLE ONLY nibrs_month
ADD CONSTRAINT nibrs_month_pkey PRIMARY KEY (nibrs_month_id);
ALTER TABLE ONLY nibrs_offender
ADD CONSTRAINT nibrs_offender_pkey PRIMARY KEY (offender_id);
ALTER TABLE ONLY nibrs_offense
ADD CONSTRAINT nibrs_offense_pkey PRIMARY KEY (offense_id);
ALTER TABLE ONLY nibrs_offense_type
ADD CONSTRAINT nibrs_offense_type_pkey PRIMARY KEY (offense_type_id);
ALTER TABLE ONLY nibrs_prop_desc_type
ADD CONSTRAINT nibrs_prop_desc_type_pkey PRIMARY KEY (prop_desc_id);
ALTER TABLE ONLY nibrs_prop_loss_type
ADD CONSTRAINT nibrs_prop_loss_type_pkey PRIMARY KEY (prop_loss_id);
ALTER TABLE ONLY nibrs_property_desc
ADD CONSTRAINT nibrs_property_desc_pkey PRIMARY KEY (nibrs_prop_desc_id);
ALTER TABLE ONLY nibrs_property
ADD CONSTRAINT nibrs_property_pkey PRIMARY KEY (property_id);
ALTER TABLE ONLY nibrs_relationship
ADD CONSTRAINT nibrs_relationship_pkey PRIMARY KEY (relationship_id);
ALTER TABLE ONLY nibrs_suspect_using
ADD CONSTRAINT nibrs_suspect_using_pkey PRIMARY KEY (suspect_using_id, offense_id);
ALTER TABLE ONLY nibrs_suspected_drug
ADD CONSTRAINT nibrs_suspected_drug_pkey PRIMARY KEY (nibrs_suspected_drug_id);
ALTER TABLE ONLY nibrs_suspected_drug_type
ADD CONSTRAINT nibrs_suspected_drug_type_pkey PRIMARY KEY (suspected_drug_type_id);
ALTER TABLE ONLY nibrs_using_list
ADD CONSTRAINT nibrs_using_list_pkey PRIMARY KEY (suspect_using_id);
ALTER TABLE ONLY nibrs_victim_circumstances
ADD CONSTRAINT nibrs_victim_circumstances_pkey PRIMARY KEY (victim_id, circumstances_id);
ALTER TABLE ONLY nibrs_victim_injury
ADD CONSTRAINT nibrs_victim_injury_pkey PRIMARY KEY (victim_id, injury_id);
ALTER TABLE ONLY nibrs_victim_offender_rel
ADD CONSTRAINT nibrs_victim_offender_rel_pkey PRIMARY KEY (nibrs_victim_offender_id);
ALTER TABLE ONLY nibrs_victim_offense
ADD CONSTRAINT nibrs_victim_offense_pkey PRIMARY KEY (victim_id, offense_id);
ALTER TABLE ONLY nibrs_victim
ADD CONSTRAINT nibrs_victim_pkey PRIMARY KEY (victim_id);
ALTER TABLE ONLY nibrs_victim_type
ADD CONSTRAINT nibrs_victim_type_pkey PRIMARY KEY (victim_type_id);
ALTER TABLE ONLY nibrs_weapon
ADD CONSTRAINT nibrs_weapon_pkey PRIMARY KEY (nibrs_weapon_id);
ALTER TABLE ONLY nibrs_weapon_type
ADD CONSTRAINT nibrs_weapon_type_pkey PRIMARY KEY (weapon_id);
ALTER TABLE ONLY ref_race
ADD CONSTRAINT ref_race_pkey PRIMARY KEY (race_id);
ALTER TABLE ONLY ref_state
ADD CONSTRAINT ref_state_pkey PRIMARY KEY (state_id);
--
-- Other indices
--
CREATE INDEX ni_incnum_agency ON nibrs_incident USING btree (agency_id, incident_number);
CREATE INDEX nibrs_arr_weapon_arrestee_id ON nibrs_arrestee_weapon USING btree (arrestee_id);
CREATE INDEX nibrs_arrest_weap_type_ix ON nibrs_arrestee_weapon USING btree (weapon_id);
CREATE INDEX nibrs_arrestee_age_id_idx ON nibrs_arrestee USING btree (age_id);
CREATE INDEX nibrs_arrestee_age_ix ON nibrs_arrestee USING btree (age_id);
CREATE INDEX nibrs_arrestee_arrest_type_id_idx ON nibrs_arrestee USING btree (arrest_type_id);
CREATE INDEX nibrs_arrestee_arrest_type_ix ON nibrs_arrestee USING btree (arrest_type_id);
CREATE INDEX nibrs_arrestee_ethnicity_id_idx ON nibrs_arrestee USING btree (ethnicity_id);
CREATE INDEX nibrs_arrestee_ethnicity_ix ON nibrs_arrestee USING btree (ethnicity_id);
CREATE INDEX nibrs_arrestee_inc_id ON nibrs_arrestee USING btree (incident_id);
CREATE INDEX nibrs_arrestee_nibrs_race_ix ON nibrs_arrestee USING btree (race_id);
CREATE INDEX nibrs_arrestee_offense_type_id_idx ON nibrs_arrestee USING btree (offense_type_id);
CREATE INDEX nibrs_arrestee_offense_type_ix ON nibrs_arrestee USING btree (offense_type_id);
CREATE INDEX nibrs_arrestee_race_id_idx ON nibrs_arrestee USING btree (race_id);
CREATE INDEX nibrs_arrestee_weapon_arrestee_id_idx ON nibrs_arrestee_weapon USING btree (arrestee_id);
CREATE INDEX nibrs_arrestee_weapon_weapon_id_idx ON nibrs_arrestee_weapon USING btree (weapon_id);
CREATE INDEX nibrs_bias_motiv_off_id ON nibrs_bias_motivation USING btree (offense_id);
CREATE INDEX nibrs_criminal_act_off_id ON nibrs_criminal_act USING btree (offense_id);
CREATE INDEX nibrs_incident_agency_id_idx ON nibrs_incident USING btree (agency_id);
CREATE INDEX nibrs_incident_clear_ex_ix ON nibrs_incident USING btree (cleared_except_id);
CREATE INDEX nibrs_incident_cleared_except_id_idx ON nibrs_incident USING btree (cleared_except_id);
CREATE INDEX nibrs_incident_incid_agency ON nibrs_incident USING btree (agency_id, incident_id);
CREATE INDEX nibrs_incident_index1 ON nibrs_incident USING btree (nibrs_month_id);
CREATE INDEX nibrs_incident_index2 ON nibrs_incident USING btree (incident_number);
CREATE INDEX nibrs_incident_status_idx ON nibrs_incident USING btree (incident_status);
CREATE INDEX nibrs_month_agency_id_idx ON nibrs_month USING btree (agency_id);
CREATE UNIQUE INDEX nibrs_month_un ON nibrs_month USING btree (agency_id, month_num, data_year);
CREATE INDEX nibrs_offender_age_id_idx ON nibrs_offender USING btree (age_id);
CREATE INDEX nibrs_offender_age_ix ON nibrs_offender USING btree (age_id);
CREATE INDEX nibrs_offender_ethnicity_id_idx ON nibrs_offender USING btree (ethnicity_id);
CREATE INDEX nibrs_offender_ethnicity_ix ON nibrs_offender USING btree (ethnicity_id);
CREATE INDEX nibrs_offender_inc_id ON nibrs_offender USING btree (incident_id);
CREATE INDEX nibrs_offender_race_id_idx ON nibrs_offender USING btree (race_id);
CREATE INDEX nibrs_offender_race_ix ON nibrs_offender USING btree (race_id);
CREATE INDEX nibrs_offense_loc_type_ix ON nibrs_offense USING btree (location_id);
CREATE INDEX nibrs_offense_location_id_idx ON nibrs_offense USING btree (location_id);
CREATE INDEX nibrs_offense_off_type_ix ON nibrs_offense USING btree (offense_type_id);
CREATE INDEX nibrs_offense_offense_type_id_idx ON nibrs_offense USING btree (offense_type_id);
CREATE INDEX nibrs_offense_x1 ON nibrs_offense USING btree (incident_id);
CREATE INDEX nibrs_prop_desc_date_rec_ix ON nibrs_property_desc USING btree (date_recovered);
CREATE INDEX nibrs_property_desc_desc_id_in ON nibrs_property_desc USING btree (prop_desc_id);
CREATE INDEX nibrs_property_desc_prop_desc_id_idx ON nibrs_property_desc USING btree (prop_desc_id);
CREATE INDEX nibrs_property_desc_property_id_idx ON nibrs_property_desc USING btree (property_id);
CREATE INDEX nibrs_property_loss_type_ix ON nibrs_property USING btree (prop_loss_id);
CREATE INDEX nibrs_property_prop_loss_id_idx ON nibrs_property USING btree (prop_loss_id);
CREATE INDEX nibrs_property_property_id_in ON nibrs_property_desc USING btree (property_id);
CREATE INDEX nibrs_property_x1 ON nibrs_property USING btree (incident_id);
CREATE INDEX nibrs_susp_drug_meas_type_ix ON nibrs_suspected_drug USING btree (drug_measure_type_id);
CREATE INDEX nibrs_susp_drug_prop_id ON nibrs_suspected_drug USING btree (property_id);
CREATE INDEX nibrs_susp_drug_type_ix ON nibrs_suspected_drug USING btree (suspected_drug_type_id);
CREATE INDEX nibrs_suspect_using_code_idx ON nibrs_using_list USING btree (suspect_using_code);
CREATE INDEX nibrs_suspect_using_off_id ON nibrs_suspect_using USING btree (offense_id);
CREATE INDEX nibrs_vic_circ_nibrs_circ_ix ON nibrs_victim_circumstances USING btree (circumstances_id);
CREATE INDEX nibrs_victim_circ_just_hom_ix ON nibrs_victim_circumstances USING btree (justifiable_force_id);
CREATE INDEX nibrs_vic_injury_nibrs_inj_ix ON nibrs_victim_injury USING btree (injury_id);
CREATE INDEX nibrs_victims_vic_type_ix ON nibrs_victim USING btree (victim_type_id);
CREATE INDEX nibrs_victim_x1 ON nibrs_victim USING btree (incident_id);
CREATE INDEX nibrs_victim_act_type_ix ON nibrs_victim USING btree (activity_type_id);
CREATE INDEX nibrs_victim_age_id_idx ON nibrs_victim USING btree (age_id);
CREATE INDEX nibrs_victim_assign_type_ix ON nibrs_victim USING btree (assignment_type_id);
CREATE INDEX nibrs_victim_ethnicity_id_idx ON nibrs_victim USING btree (ethnicity_id);
CREATE INDEX nibrs_victim_injury_injury_id_idx ON nibrs_victim_injury USING btree (injury_id);
CREATE INDEX nibrs_victim_off_rel_rel_ix ON nibrs_victim_offender_rel USING btree (relationship_id);
CREATE INDEX nibrs_victim_offender_rel_off ON nibrs_victim_offender_rel USING btree (offender_id);
CREATE INDEX nibrs_victim_offender_rel_vic ON nibrs_victim_offender_rel USING btree (victim_id);
CREATE INDEX nibrs_victim_offense_off_id ON nibrs_victim_offense USING btree (offense_id);
CREATE INDEX nibrs_victim_offense_vic_id ON nibrs_victim_offense USING btree (victim_id);
CREATE INDEX nibrs_victim_race_id_idx ON nibrs_victim USING btree (race_id);
CREATE INDEX nibrs_victim_victim_type_id_idx ON nibrs_victim USING btree (victim_type_id);
CREATE INDEX nibrs_weap_weap_type_ix ON nibrs_weapon USING btree (weapon_id);
CREATE INDEX nibrs_weapon_off_id ON nibrs_weapon USING btree (offense_id);
CREATE UNIQUE INDEX ref_race_code ON ref_race USING btree (race_code);
CREATE INDEX ref_race_sort_order ON ref_race USING btree (sort_order);
CREATE INDEX ref_state_lower_idx ON ref_state USING btree (lower((state_abbr)::text));
--
-- Foreign Keys
--
ALTER TABLE ONLY cde_agencies
ADD CONSTRAINT agencies_state_fk FOREIGN KEY (state_id) REFERENCES ref_state(state_id);
ALTER TABLE ONLY nibrs_arrestee_weapon
ADD CONSTRAINT nibrs_arrest_weap_arrest_fk FOREIGN KEY (arrestee_id) REFERENCES nibrs_arrestee(arrestee_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_arrestee_weapon
ADD CONSTRAINT nibrs_arrest_weap_type_fk FOREIGN KEY (weapon_id) REFERENCES nibrs_weapon_type(weapon_id);
ALTER TABLE ONLY nibrs_arrestee
ADD CONSTRAINT nibrs_arrestee_age_fk FOREIGN KEY (age_id) REFERENCES nibrs_age(age_id);
ALTER TABLE ONLY nibrs_arrestee
ADD CONSTRAINT nibrs_arrestee_arrest_type_fk FOREIGN KEY (arrest_type_id) REFERENCES nibrs_arrest_type(arrest_type_id);
ALTER TABLE ONLY nibrs_arrestee
ADD CONSTRAINT nibrs_arrestee_ethnicity_fk FOREIGN KEY (ethnicity_id) REFERENCES nibrs_ethnicity(ethnicity_id);
ALTER TABLE ONLY nibrs_arrestee
ADD CONSTRAINT nibrs_arrestee_inc_fk FOREIGN KEY (incident_id) REFERENCES nibrs_incident(incident_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_arrestee
ADD CONSTRAINT nibrs_arrestee_offense_type_fk FOREIGN KEY (offense_type_id) REFERENCES nibrs_offense_type(offense_type_id);
ALTER TABLE ONLY nibrs_arrestee
ADD CONSTRAINT nibrs_arrestee_race_fk FOREIGN KEY (race_id) REFERENCES ref_race(race_id);
ALTER TABLE ONLY nibrs_bias_motivation
ADD CONSTRAINT nibrs_bias_mot_list_fk FOREIGN KEY (bias_id) REFERENCES nibrs_bias_list(bias_id);
ALTER TABLE ONLY nibrs_bias_motivation
ADD CONSTRAINT nibrs_bias_mot_offense_fk FOREIGN KEY (offense_id) REFERENCES nibrs_offense(offense_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_criminal_act
ADD CONSTRAINT nibrs_criminal_act_offense_fk FOREIGN KEY (offense_id) REFERENCES nibrs_offense(offense_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_criminal_act
ADD CONSTRAINT nibrs_criminal_act_type_fk FOREIGN KEY (criminal_act_id) REFERENCES nibrs_criminal_act_type(criminal_act_id);
ALTER TABLE ONLY nibrs_incident
ADD CONSTRAINT nibrs_incident_clear_ex_fk FOREIGN KEY (cleared_except_id) REFERENCES nibrs_cleared_except(cleared_except_id);
ALTER TABLE ONLY nibrs_incident
ADD CONSTRAINT nibrs_incident_month_fk FOREIGN KEY (nibrs_month_id) REFERENCES nibrs_month(nibrs_month_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_offender
ADD CONSTRAINT nibrs_offender_age_fk FOREIGN KEY (age_id) REFERENCES nibrs_age(age_id);
ALTER TABLE ONLY nibrs_offender
ADD CONSTRAINT nibrs_offender_ethnicity_fk FOREIGN KEY (ethnicity_id) REFERENCES nibrs_ethnicity(ethnicity_id);
ALTER TABLE ONLY nibrs_offender
ADD CONSTRAINT nibrs_offender_nibrs_inci_fk1 FOREIGN KEY (incident_id) REFERENCES nibrs_incident(incident_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_offender
ADD CONSTRAINT nibrs_offender_race_fk FOREIGN KEY (race_id) REFERENCES ref_race(race_id);
ALTER TABLE ONLY nibrs_offense
ADD CONSTRAINT nibrs_offense_inc_fk1 FOREIGN KEY (incident_id) REFERENCES nibrs_incident(incident_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_offense
ADD CONSTRAINT nibrs_offense_loc_type_fk FOREIGN KEY (location_id) REFERENCES nibrs_location_type(location_id);
ALTER TABLE ONLY nibrs_offense
ADD CONSTRAINT nibrs_offense_off_type_fk FOREIGN KEY (offense_type_id) REFERENCES nibrs_offense_type(offense_type_id);
ALTER TABLE ONLY nibrs_property_desc
ADD CONSTRAINT nibrs_prop_desc_prop_fk FOREIGN KEY (property_id) REFERENCES nibrs_property(property_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_property_desc
ADD CONSTRAINT nibrs_prop_desc_type_fk FOREIGN KEY (prop_desc_id) REFERENCES nibrs_prop_desc_type(prop_desc_id);
ALTER TABLE ONLY nibrs_property
ADD CONSTRAINT nibrs_property_inc_fk FOREIGN KEY (incident_id) REFERENCES nibrs_incident(incident_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_property
ADD CONSTRAINT nibrs_property_loss_type_fk FOREIGN KEY (prop_loss_id) REFERENCES nibrs_prop_loss_type(prop_loss_id);
ALTER TABLE ONLY nibrs_suspected_drug
ADD CONSTRAINT nibrs_susp_drug_meas_type_fk FOREIGN KEY (drug_measure_type_id) REFERENCES nibrs_drug_measure_type(drug_measure_type_id);
ALTER TABLE ONLY nibrs_suspected_drug
ADD CONSTRAINT nibrs_susp_drug_prop_fk FOREIGN KEY (property_id) REFERENCES nibrs_property(property_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_suspected_drug
ADD CONSTRAINT nibrs_susp_drug_type_fk FOREIGN KEY (suspected_drug_type_id) REFERENCES nibrs_suspected_drug_type(suspected_drug_type_id);
ALTER TABLE ONLY nibrs_suspect_using
ADD CONSTRAINT nibrs_suspect_using_list_fk FOREIGN KEY (suspect_using_id) REFERENCES nibrs_using_list(suspect_using_id);
ALTER TABLE ONLY nibrs_suspect_using
ADD CONSTRAINT nibrs_suspect_using_off_fk FOREIGN KEY (offense_id) REFERENCES nibrs_offense(offense_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_victim_circumstances
ADD CONSTRAINT nibrs_vic_circ_nibrs_circ_fk FOREIGN KEY (circumstances_id) REFERENCES nibrs_circumstances(circumstances_id);
ALTER TABLE ONLY nibrs_victim_circumstances
ADD CONSTRAINT nibrs_vic_circ_nibrs_vic_fk FOREIGN KEY (victim_id) REFERENCES nibrs_victim(victim_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_victim_injury
ADD CONSTRAINT nibrs_vic_injury_nibrs_inj_fk FOREIGN KEY (injury_id) REFERENCES nibrs_injury(injury_id);
ALTER TABLE ONLY nibrs_victim_injury
ADD CONSTRAINT nibrs_vic_injury_nibrs_vic_fk FOREIGN KEY (victim_id) REFERENCES nibrs_victim(victim_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_victim_offense
ADD CONSTRAINT nibrs_vic_off_nibrs_off_fk FOREIGN KEY (offense_id) REFERENCES nibrs_offense(offense_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_victim_offense
ADD CONSTRAINT nibrs_vic_off_nibrs_vic_fk FOREIGN KEY (victim_id) REFERENCES nibrs_victim(victim_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_victim
ADD CONSTRAINT nibrs_victim_act_type_fk FOREIGN KEY (activity_type_id) REFERENCES nibrs_activity_type(activity_type_id);
ALTER TABLE ONLY nibrs_victim
ADD CONSTRAINT nibrs_victim_age_fk FOREIGN KEY (age_id) REFERENCES nibrs_age(age_id);
ALTER TABLE ONLY nibrs_victim
ADD CONSTRAINT nibrs_victim_assign_type_fk FOREIGN KEY (assignment_type_id) REFERENCES nibrs_assignment_type(assignment_type_id);
ALTER TABLE ONLY nibrs_victim_circumstances
ADD CONSTRAINT nibrs_victim_circ_just_hom_fk FOREIGN KEY (justifiable_force_id) REFERENCES nibrs_justifiable_force(justifiable_force_id);
ALTER TABLE ONLY nibrs_victim
ADD CONSTRAINT nibrs_victim_ethnicity_fk FOREIGN KEY (ethnicity_id) REFERENCES nibrs_ethnicity(ethnicity_id);
ALTER TABLE ONLY nibrs_victim
ADD CONSTRAINT nibrs_victim_inc_fk FOREIGN KEY (incident_id) REFERENCES nibrs_incident(incident_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_victim_offender_rel
ADD CONSTRAINT nibrs_victim_off_rel_off_fk FOREIGN KEY (offender_id) REFERENCES nibrs_offender(offender_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_victim_offender_rel
ADD CONSTRAINT nibrs_victim_off_rel_rel_fk FOREIGN KEY (relationship_id) REFERENCES nibrs_relationship(relationship_id);
ALTER TABLE ONLY nibrs_victim_offender_rel
ADD CONSTRAINT nibrs_victim_off_rel_vic_fk FOREIGN KEY (victim_id) REFERENCES nibrs_victim(victim_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_victim
ADD CONSTRAINT nibrs_victim_race_fk FOREIGN KEY (race_id) REFERENCES ref_race(race_id);
ALTER TABLE ONLY nibrs_victim
ADD CONSTRAINT nibrs_victims_vic_type_fk FOREIGN KEY (victim_type_id) REFERENCES nibrs_victim_type(victim_type_id);
ALTER TABLE ONLY nibrs_weapon
ADD CONSTRAINT nibrs_weap_off_fk FOREIGN KEY (offense_id) REFERENCES nibrs_offense(offense_id) ON DELETE CASCADE;
ALTER TABLE ONLY nibrs_weapon
ADD CONSTRAINT nibrs_weap_weap_type_fk FOREIGN KEY (weapon_id) REFERENCES nibrs_weapon_type(weapon_id);
--
-- PostgreSQL database dump complete
-- | the_stack |
set TimeZone to 'US/Pacific';
-- Tests for Time Series features of 5.0+
-- Some of these tests could live elsewhere, but it seems good to collect them.
-- Interval-Interval division and remainder and associated overloads
select
interval_interval_div(interval '365 days', interval '1 month') as "12 1/6",
interval '365 days'/interval '1 month' as "12 1/6",
interval_interval_mod(interval '365 days', interval '1 month') as "5*24",
interval '365 days'%interval '1 month' as "5*24";
select
interval_interval_div(interval '1 day', interval '8 hours') as "3",
interval '1 day'/interval '8 hours' as "3",
interval_interval_mod(interval '1 day', interval '8 hours') as "0",
interval '1 day'%interval '8 hours' as "0";
select
interval_interval_div(interval '2 hours', interval '-100 minutes') as "-1 1/5",
interval '2 hours'/interval '-100 minutes' as "-1 1/5",
interval_interval_mod(interval '2 hours', interval '-100 minutes') as "20",
interval '2 hours'%interval '-100 minutes' as "20";
-- generate_series with timestamp
select *
from generate_series(
timestamp '2011-01-01 12:00:00',
timestamp '2011-01-01 12:00:00',
interval '1 year');
select *
from generate_series(
timestamp '2011-01-01 12:00:00',
timestamp '2012-01-01 12:00:00',
interval '1 month');
select *
from generate_series(
timestamp '2012-01-01 12:00:00',
timestamp '2013-01-01 12:00:00',
interval '1 month');
select *
from generate_series(
timestamp '2011-01-01 12:00:00',
timestamp '2011-01-31 12:00:00',
interval '2 weeks');
select *
from generate_series(
timestamp '2013-01-01 12:00:00',
timestamp '2011-01-01 12:00:00',
interval '-2 months');
select *
from generate_series(
'2011-01-01 12:00:00',
'2012-01-01 12:00:00',
interval '0 sec');
-- generate_series with timestamptz
select *
from generate_series(
timestamptz '2011-01-01 12:00:00 UTC',
timestamptz '2011-01-01 12:00:00 UTC',
interval '1 year');
select *
from generate_series(
timestamptz '2011-01-01 12:00:00 UTC',
timestamptz '2012-01-01 12:00:00 UTC',
interval '1 month');
select *
from generate_series(
timestamptz '2012-01-01 12:00:00 UTC',
timestamptz '2013-01-01 12:00:00 UTC',
interval '1 month');
select *
from generate_series(
timestamptz '2011-01-01 12:00:00 UTC',
timestamptz '2011-01-31 12:00:00 UTC',
interval '2 weeks');
select *
from generate_series(
timestamptz '2013-01-01 12:00:00 UTC',
timestamptz '2011-01-01 12:00:00 UTC',
interval '-2 months');
select *
from generate_series(
'2011-01-01 12:00:00 UTC',
'2012-01-01 12:00:00 UTC',
interval '0 sec');
-- interval_bound with numeric
select interval_bound(0, 0);
select interval_bound(0, -1);
select v, w, r, s,
interval_bound(v, w) as "normal",
interval_bound(v, w, s) as "shifted s",
interval_bound(v, w, s, r) as "and registered to r"
from ( values
(10, 1, 0.5, 4),
(10, 0.5, -100, null),
(0.5, 10, -1, -1),
(-100, 100, 10, 1),
(-101, 10, null, 10),
(5, 2, -100.5, 1),
(null, 10, 0, 0),
(55, null, 20, 0),
('NaN', 10, 10, 0),
(45.6, 'NaN', 5.5, 2),
(31, 10, 'NaN', 0)
) r(v,w,r,s);
-- interval_bound with timestamp
select interval_bound(timestamp 'now', interval '0 hours');
select interval_bound(timestamp 'now', interval '1 day - 24 hours');
select interval_bound(timestamp 'infinity', interval '1 month');
select interval_bound(timestamp '-infinity', interval '1 month');
select interval_bound(timestamp 'now', interval '2 hours', null, timestamp 'infinity');
select v, w, r, s,
interval_bound(v, w) as "normal",
interval_bound(v, w, s) as "shifted s",
interval_bound(v, w, s, r) as "and registered to r"
from ( values
(timestamp '2012-01-12 10:00:10', interval '1 week', timestamp '2012-04-02 00:00:00', 4),
(timestamp '1929-10-29 22:33:44.55', interval '1 year', timestamp '1991-01-17 02:34:56.78', null),
(timestamp '1991-01-17 02:34:56.78', interval '1 year -1 month', timestamp '1776-07-04 12:34:56', -1),
(timestamp '2100-03-01 11:11:11.11', interval '100 days', timestamp '1929-10-29 22:33:44.55', 1),
(timestamp '1776-07-04 12:34:56', interval '1 month', timestamp '2012-04-01 00:00:00', 1),
(null::timestamp, interval '1 week', timestamp '1911-09-09 15:16:17', 3),
(timestamp '1999-10-30 13:01:01', null::interval, timestamp '1970-04-05 12:00:00', 1),
(timestamp '1999-10-30 13:01:01', interval '1 day', null, 1)
) r(v,w,r,s);
-- interval_bound with timestamptz
select interval_bound(timestamptz 'now', interval '0 hours');
select interval_bound(timestamptz 'now', interval '1 day - 24 hours');
select interval_bound(timestamptz 'infinity', interval '1 month');
select interval_bound(timestamptz '-infinity', interval '1 month');
select interval_bound(timestamptz 'now', interval '2 hours', null, timestamptz 'infinity');
select v, w, r, s,
interval_bound(v, w) as "normal",
interval_bound(v, w, s) as "shifted s",
interval_bound(v, w, s, r) as "and registered to r"
from ( values
(timestamptz '2012-01-12 10:00:10', interval '1 week', timestamptz '2012-04-02 00:00:00 US/Eastern', 4),
(timestamptz '1929-10-29 22:33:44.55', interval '1 year', timestamptz '1991-01-17 02:34:56.78', null),
(timestamptz '1991-01-17 02:34:56.78', interval '1 year -1 month', timestamptz '1776-07-04 12:34:56 US/Eastern', -1),
(timestamptz '2100-03-01 11:11:11.11 UTC', interval '100 days', timestamptz '1929-10-29 22:33:44.55', 1),
(timestamptz '1776-07-04 12:34:56', interval '1 month', timestamptz '2012-04-01 00:00:00 UTC', 1),
(null::timestamp, interval '1 week', timestamp '1911-09-09 15:16:17', 3),
(timestamptz '1999-10-30 13:01:01', null::interval, timestamptz '1970-04-05 12:00:00', 1),
(timestamptz '1999-10-30 13:01:01', interval '1 day', null, 1)
) r(v,w,r,s);
-- Test limits
select linear_interpolate(3, 0, 0::bigint, 1, (2^62)::bigint);
select linear_interpolate(3, 0, 0::bigint, 1, (-2^62)::bigint);
select linear_interpolate(3, 0, 0::integer, 1, (2^30)::integer);
select linear_interpolate(3, 0, 0::integer, 1, (-2^30)::integer);
select linear_interpolate(3, 0, 0::smallint, 1, (2^14)::smallint);
select linear_interpolate(3, 0, 0::smallint, 1, (-2^14)::smallint);
select linear_interpolate(null, 0, 0::smallint, 1, (-2^14)::smallint);
select linear_interpolate(null::bigint, null::bigint, null::bigint, null::bigint, null::bigint);
select linear_interpolate(200::float8, 100::float8, 'infinity'::float8, 100::float8, '-infinity'::float8);
select linear_interpolate(200::float8, 'nan'::float8, 'infinity'::float8, 'nan'::float8, '-infinity'::float8);
-- A "generic" unsupported type.
select linear_interpolate('x'::text, 'x0'::text, 0, 'x1'::text, 1000);
select linear_interpolate(5, 0, 'y0'::text, 100, 'y1'::text);
-- Check that "divide by zero" returns null
select linear_interpolate('2010-01-03T02:00:00'::timestamp, '2010-01-02T09:20:00'::timestamp, 2000::int4, '2010-01-02T09:20:00'::timestamp, 2250::int4);
select linear_interpolate(200::numeric, 100::numeric, 2000::int4, 100::numeric, 2250::int4);
select linear_interpolate(200::int4, 100::int4, 2000::int4, 100::int4, 2250::int4);
select linear_interpolate(200::float8, 100::float8, 2000::int4, 100::float8, 2250::int4);
select linear_interpolate(200::int2, 100::int2, 2000::int4, 100::int2, 2250::int4);
select linear_interpolate('2001-01-21'::date, '2001-01-11'::date, 2000::int4, '2001-01-11'::date, 2250::int4);
select linear_interpolate(200::int8, 100::int8, 2000::int4, 100::int8, 2250::int4);
select linear_interpolate('85 minutes'::interval, '65 minutes'::interval, 2000::int4, '65 minutes'::interval, 2250::int4);
select linear_interpolate('2010-01-03T02:00:00'::timestamptz, '2010-01-02T09:20:00'::timestamptz, 2000::int4, '2010-01-02T09:20:00'::timestamptz, 2250::int4);
select linear_interpolate('10:25:00'::time, '10:20:00'::time, 2000::int4, '10:20:00'::time, 2250::int4);
select linear_interpolate(200::float4, 100::float4, 2000::int4, 100::float4, 2250::int4);
select linear_interpolate(200::int8, 100::int8, 2000::int8, 100::int8, 2250::int8);
select linear_interpolate(200::int2, 100::int2, 300::int2, 100::int2, 400::int2);
select linear_interpolate(200::float8, 100::float8, 2000::float8, 100::float8, 2250::float8);
select linear_interpolate('2001-01-21'::date, '2001-01-11'::date, '2001-01-25'::date, '2001-01-11'::date, '2001-01-26'::date);
select linear_interpolate('2010-01-03T02:00:00'::timestamp, '2010-01-02T09:20:00'::timestamp, '2010-01-02T06:20:00'::timestamp, '2010-01-02T09:20:00'::timestamp, '2010-01-02T08:20:00'::timestamp);
select linear_interpolate('2010-01-03T02:00:00'::timestamptz, '2010-01-02T09:20:00'::timestamptz, '2010-01-02T05:20:00'::timestamptz, '2010-01-02T09:20:00'::timestamptz, '2010-01-02T08:20:00'::timestamptz);
select linear_interpolate('85 minutes'::interval, '65 minutes'::interval, '75 minutes'::interval, '65 minutes'::interval, '95 minutes'::interval);
select linear_interpolate('10:25:00'::time, '10:20:00'::time, '11:20:00'::time, '10:20:00'::time, '09:20:00'::time);
select linear_interpolate(200::numeric, 100::numeric, 2000::numeric, 100::numeric, 2250::numeric);
select linear_interpolate(200::float4, 100::float4, 2000::float4, 100::float4, 2250::float4);
-- Abscissa: timestamp, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate('2010-01-03T02:00:00'::timestamp, '2010-01-02T09:20:00'::timestamp, 2000::int4, '2010-01-05T20:40:00'::timestamp, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('2010-01-03T02:00:00'::timestamp, '2010-01-02T09:20:00'::timestamp, 2000::int4, '2010-01-05T20:40:00'::timestamp, 2250::int4) as match ;
select
linear_interpolate('2010-01-03T02:00:00'::timestamp, '2010-01-05T20:40:00'::timestamp, 2250::int4, '2010-01-02T09:20:00'::timestamp, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('2010-01-03T02:00:00'::timestamp, '2010-01-05T20:40:00'::timestamp, 2250::int4, '2010-01-02T09:20:00'::timestamp, 2000::int4) as match ;
select
linear_interpolate('2010-01-02T09:20:00'::timestamp, '2010-01-03T02:00:00'::timestamp, 2050::int4, '2010-01-05T20:40:00'::timestamp, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate('2010-01-02T09:20:00'::timestamp, '2010-01-03T02:00:00'::timestamp, 2050::int4, '2010-01-05T20:40:00'::timestamp, 2250::int4) as match ;
select
linear_interpolate('2010-01-02T09:20:00'::timestamp, '2010-01-05T20:40:00'::timestamp, 2250::int4, '2010-01-03T02:00:00'::timestamp, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate('2010-01-02T09:20:00'::timestamp, '2010-01-05T20:40:00'::timestamp, 2250::int4, '2010-01-03T02:00:00'::timestamp, 2050::int4) as match ;
select
linear_interpolate('2010-01-05T20:40:00'::timestamp, '2010-01-03T02:00:00'::timestamp, 2050::int4, '2010-01-02T09:20:00'::timestamp, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate('2010-01-05T20:40:00'::timestamp, '2010-01-03T02:00:00'::timestamp, 2050::int4, '2010-01-02T09:20:00'::timestamp, 2000::int4) as match ;
select
linear_interpolate('2010-01-05T20:40:00'::timestamp, '2010-01-02T09:20:00'::timestamp, 2000::int4, '2010-01-03T02:00:00'::timestamp, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate('2010-01-05T20:40:00'::timestamp, '2010-01-02T09:20:00'::timestamp, 2000::int4, '2010-01-03T02:00:00'::timestamp, 2050::int4) as match ;
select
linear_interpolate('2010-01-03T02:00:00'::timestamp, '2010-01-03T02:00:00'::timestamp, 2050::int4, '2010-01-03T02:00:00'::timestamp, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('2010-01-03T02:00:00'::timestamp, '2010-01-03T02:00:00'::timestamp, 2050::int4, '2010-01-03T02:00:00'::timestamp, 2050::int4) as match ;
-- Abscissa: numeric, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate(200::numeric, 100::numeric, 2000::int4, 600::numeric, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::numeric, 100::numeric, 2000::int4, 600::numeric, 2250::int4) as match ;
select
linear_interpolate(200::numeric, 600::numeric, 2250::int4, 100::numeric, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::numeric, 600::numeric, 2250::int4, 100::numeric, 2000::int4) as match ;
select
linear_interpolate(100::numeric, 200::numeric, 2050::int4, 600::numeric, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::numeric, 200::numeric, 2050::int4, 600::numeric, 2250::int4) as match ;
select
linear_interpolate(100::numeric, 600::numeric, 2250::int4, 200::numeric, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::numeric, 600::numeric, 2250::int4, 200::numeric, 2050::int4) as match ;
select
linear_interpolate(600::numeric, 200::numeric, 2050::int4, 100::numeric, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::numeric, 200::numeric, 2050::int4, 100::numeric, 2000::int4) as match ;
select
linear_interpolate(600::numeric, 100::numeric, 2000::int4, 200::numeric, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::numeric, 100::numeric, 2000::int4, 200::numeric, 2050::int4) as match ;
select
linear_interpolate(200::numeric, 200::numeric, 2050::int4, 200::numeric, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::numeric, 200::numeric, 2050::int4, 200::numeric, 2050::int4) as match ;
-- Abscissa: int4, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, 2000::int4, 600::int4, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int4, 100::int4, 2000::int4, 600::int4, 2250::int4) as match ;
select
linear_interpolate(200::int4, 600::int4, 2250::int4, 100::int4, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int4, 600::int4, 2250::int4, 100::int4, 2000::int4) as match ;
select
linear_interpolate(100::int4, 200::int4, 2050::int4, 600::int4, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::int4, 200::int4, 2050::int4, 600::int4, 2250::int4) as match ;
select
linear_interpolate(100::int4, 600::int4, 2250::int4, 200::int4, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::int4, 600::int4, 2250::int4, 200::int4, 2050::int4) as match ;
select
linear_interpolate(600::int4, 200::int4, 2050::int4, 100::int4, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::int4, 200::int4, 2050::int4, 100::int4, 2000::int4) as match ;
select
linear_interpolate(600::int4, 100::int4, 2000::int4, 200::int4, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::int4, 100::int4, 2000::int4, 200::int4, 2050::int4) as match ;
select
linear_interpolate(200::int4, 200::int4, 2050::int4, 200::int4, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int4, 200::int4, 2050::int4, 200::int4, 2050::int4) as match ;
-- Abscissa: float8, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate(200::float8, 100::float8, 2000::int4, 600::float8, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::float8, 100::float8, 2000::int4, 600::float8, 2250::int4) as match ;
select
linear_interpolate(200::float8, 600::float8, 2250::int4, 100::float8, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::float8, 600::float8, 2250::int4, 100::float8, 2000::int4) as match ;
select
linear_interpolate(100::float8, 200::float8, 2050::int4, 600::float8, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::float8, 200::float8, 2050::int4, 600::float8, 2250::int4) as match ;
select
linear_interpolate(100::float8, 600::float8, 2250::int4, 200::float8, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::float8, 600::float8, 2250::int4, 200::float8, 2050::int4) as match ;
select
linear_interpolate(600::float8, 200::float8, 2050::int4, 100::float8, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::float8, 200::float8, 2050::int4, 100::float8, 2000::int4) as match ;
select
linear_interpolate(600::float8, 100::float8, 2000::int4, 200::float8, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::float8, 100::float8, 2000::int4, 200::float8, 2050::int4) as match ;
select
linear_interpolate(200::float8, 200::float8, 2050::int4, 200::float8, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::float8, 200::float8, 2050::int4, 200::float8, 2050::int4) as match ;
-- Abscissa: int2, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int2, 100::int2, 2000::int4, 600::int2, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int2, 100::int2, 2000::int4, 600::int2, 2250::int4) as match ;
select
linear_interpolate(200::int2, 600::int2, 2250::int4, 100::int2, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int2, 600::int2, 2250::int4, 100::int2, 2000::int4) as match ;
select
linear_interpolate(100::int2, 200::int2, 2050::int4, 600::int2, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::int2, 200::int2, 2050::int4, 600::int2, 2250::int4) as match ;
select
linear_interpolate(100::int2, 600::int2, 2250::int4, 200::int2, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::int2, 600::int2, 2250::int4, 200::int2, 2050::int4) as match ;
select
linear_interpolate(600::int2, 200::int2, 2050::int4, 100::int2, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::int2, 200::int2, 2050::int4, 100::int2, 2000::int4) as match ;
select
linear_interpolate(600::int2, 100::int2, 2000::int4, 200::int2, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::int2, 100::int2, 2000::int4, 200::int2, 2050::int4) as match ;
select
linear_interpolate(200::int2, 200::int2, 2050::int4, 200::int2, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int2, 200::int2, 2050::int4, 200::int2, 2050::int4) as match ;
-- Abscissa: date, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate('2001-01-21'::date, '2001-01-11'::date, 2000::int4, '2001-03-02'::date, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('2001-01-21'::date, '2001-01-11'::date, 2000::int4, '2001-03-02'::date, 2250::int4) as match ;
select
linear_interpolate('2001-01-21'::date, '2001-03-02'::date, 2250::int4, '2001-01-11'::date, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('2001-01-21'::date, '2001-03-02'::date, 2250::int4, '2001-01-11'::date, 2000::int4) as match ;
select
linear_interpolate('2001-01-11'::date, '2001-01-21'::date, 2050::int4, '2001-03-02'::date, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate('2001-01-11'::date, '2001-01-21'::date, 2050::int4, '2001-03-02'::date, 2250::int4) as match ;
select
linear_interpolate('2001-01-11'::date, '2001-03-02'::date, 2250::int4, '2001-01-21'::date, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate('2001-01-11'::date, '2001-03-02'::date, 2250::int4, '2001-01-21'::date, 2050::int4) as match ;
select
linear_interpolate('2001-03-02'::date, '2001-01-21'::date, 2050::int4, '2001-01-11'::date, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate('2001-03-02'::date, '2001-01-21'::date, 2050::int4, '2001-01-11'::date, 2000::int4) as match ;
select
linear_interpolate('2001-03-02'::date, '2001-01-11'::date, 2000::int4, '2001-01-21'::date, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate('2001-03-02'::date, '2001-01-11'::date, 2000::int4, '2001-01-21'::date, 2050::int4) as match ;
select
linear_interpolate('2001-01-21'::date, '2001-01-21'::date, 2050::int4, '2001-01-21'::date, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('2001-01-21'::date, '2001-01-21'::date, 2050::int4, '2001-01-21'::date, 2050::int4) as match ;
-- Abscissa: int8, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int8, 100::int8, 2000::int4, 600::int8, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int8, 100::int8, 2000::int4, 600::int8, 2250::int4) as match ;
select
linear_interpolate(200::int8, 600::int8, 2250::int4, 100::int8, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int8, 600::int8, 2250::int4, 100::int8, 2000::int4) as match ;
select
linear_interpolate(100::int8, 200::int8, 2050::int4, 600::int8, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::int8, 200::int8, 2050::int4, 600::int8, 2250::int4) as match ;
select
linear_interpolate(100::int8, 600::int8, 2250::int4, 200::int8, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::int8, 600::int8, 2250::int4, 200::int8, 2050::int4) as match ;
select
linear_interpolate(600::int8, 200::int8, 2050::int4, 100::int8, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::int8, 200::int8, 2050::int4, 100::int8, 2000::int4) as match ;
select
linear_interpolate(600::int8, 100::int8, 2000::int4, 200::int8, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::int8, 100::int8, 2000::int4, 200::int8, 2050::int4) as match ;
select
linear_interpolate(200::int8, 200::int8, 2050::int4, 200::int8, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int8, 200::int8, 2050::int4, 200::int8, 2050::int4) as match ;
-- Abscissa: interval, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate('85 minutes'::interval, '65 minutes'::interval, 2000::int4, '165 minutes'::interval, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('85 minutes'::interval, '65 minutes'::interval, 2000::int4, '165 minutes'::interval, 2250::int4) as match ;
select
linear_interpolate('85 minutes'::interval, '165 minutes'::interval, 2250::int4, '65 minutes'::interval, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('85 minutes'::interval, '165 minutes'::interval, 2250::int4, '65 minutes'::interval, 2000::int4) as match ;
select
linear_interpolate('65 minutes'::interval, '85 minutes'::interval, 2050::int4, '165 minutes'::interval, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate('65 minutes'::interval, '85 minutes'::interval, 2050::int4, '165 minutes'::interval, 2250::int4) as match ;
select
linear_interpolate('65 minutes'::interval, '165 minutes'::interval, 2250::int4, '85 minutes'::interval, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate('65 minutes'::interval, '165 minutes'::interval, 2250::int4, '85 minutes'::interval, 2050::int4) as match ;
select
linear_interpolate('165 minutes'::interval, '85 minutes'::interval, 2050::int4, '65 minutes'::interval, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate('165 minutes'::interval, '85 minutes'::interval, 2050::int4, '65 minutes'::interval, 2000::int4) as match ;
select
linear_interpolate('165 minutes'::interval, '65 minutes'::interval, 2000::int4, '85 minutes'::interval, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate('165 minutes'::interval, '65 minutes'::interval, 2000::int4, '85 minutes'::interval, 2050::int4) as match ;
select
linear_interpolate('85 minutes'::interval, '85 minutes'::interval, 2050::int4, '85 minutes'::interval, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('85 minutes'::interval, '85 minutes'::interval, 2050::int4, '85 minutes'::interval, 2050::int4) as match ;
-- Abscissa: timestamptz, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate('2010-01-03T02:00:00'::timestamptz, '2010-01-02T09:20:00'::timestamptz, 2000::int4, '2010-01-05T20:40:00'::timestamptz, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('2010-01-03T02:00:00'::timestamptz, '2010-01-02T09:20:00'::timestamptz, 2000::int4, '2010-01-05T20:40:00'::timestamptz, 2250::int4) as match ;
select
linear_interpolate('2010-01-03T02:00:00'::timestamptz, '2010-01-05T20:40:00'::timestamptz, 2250::int4, '2010-01-02T09:20:00'::timestamptz, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('2010-01-03T02:00:00'::timestamptz, '2010-01-05T20:40:00'::timestamptz, 2250::int4, '2010-01-02T09:20:00'::timestamptz, 2000::int4) as match ;
select
linear_interpolate('2010-01-02T09:20:00'::timestamptz, '2010-01-03T02:00:00'::timestamptz, 2050::int4, '2010-01-05T20:40:00'::timestamptz, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate('2010-01-02T09:20:00'::timestamptz, '2010-01-03T02:00:00'::timestamptz, 2050::int4, '2010-01-05T20:40:00'::timestamptz, 2250::int4) as match ;
select
linear_interpolate('2010-01-02T09:20:00'::timestamptz, '2010-01-05T20:40:00'::timestamptz, 2250::int4, '2010-01-03T02:00:00'::timestamptz, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate('2010-01-02T09:20:00'::timestamptz, '2010-01-05T20:40:00'::timestamptz, 2250::int4, '2010-01-03T02:00:00'::timestamptz, 2050::int4) as match ;
select
linear_interpolate('2010-01-05T20:40:00'::timestamptz, '2010-01-03T02:00:00'::timestamptz, 2050::int4, '2010-01-02T09:20:00'::timestamptz, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate('2010-01-05T20:40:00'::timestamptz, '2010-01-03T02:00:00'::timestamptz, 2050::int4, '2010-01-02T09:20:00'::timestamptz, 2000::int4) as match ;
select
linear_interpolate('2010-01-05T20:40:00'::timestamptz, '2010-01-02T09:20:00'::timestamptz, 2000::int4, '2010-01-03T02:00:00'::timestamptz, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate('2010-01-05T20:40:00'::timestamptz, '2010-01-02T09:20:00'::timestamptz, 2000::int4, '2010-01-03T02:00:00'::timestamptz, 2050::int4) as match ;
select
linear_interpolate('2010-01-03T02:00:00'::timestamptz, '2010-01-03T02:00:00'::timestamptz, 2050::int4, '2010-01-03T02:00:00'::timestamptz, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('2010-01-03T02:00:00'::timestamptz, '2010-01-03T02:00:00'::timestamptz, 2050::int4, '2010-01-03T02:00:00'::timestamptz, 2050::int4) as match ;
-- Abscissa: time, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate('10:25:00'::time, '10:20:00'::time, 2000::int4, '10:45:00'::time, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('10:25:00'::time, '10:20:00'::time, 2000::int4, '10:45:00'::time, 2250::int4) as match ;
select
linear_interpolate('10:25:00'::time, '10:45:00'::time, 2250::int4, '10:20:00'::time, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('10:25:00'::time, '10:45:00'::time, 2250::int4, '10:20:00'::time, 2000::int4) as match ;
select
linear_interpolate('10:20:00'::time, '10:25:00'::time, 2050::int4, '10:45:00'::time, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate('10:20:00'::time, '10:25:00'::time, 2050::int4, '10:45:00'::time, 2250::int4) as match ;
select
linear_interpolate('10:20:00'::time, '10:45:00'::time, 2250::int4, '10:25:00'::time, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate('10:20:00'::time, '10:45:00'::time, 2250::int4, '10:25:00'::time, 2050::int4) as match ;
select
linear_interpolate('10:45:00'::time, '10:25:00'::time, 2050::int4, '10:20:00'::time, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate('10:45:00'::time, '10:25:00'::time, 2050::int4, '10:20:00'::time, 2000::int4) as match ;
select
linear_interpolate('10:45:00'::time, '10:20:00'::time, 2000::int4, '10:25:00'::time, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate('10:45:00'::time, '10:20:00'::time, 2000::int4, '10:25:00'::time, 2050::int4) as match ;
select
linear_interpolate('10:25:00'::time, '10:25:00'::time, 2050::int4, '10:25:00'::time, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate('10:25:00'::time, '10:25:00'::time, 2050::int4, '10:25:00'::time, 2050::int4) as match ;
-- Abscissa: float4, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate(200::float4, 100::float4, 2000::int4, 600::float4, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::float4, 100::float4, 2000::int4, 600::float4, 2250::int4) as match ;
select
linear_interpolate(200::float4, 600::float4, 2250::int4, 100::float4, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::float4, 600::float4, 2250::int4, 100::float4, 2000::int4) as match ;
select
linear_interpolate(100::float4, 200::float4, 2050::int4, 600::float4, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::float4, 200::float4, 2050::int4, 600::float4, 2250::int4) as match ;
select
linear_interpolate(100::float4, 600::float4, 2250::int4, 200::float4, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::float4, 600::float4, 2250::int4, 200::float4, 2050::int4) as match ;
select
linear_interpolate(600::float4, 200::float4, 2050::int4, 100::float4, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::float4, 200::float4, 2050::int4, 100::float4, 2000::int4) as match ;
select
linear_interpolate(600::float4, 100::float4, 2000::int4, 200::float4, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::float4, 100::float4, 2000::int4, 200::float4, 2050::int4) as match ;
select
linear_interpolate(200::float4, 200::float4, 2050::int4, 200::float4, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::float4, 200::float4, 2050::int4, 200::float4, 2050::int4) as match ;
-- Abscissa: int4, Ordinate: timestamp
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, '2012-06-01T16:40:00'::timestamp, 600::int4, '2012-06-19T01:20:00'::timestamp),
'2012-06-05T04:00:00'::timestamp as answer,
'2012-06-05T04:00:00'::timestamp = linear_interpolate(200::int4, 100::int4, '2012-06-01T16:40:00'::timestamp, 600::int4, '2012-06-19T01:20:00'::timestamp) as match ;
select
linear_interpolate(200::int4, 600::int4, '2012-06-19T01:20:00'::timestamp, 100::int4, '2012-06-01T16:40:00'::timestamp),
'2012-06-05T04:00:00'::timestamp as answer,
'2012-06-05T04:00:00'::timestamp = linear_interpolate(200::int4, 600::int4, '2012-06-19T01:20:00'::timestamp, 100::int4, '2012-06-01T16:40:00'::timestamp) as match ;
select
linear_interpolate(100::int4, 200::int4, '2012-06-05T04:00:00'::timestamp, 600::int4, '2012-06-19T01:20:00'::timestamp),
'2012-06-01T16:40:00'::timestamp as answer,
'2012-06-01T16:40:00'::timestamp = linear_interpolate(100::int4, 200::int4, '2012-06-05T04:00:00'::timestamp, 600::int4, '2012-06-19T01:20:00'::timestamp) as match ;
select
linear_interpolate(100::int4, 600::int4, '2012-06-19T01:20:00'::timestamp, 200::int4, '2012-06-05T04:00:00'::timestamp),
'2012-06-01T16:40:00'::timestamp as answer,
'2012-06-01T16:40:00'::timestamp = linear_interpolate(100::int4, 600::int4, '2012-06-19T01:20:00'::timestamp, 200::int4, '2012-06-05T04:00:00'::timestamp) as match ;
select
linear_interpolate(600::int4, 200::int4, '2012-06-05T04:00:00'::timestamp, 100::int4, '2012-06-01T16:40:00'::timestamp),
'2012-06-19T01:20:00'::timestamp as answer,
'2012-06-19T01:20:00'::timestamp = linear_interpolate(600::int4, 200::int4, '2012-06-05T04:00:00'::timestamp, 100::int4, '2012-06-01T16:40:00'::timestamp) as match ;
select
linear_interpolate(600::int4, 100::int4, '2012-06-01T16:40:00'::timestamp, 200::int4, '2012-06-05T04:00:00'::timestamp),
'2012-06-19T01:20:00'::timestamp as answer,
'2012-06-19T01:20:00'::timestamp = linear_interpolate(600::int4, 100::int4, '2012-06-01T16:40:00'::timestamp, 200::int4, '2012-06-05T04:00:00'::timestamp) as match ;
select
linear_interpolate(200::int4, 200::int4, '2012-06-05T04:00:00'::timestamp, 200::int4, '2012-06-05T04:00:00'::timestamp),
'2012-06-05T04:00:00'::timestamp as answer,
'2012-06-05T04:00:00'::timestamp = linear_interpolate(200::int4, 200::int4, '2012-06-05T04:00:00'::timestamp, 200::int4, '2012-06-05T04:00:00'::timestamp) as match ;
-- Abscissa: int4, Ordinate: numeric
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, 2000::numeric, 600::int4, 2250::numeric),
2050::numeric as answer,
2050::numeric = linear_interpolate(200::int4, 100::int4, 2000::numeric, 600::int4, 2250::numeric) as match ;
select
linear_interpolate(200::int4, 600::int4, 2250::numeric, 100::int4, 2000::numeric),
2050::numeric as answer,
2050::numeric = linear_interpolate(200::int4, 600::int4, 2250::numeric, 100::int4, 2000::numeric) as match ;
select
linear_interpolate(100::int4, 200::int4, 2050::numeric, 600::int4, 2250::numeric),
2000::numeric as answer,
2000::numeric = linear_interpolate(100::int4, 200::int4, 2050::numeric, 600::int4, 2250::numeric) as match ;
select
linear_interpolate(100::int4, 600::int4, 2250::numeric, 200::int4, 2050::numeric),
2000::numeric as answer,
2000::numeric = linear_interpolate(100::int4, 600::int4, 2250::numeric, 200::int4, 2050::numeric) as match ;
select
linear_interpolate(600::int4, 200::int4, 2050::numeric, 100::int4, 2000::numeric),
2250::numeric as answer,
2250::numeric = linear_interpolate(600::int4, 200::int4, 2050::numeric, 100::int4, 2000::numeric) as match ;
select
linear_interpolate(600::int4, 100::int4, 2000::numeric, 200::int4, 2050::numeric),
2250::numeric as answer,
2250::numeric = linear_interpolate(600::int4, 100::int4, 2000::numeric, 200::int4, 2050::numeric) as match ;
select
linear_interpolate(200::int4, 200::int4, 2050::numeric, 200::int4, 2050::numeric),
2050::numeric as answer,
2050::numeric = linear_interpolate(200::int4, 200::int4, 2050::numeric, 200::int4, 2050::numeric) as match ;
-- Abscissa: int4, Ordinate: int4
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, 2000::int4, 600::int4, 2250::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int4, 100::int4, 2000::int4, 600::int4, 2250::int4) as match ;
select
linear_interpolate(200::int4, 600::int4, 2250::int4, 100::int4, 2000::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int4, 600::int4, 2250::int4, 100::int4, 2000::int4) as match ;
select
linear_interpolate(100::int4, 200::int4, 2050::int4, 600::int4, 2250::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::int4, 200::int4, 2050::int4, 600::int4, 2250::int4) as match ;
select
linear_interpolate(100::int4, 600::int4, 2250::int4, 200::int4, 2050::int4),
2000::int4 as answer,
2000::int4 = linear_interpolate(100::int4, 600::int4, 2250::int4, 200::int4, 2050::int4) as match ;
select
linear_interpolate(600::int4, 200::int4, 2050::int4, 100::int4, 2000::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::int4, 200::int4, 2050::int4, 100::int4, 2000::int4) as match ;
select
linear_interpolate(600::int4, 100::int4, 2000::int4, 200::int4, 2050::int4),
2250::int4 as answer,
2250::int4 = linear_interpolate(600::int4, 100::int4, 2000::int4, 200::int4, 2050::int4) as match ;
select
linear_interpolate(200::int4, 200::int4, 2050::int4, 200::int4, 2050::int4),
2050::int4 as answer,
2050::int4 = linear_interpolate(200::int4, 200::int4, 2050::int4, 200::int4, 2050::int4) as match ;
-- Abscissa: int4, Ordinate: float8
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, 2000::float8, 600::int4, 2250::float8),
2050::float8 as answer,
2050::float8 = linear_interpolate(200::int4, 100::int4, 2000::float8, 600::int4, 2250::float8) as match ;
select
linear_interpolate(200::int4, 600::int4, 2250::float8, 100::int4, 2000::float8),
2050::float8 as answer,
2050::float8 = linear_interpolate(200::int4, 600::int4, 2250::float8, 100::int4, 2000::float8) as match ;
select
linear_interpolate(100::int4, 200::int4, 2050::float8, 600::int4, 2250::float8),
2000::float8 as answer,
2000::float8 = linear_interpolate(100::int4, 200::int4, 2050::float8, 600::int4, 2250::float8) as match ;
select
linear_interpolate(100::int4, 600::int4, 2250::float8, 200::int4, 2050::float8),
2000::float8 as answer,
2000::float8 = linear_interpolate(100::int4, 600::int4, 2250::float8, 200::int4, 2050::float8) as match ;
select
linear_interpolate(600::int4, 200::int4, 2050::float8, 100::int4, 2000::float8),
2250::float8 as answer,
2250::float8 = linear_interpolate(600::int4, 200::int4, 2050::float8, 100::int4, 2000::float8) as match ;
select
linear_interpolate(600::int4, 100::int4, 2000::float8, 200::int4, 2050::float8),
2250::float8 as answer,
2250::float8 = linear_interpolate(600::int4, 100::int4, 2000::float8, 200::int4, 2050::float8) as match ;
select
linear_interpolate(200::int4, 200::int4, 2050::float8, 200::int4, 2050::float8),
2050::float8 as answer,
2050::float8 = linear_interpolate(200::int4, 200::int4, 2050::float8, 200::int4, 2050::float8) as match ;
-- Abscissa: int4, Ordinate: int2
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, 2000::int2, 600::int4, 2250::int2),
2050::int2 as answer,
2050::int2 = linear_interpolate(200::int4, 100::int4, 2000::int2, 600::int4, 2250::int2) as match ;
select
linear_interpolate(200::int4, 600::int4, 2250::int2, 100::int4, 2000::int2),
2050::int2 as answer,
2050::int2 = linear_interpolate(200::int4, 600::int4, 2250::int2, 100::int4, 2000::int2) as match ;
select
linear_interpolate(100::int4, 200::int4, 2050::int2, 600::int4, 2250::int2),
2000::int2 as answer,
2000::int2 = linear_interpolate(100::int4, 200::int4, 2050::int2, 600::int4, 2250::int2) as match ;
select
linear_interpolate(100::int4, 600::int4, 2250::int2, 200::int4, 2050::int2),
2000::int2 as answer,
2000::int2 = linear_interpolate(100::int4, 600::int4, 2250::int2, 200::int4, 2050::int2) as match ;
select
linear_interpolate(600::int4, 200::int4, 2050::int2, 100::int4, 2000::int2),
2250::int2 as answer,
2250::int2 = linear_interpolate(600::int4, 200::int4, 2050::int2, 100::int4, 2000::int2) as match ;
select
linear_interpolate(600::int4, 100::int4, 2000::int2, 200::int4, 2050::int2),
2250::int2 as answer,
2250::int2 = linear_interpolate(600::int4, 100::int4, 2000::int2, 200::int4, 2050::int2) as match ;
select
linear_interpolate(200::int4, 200::int4, 2050::int2, 200::int4, 2050::int2),
2050::int2 as answer,
2050::int2 = linear_interpolate(200::int4, 200::int4, 2050::int2, 200::int4, 2050::int2) as match ;
-- Abscissa: int4, Ordinate: date
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, '2010-01-21'::date, 600::int4, '2010-03-12'::date),
'2010-01-31'::date as answer,
'2010-01-31'::date = linear_interpolate(200::int4, 100::int4, '2010-01-21'::date, 600::int4, '2010-03-12'::date) as match ;
select
linear_interpolate(200::int4, 600::int4, '2010-03-12'::date, 100::int4, '2010-01-21'::date),
'2010-01-31'::date as answer,
'2010-01-31'::date = linear_interpolate(200::int4, 600::int4, '2010-03-12'::date, 100::int4, '2010-01-21'::date) as match ;
select
linear_interpolate(100::int4, 200::int4, '2010-01-31'::date, 600::int4, '2010-03-12'::date),
'2010-01-21'::date as answer,
'2010-01-21'::date = linear_interpolate(100::int4, 200::int4, '2010-01-31'::date, 600::int4, '2010-03-12'::date) as match ;
select
linear_interpolate(100::int4, 600::int4, '2010-03-12'::date, 200::int4, '2010-01-31'::date),
'2010-01-21'::date as answer,
'2010-01-21'::date = linear_interpolate(100::int4, 600::int4, '2010-03-12'::date, 200::int4, '2010-01-31'::date) as match ;
select
linear_interpolate(600::int4, 200::int4, '2010-01-31'::date, 100::int4, '2010-01-21'::date),
'2010-03-12'::date as answer,
'2010-03-12'::date = linear_interpolate(600::int4, 200::int4, '2010-01-31'::date, 100::int4, '2010-01-21'::date) as match ;
select
linear_interpolate(600::int4, 100::int4, '2010-01-21'::date, 200::int4, '2010-01-31'::date),
'2010-03-12'::date as answer,
'2010-03-12'::date = linear_interpolate(600::int4, 100::int4, '2010-01-21'::date, 200::int4, '2010-01-31'::date) as match ;
select
linear_interpolate(200::int4, 200::int4, '2010-01-31'::date, 200::int4, '2010-01-31'::date),
'2010-01-31'::date as answer,
'2010-01-31'::date = linear_interpolate(200::int4, 200::int4, '2010-01-31'::date, 200::int4, '2010-01-31'::date) as match ;
-- Abscissa: int4, Ordinate: int8
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, 2000::int8, 600::int4, 2250::int8),
2050::int8 as answer,
2050::int8 = linear_interpolate(200::int4, 100::int4, 2000::int8, 600::int4, 2250::int8) as match ;
select
linear_interpolate(200::int4, 600::int4, 2250::int8, 100::int4, 2000::int8),
2050::int8 as answer,
2050::int8 = linear_interpolate(200::int4, 600::int4, 2250::int8, 100::int4, 2000::int8) as match ;
select
linear_interpolate(100::int4, 200::int4, 2050::int8, 600::int4, 2250::int8),
2000::int8 as answer,
2000::int8 = linear_interpolate(100::int4, 200::int4, 2050::int8, 600::int4, 2250::int8) as match ;
select
linear_interpolate(100::int4, 600::int4, 2250::int8, 200::int4, 2050::int8),
2000::int8 as answer,
2000::int8 = linear_interpolate(100::int4, 600::int4, 2250::int8, 200::int4, 2050::int8) as match ;
select
linear_interpolate(600::int4, 200::int4, 2050::int8, 100::int4, 2000::int8),
2250::int8 as answer,
2250::int8 = linear_interpolate(600::int4, 200::int4, 2050::int8, 100::int4, 2000::int8) as match ;
select
linear_interpolate(600::int4, 100::int4, 2000::int8, 200::int4, 2050::int8),
2250::int8 as answer,
2250::int8 = linear_interpolate(600::int4, 100::int4, 2000::int8, 200::int4, 2050::int8) as match ;
select
linear_interpolate(200::int4, 200::int4, 2050::int8, 200::int4, 2050::int8),
2050::int8 as answer,
2050::int8 = linear_interpolate(200::int4, 200::int4, 2050::int8, 200::int4, 2050::int8) as match ;
-- Abscissa: int4, Ordinate: interval
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, '50 minutes'::interval, 600::int4, '100 minutes'::interval),
'60 minutes'::interval as answer,
'60 minutes'::interval = linear_interpolate(200::int4, 100::int4, '50 minutes'::interval, 600::int4, '100 minutes'::interval) as match ;
select
linear_interpolate(200::int4, 600::int4, '100 minutes'::interval, 100::int4, '50 minutes'::interval),
'60 minutes'::interval as answer,
'60 minutes'::interval = linear_interpolate(200::int4, 600::int4, '100 minutes'::interval, 100::int4, '50 minutes'::interval) as match ;
select
linear_interpolate(100::int4, 200::int4, '60 minutes'::interval, 600::int4, '100 minutes'::interval),
'50 minutes'::interval as answer,
'50 minutes'::interval = linear_interpolate(100::int4, 200::int4, '60 minutes'::interval, 600::int4, '100 minutes'::interval) as match ;
select
linear_interpolate(100::int4, 600::int4, '100 minutes'::interval, 200::int4, '60 minutes'::interval),
'50 minutes'::interval as answer,
'50 minutes'::interval = linear_interpolate(100::int4, 600::int4, '100 minutes'::interval, 200::int4, '60 minutes'::interval) as match ;
select
linear_interpolate(600::int4, 200::int4, '60 minutes'::interval, 100::int4, '50 minutes'::interval),
'100 minutes'::interval as answer,
'100 minutes'::interval = linear_interpolate(600::int4, 200::int4, '60 minutes'::interval, 100::int4, '50 minutes'::interval) as match ;
select
linear_interpolate(600::int4, 100::int4, '50 minutes'::interval, 200::int4, '60 minutes'::interval),
'100 minutes'::interval as answer,
'100 minutes'::interval = linear_interpolate(600::int4, 100::int4, '50 minutes'::interval, 200::int4, '60 minutes'::interval) as match ;
select
linear_interpolate(200::int4, 200::int4, '60 minutes'::interval, 200::int4, '60 minutes'::interval),
'60 minutes'::interval as answer,
'60 minutes'::interval = linear_interpolate(200::int4, 200::int4, '60 minutes'::interval, 200::int4, '60 minutes'::interval) as match ;
-- Abscissa: int4, Ordinate: timestamptz
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, '2012-06-01T16:40:00'::timestamptz, 600::int4, '2012-06-19T01:20:00'::timestamptz),
'2012-06-05T04:00:00'::timestamptz as answer,
'2012-06-05T04:00:00'::timestamptz = linear_interpolate(200::int4, 100::int4, '2012-06-01T16:40:00'::timestamptz, 600::int4, '2012-06-19T01:20:00'::timestamptz) as match ;
select
linear_interpolate(200::int4, 600::int4, '2012-06-19T01:20:00'::timestamptz, 100::int4, '2012-06-01T16:40:00'::timestamptz),
'2012-06-05T04:00:00'::timestamptz as answer,
'2012-06-05T04:00:00'::timestamptz = linear_interpolate(200::int4, 600::int4, '2012-06-19T01:20:00'::timestamptz, 100::int4, '2012-06-01T16:40:00'::timestamptz) as match ;
select
linear_interpolate(100::int4, 200::int4, '2012-06-05T04:00:00'::timestamptz, 600::int4, '2012-06-19T01:20:00'::timestamptz),
'2012-06-01T16:40:00'::timestamptz as answer,
'2012-06-01T16:40:00'::timestamptz = linear_interpolate(100::int4, 200::int4, '2012-06-05T04:00:00'::timestamptz, 600::int4, '2012-06-19T01:20:00'::timestamptz) as match ;
select
linear_interpolate(100::int4, 600::int4, '2012-06-19T01:20:00'::timestamptz, 200::int4, '2012-06-05T04:00:00'::timestamptz),
'2012-06-01T16:40:00'::timestamptz as answer,
'2012-06-01T16:40:00'::timestamptz = linear_interpolate(100::int4, 600::int4, '2012-06-19T01:20:00'::timestamptz, 200::int4, '2012-06-05T04:00:00'::timestamptz) as match ;
select
linear_interpolate(600::int4, 200::int4, '2012-06-05T04:00:00'::timestamptz, 100::int4, '2012-06-01T16:40:00'::timestamptz),
'2012-06-19T01:20:00'::timestamptz as answer,
'2012-06-19T01:20:00'::timestamptz = linear_interpolate(600::int4, 200::int4, '2012-06-05T04:00:00'::timestamptz, 100::int4, '2012-06-01T16:40:00'::timestamptz) as match ;
select
linear_interpolate(600::int4, 100::int4, '2012-06-01T16:40:00'::timestamptz, 200::int4, '2012-06-05T04:00:00'::timestamptz),
'2012-06-19T01:20:00'::timestamptz as answer,
'2012-06-19T01:20:00'::timestamptz = linear_interpolate(600::int4, 100::int4, '2012-06-01T16:40:00'::timestamptz, 200::int4, '2012-06-05T04:00:00'::timestamptz) as match ;
select
linear_interpolate(200::int4, 200::int4, '2012-06-05T04:00:00'::timestamptz, 200::int4, '2012-06-05T04:00:00'::timestamptz),
'2012-06-05T04:00:00'::timestamptz as answer,
'2012-06-05T04:00:00'::timestamptz = linear_interpolate(200::int4, 200::int4, '2012-06-05T04:00:00'::timestamptz, 200::int4, '2012-06-05T04:00:00'::timestamptz) as match ;
-- Abscissa: int4, Ordinate: time
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, '15:00:00'::time, 600::int4, '15:50:00'::time),
'15:10:00'::time as answer,
'15:10:00'::time = linear_interpolate(200::int4, 100::int4, '15:00:00'::time, 600::int4, '15:50:00'::time) as match ;
select
linear_interpolate(200::int4, 600::int4, '15:50:00'::time, 100::int4, '15:00:00'::time),
'15:10:00'::time as answer,
'15:10:00'::time = linear_interpolate(200::int4, 600::int4, '15:50:00'::time, 100::int4, '15:00:00'::time) as match ;
select
linear_interpolate(100::int4, 200::int4, '15:10:00'::time, 600::int4, '15:50:00'::time),
'15:00:00'::time as answer,
'15:00:00'::time = linear_interpolate(100::int4, 200::int4, '15:10:00'::time, 600::int4, '15:50:00'::time) as match ;
select
linear_interpolate(100::int4, 600::int4, '15:50:00'::time, 200::int4, '15:10:00'::time),
'15:00:00'::time as answer,
'15:00:00'::time = linear_interpolate(100::int4, 600::int4, '15:50:00'::time, 200::int4, '15:10:00'::time) as match ;
select
linear_interpolate(600::int4, 200::int4, '15:10:00'::time, 100::int4, '15:00:00'::time),
'15:50:00'::time as answer,
'15:50:00'::time = linear_interpolate(600::int4, 200::int4, '15:10:00'::time, 100::int4, '15:00:00'::time) as match ;
select
linear_interpolate(600::int4, 100::int4, '15:00:00'::time, 200::int4, '15:10:00'::time),
'15:50:00'::time as answer,
'15:50:00'::time = linear_interpolate(600::int4, 100::int4, '15:00:00'::time, 200::int4, '15:10:00'::time) as match ;
select
linear_interpolate(200::int4, 200::int4, '15:10:00'::time, 200::int4, '15:10:00'::time),
'15:10:00'::time as answer,
'15:10:00'::time = linear_interpolate(200::int4, 200::int4, '15:10:00'::time, 200::int4, '15:10:00'::time) as match ;
-- Abscissa: int4, Ordinate: float4
-- Check correctness - all results should have match = t
select
linear_interpolate(200::int4, 100::int4, 2000::float4, 600::int4, 2250::float4),
2050::float4 as answer,
2050::float4 = linear_interpolate(200::int4, 100::int4, 2000::float4, 600::int4, 2250::float4) as match ;
select
linear_interpolate(200::int4, 600::int4, 2250::float4, 100::int4, 2000::float4),
2050::float4 as answer,
2050::float4 = linear_interpolate(200::int4, 600::int4, 2250::float4, 100::int4, 2000::float4) as match ;
select
linear_interpolate(100::int4, 200::int4, 2050::float4, 600::int4, 2250::float4),
2000::float4 as answer,
2000::float4 = linear_interpolate(100::int4, 200::int4, 2050::float4, 600::int4, 2250::float4) as match ;
select
linear_interpolate(100::int4, 600::int4, 2250::float4, 200::int4, 2050::float4),
2000::float4 as answer,
2000::float4 = linear_interpolate(100::int4, 600::int4, 2250::float4, 200::int4, 2050::float4) as match ;
select
linear_interpolate(600::int4, 200::int4, 2050::float4, 100::int4, 2000::float4),
2250::float4 as answer,
2250::float4 = linear_interpolate(600::int4, 200::int4, 2050::float4, 100::int4, 2000::float4) as match ;
select
linear_interpolate(600::int4, 100::int4, 2000::float4, 200::int4, 2050::float4),
2250::float4 as answer,
2250::float4 = linear_interpolate(600::int4, 100::int4, 2000::float4, 200::int4, 2050::float4) as match ;
select
linear_interpolate(200::int4, 200::int4, 2050::float4, 200::int4, 2050::float4),
2050::float4 as answer,
2050::float4 = linear_interpolate(200::int4, 200::int4, 2050::float4, 200::int4, 2050::float4) as match ; | the_stack |
-- misc5.test
--
-- db eval {
-- CREATE TABLE t3(x);
-- INSERT INTO t3 VALUES(-18);
-- INSERT INTO t3 VALUES(-17);
-- INSERT INTO t3 VALUES(-16);
-- INSERT INTO t3 VALUES(-15);
-- INSERT INTO t3 VALUES(-14);
-- INSERT INTO t3 VALUES(-13);
-- INSERT INTO t3 VALUES(-12);
-- INSERT INTO t3 VALUES(-11);
-- INSERT INTO t3 VALUES(-10);
-- INSERT INTO t3 VALUES(-9);
-- INSERT INTO t3 VALUES(-8);
-- INSERT INTO t3 VALUES(-7);
-- INSERT INTO t3 VALUES(-6);
-- INSERT INTO t3 VALUES(-5);
-- INSERT INTO t3 VALUES(-4);
-- INSERT INTO t3 VALUES(-3);
-- INSERT INTO t3 VALUES(-2);
-- INSERT INTO t3 VALUES(-1);
-- INSERT INTO t3 VALUES(0);
-- INSERT INTO t3 VALUES(1);
-- INSERT INTO t3 VALUES(2);
-- INSERT INTO t3 VALUES(3);
-- INSERT INTO t3 VALUES(4);
-- INSERT INTO t3 VALUES(5);
-- INSERT INTO t3 VALUES(6);
-- INSERT INTO t3 VALUES(7);
-- INSERT INTO t3 VALUES(8);
-- INSERT INTO t3 VALUES(9);
-- INSERT INTO t3 VALUES(10);
-- INSERT INTO t3 VALUES(11);
-- INSERT INTO t3 VALUES(12);
-- INSERT INTO t3 VALUES(13);
-- INSERT INTO t3 VALUES(14);
-- INSERT INTO t3 VALUES(15);
-- INSERT INTO t3 VALUES(16);
-- INSERT INTO t3 VALUES(17);
-- INSERT INTO t3 VALUES(18);
-- INSERT INTO t3 VALUES(30);
-- INSERT INTO t3 VALUES(31);
-- INSERT INTO t3 VALUES(32);
-- INSERT INTO t3 VALUES(33);
-- INSERT INTO t3 VALUES(34);
-- INSERT INTO t3 VALUES(-30);
-- INSERT INTO t3 VALUES(-31);
-- INSERT INTO t3 VALUES(-32);
-- INSERT INTO t3 VALUES(-33);
-- INSERT INTO t3 VALUES(-34);
-- INSERT INTO t3 VALUES(62);
-- INSERT INTO t3 VALUES(63);
-- INSERT INTO t3 VALUES(64);
-- INSERT INTO t3 VALUES(65);
-- INSERT INTO t3 VALUES(66);
-- INSERT INTO t3 VALUES(-62);
-- INSERT INTO t3 VALUES(-63);
-- INSERT INTO t3 VALUES(-64);
-- INSERT INTO t3 VALUES(-65);
-- INSERT INTO t3 VALUES(-66);
-- INSERT INTO t3 VALUES(126);
-- INSERT INTO t3 VALUES(127);
-- INSERT INTO t3 VALUES(128);
-- INSERT INTO t3 VALUES(129);
-- INSERT INTO t3 VALUES(130);
-- INSERT INTO t3 VALUES(-126);
-- INSERT INTO t3 VALUES(-127);
-- INSERT INTO t3 VALUES(-128);
-- INSERT INTO t3 VALUES(-129);
-- INSERT INTO t3 VALUES(-130);
-- INSERT INTO t3 VALUES(254);
-- INSERT INTO t3 VALUES(255);
-- INSERT INTO t3 VALUES(256);
-- INSERT INTO t3 VALUES(257);
-- INSERT INTO t3 VALUES(258);
-- INSERT INTO t3 VALUES(-254);
-- INSERT INTO t3 VALUES(-255);
-- INSERT INTO t3 VALUES(-256);
-- INSERT INTO t3 VALUES(-257);
-- INSERT INTO t3 VALUES(-258);
-- INSERT INTO t3 VALUES(510);
-- INSERT INTO t3 VALUES(511);
-- INSERT INTO t3 VALUES(512);
-- INSERT INTO t3 VALUES(513);
-- INSERT INTO t3 VALUES(514);
-- INSERT INTO t3 VALUES(-510);
-- INSERT INTO t3 VALUES(-511);
-- INSERT INTO t3 VALUES(-512);
-- INSERT INTO t3 VALUES(-513);
-- INSERT INTO t3 VALUES(-514);
-- INSERT INTO t3 VALUES(1022);
-- INSERT INTO t3 VALUES(1023);
-- INSERT INTO t3 VALUES(1024);
-- INSERT INTO t3 VALUES(1025);
-- INSERT INTO t3 VALUES(1026);
-- INSERT INTO t3 VALUES(-1022);
-- INSERT INTO t3 VALUES(-1023);
-- INSERT INTO t3 VALUES(-1024);
-- INSERT INTO t3 VALUES(-1025);
-- INSERT INTO t3 VALUES(-1026);
-- INSERT INTO t3 VALUES(2046);
-- INSERT INTO t3 VALUES(2047);
-- INSERT INTO t3 VALUES(2048);
-- INSERT INTO t3 VALUES(2049);
-- INSERT INTO t3 VALUES(2050);
-- INSERT INTO t3 VALUES(-2046);
-- INSERT INTO t3 VALUES(-2047);
-- INSERT INTO t3 VALUES(-2048);
-- INSERT INTO t3 VALUES(-2049);
-- INSERT INTO t3 VALUES(-2050);
-- INSERT INTO t3 VALUES(4094);
-- INSERT INTO t3 VALUES(4095);
-- INSERT INTO t3 VALUES(4096);
-- INSERT INTO t3 VALUES(4097);
-- INSERT INTO t3 VALUES(4098);
-- INSERT INTO t3 VALUES(-4094);
-- INSERT INTO t3 VALUES(-4095);
-- INSERT INTO t3 VALUES(-4096);
-- INSERT INTO t3 VALUES(-4097);
-- INSERT INTO t3 VALUES(-4098);
-- INSERT INTO t3 VALUES(8190);
-- INSERT INTO t3 VALUES(8191);
-- INSERT INTO t3 VALUES(8192);
-- INSERT INTO t3 VALUES(8193);
-- INSERT INTO t3 VALUES(8194);
-- INSERT INTO t3 VALUES(-8190);
-- INSERT INTO t3 VALUES(-8191);
-- INSERT INTO t3 VALUES(-8192);
-- INSERT INTO t3 VALUES(-8193);
-- INSERT INTO t3 VALUES(-8194);
-- INSERT INTO t3 VALUES(16382);
-- INSERT INTO t3 VALUES(16383);
-- INSERT INTO t3 VALUES(16384);
-- INSERT INTO t3 VALUES(16385);
-- INSERT INTO t3 VALUES(16386);
-- INSERT INTO t3 VALUES(-16382);
-- INSERT INTO t3 VALUES(-16383);
-- INSERT INTO t3 VALUES(-16384);
-- INSERT INTO t3 VALUES(-16385);
-- INSERT INTO t3 VALUES(-16386);
-- INSERT INTO t3 VALUES(32766);
-- INSERT INTO t3 VALUES(32767);
-- INSERT INTO t3 VALUES(32768);
-- INSERT INTO t3 VALUES(32769);
-- INSERT INTO t3 VALUES(32770);
-- INSERT INTO t3 VALUES(-32766);
-- INSERT INTO t3 VALUES(-32767);
-- INSERT INTO t3 VALUES(-32768);
-- INSERT INTO t3 VALUES(-32769);
-- INSERT INTO t3 VALUES(-32770);
-- INSERT INTO t3 VALUES(65534);
-- INSERT INTO t3 VALUES(65535);
-- INSERT INTO t3 VALUES(65536);
-- INSERT INTO t3 VALUES(65537);
-- INSERT INTO t3 VALUES(65538);
-- INSERT INTO t3 VALUES(-65534);
-- INSERT INTO t3 VALUES(-65535);
-- INSERT INTO t3 VALUES(-65536);
-- INSERT INTO t3 VALUES(-65537);
-- INSERT INTO t3 VALUES(-65538);
-- INSERT INTO t3 VALUES(131070);
-- INSERT INTO t3 VALUES(131071);
-- INSERT INTO t3 VALUES(131072);
-- INSERT INTO t3 VALUES(131073);
-- INSERT INTO t3 VALUES(131074);
-- INSERT INTO t3 VALUES(-131070);
-- INSERT INTO t3 VALUES(-131071);
-- INSERT INTO t3 VALUES(-131072);
-- INSERT INTO t3 VALUES(-131073);
-- INSERT INTO t3 VALUES(-131074);
-- INSERT INTO t3 VALUES(262142);
-- INSERT INTO t3 VALUES(262143);
-- INSERT INTO t3 VALUES(262144);
-- INSERT INTO t3 VALUES(262145);
-- INSERT INTO t3 VALUES(262146);
-- INSERT INTO t3 VALUES(-262142);
-- INSERT INTO t3 VALUES(-262143);
-- INSERT INTO t3 VALUES(-262144);
-- INSERT INTO t3 VALUES(-262145);
-- INSERT INTO t3 VALUES(-262146);
-- INSERT INTO t3 VALUES(524286);
-- INSERT INTO t3 VALUES(524287);
-- INSERT INTO t3 VALUES(524288);
-- INSERT INTO t3 VALUES(524289);
-- INSERT INTO t3 VALUES(524290);
-- INSERT INTO t3 VALUES(-524286);
-- INSERT INTO t3 VALUES(-524287);
-- INSERT INTO t3 VALUES(-524288);
-- INSERT INTO t3 VALUES(-524289);
-- INSERT INTO t3 VALUES(-524290);
-- INSERT INTO t3 VALUES(1048574);
-- INSERT INTO t3 VALUES(1048575);
-- INSERT INTO t3 VALUES(1048576);
-- INSERT INTO t3 VALUES(1048577);
-- INSERT INTO t3 VALUES(1048578);
-- INSERT INTO t3 VALUES(-1048574);
-- INSERT INTO t3 VALUES(-1048575);
-- INSERT INTO t3 VALUES(-1048576);
-- INSERT INTO t3 VALUES(-1048577);
-- INSERT INTO t3 VALUES(-1048578);
-- INSERT INTO t3 VALUES(2097150);
-- INSERT INTO t3 VALUES(2097151);
-- INSERT INTO t3 VALUES(2097152);
-- INSERT INTO t3 VALUES(2097153);
-- INSERT INTO t3 VALUES(2097154);
-- INSERT INTO t3 VALUES(-2097150);
-- INSERT INTO t3 VALUES(-2097151);
-- INSERT INTO t3 VALUES(-2097152);
-- INSERT INTO t3 VALUES(-2097153);
-- INSERT INTO t3 VALUES(-2097154);
-- INSERT INTO t3 VALUES(4194302);
-- INSERT INTO t3 VALUES(4194303);
-- INSERT INTO t3 VALUES(4194304);
-- INSERT INTO t3 VALUES(4194305);
-- INSERT INTO t3 VALUES(4194306);
-- INSERT INTO t3 VALUES(-4194302);
-- INSERT INTO t3 VALUES(-4194303);
-- INSERT INTO t3 VALUES(-4194304);
-- INSERT INTO t3 VALUES(-4194305);
-- INSERT INTO t3 VALUES(-4194306);
-- INSERT INTO t3 VALUES(8388606);
-- INSERT INTO t3 VALUES(8388607);
-- INSERT INTO t3 VALUES(8388608);
-- INSERT INTO t3 VALUES(8388609);
-- INSERT INTO t3 VALUES(8388610);
-- INSERT INTO t3 VALUES(-8388606);
-- INSERT INTO t3 VALUES(-8388607);
-- INSERT INTO t3 VALUES(-8388608);
-- INSERT INTO t3 VALUES(-8388609);
-- INSERT INTO t3 VALUES(-8388610);
-- INSERT INTO t3 VALUES(16777214);
-- INSERT INTO t3 VALUES(16777215);
-- INSERT INTO t3 VALUES(16777216);
-- INSERT INTO t3 VALUES(16777217);
-- INSERT INTO t3 VALUES(16777218);
-- INSERT INTO t3 VALUES(-16777214);
-- INSERT INTO t3 VALUES(-16777215);
-- INSERT INTO t3 VALUES(-16777216);
-- INSERT INTO t3 VALUES(-16777217);
-- INSERT INTO t3 VALUES(-16777218);
-- INSERT INTO t3 VALUES(33554430);
-- INSERT INTO t3 VALUES(33554431);
-- INSERT INTO t3 VALUES(33554432);
-- INSERT INTO t3 VALUES(33554433);
-- INSERT INTO t3 VALUES(33554434);
-- INSERT INTO t3 VALUES(-33554430);
-- INSERT INTO t3 VALUES(-33554431);
-- INSERT INTO t3 VALUES(-33554432);
-- INSERT INTO t3 VALUES(-33554433);
-- INSERT INTO t3 VALUES(-33554434);
-- INSERT INTO t3 VALUES(67108862);
-- INSERT INTO t3 VALUES(67108863);
-- INSERT INTO t3 VALUES(67108864);
-- INSERT INTO t3 VALUES(67108865);
-- INSERT INTO t3 VALUES(67108866);
-- INSERT INTO t3 VALUES(-67108862);
-- INSERT INTO t3 VALUES(-67108863);
-- INSERT INTO t3 VALUES(-67108864);
-- INSERT INTO t3 VALUES(-67108865);
-- INSERT INTO t3 VALUES(-67108866);
-- INSERT INTO t3 VALUES(134217726);
-- INSERT INTO t3 VALUES(134217727);
-- INSERT INTO t3 VALUES(134217728);
-- INSERT INTO t3 VALUES(134217729);
-- INSERT INTO t3 VALUES(134217730);
-- INSERT INTO t3 VALUES(-134217726);
-- INSERT INTO t3 VALUES(-134217727);
-- INSERT INTO t3 VALUES(-134217728);
-- INSERT INTO t3 VALUES(-134217729);
-- INSERT INTO t3 VALUES(-134217730);
-- INSERT INTO t3 VALUES(268435454);
-- INSERT INTO t3 VALUES(268435455);
-- INSERT INTO t3 VALUES(268435456);
-- INSERT INTO t3 VALUES(268435457);
-- INSERT INTO t3 VALUES(268435458);
-- INSERT INTO t3 VALUES(-268435454);
-- INSERT INTO t3 VALUES(-268435455);
-- INSERT INTO t3 VALUES(-268435456);
-- INSERT INTO t3 VALUES(-268435457);
-- INSERT INTO t3 VALUES(-268435458);
-- INSERT INTO t3 VALUES(536870910);
-- INSERT INTO t3 VALUES(536870911);
-- INSERT INTO t3 VALUES(536870912);
-- INSERT INTO t3 VALUES(536870913);
-- INSERT INTO t3 VALUES(536870914);
-- INSERT INTO t3 VALUES(-536870910);
-- INSERT INTO t3 VALUES(-536870911);
-- INSERT INTO t3 VALUES(-536870912);
-- INSERT INTO t3 VALUES(-536870913);
-- INSERT INTO t3 VALUES(-536870914);
-- INSERT INTO t3 VALUES(1073741822);
-- INSERT INTO t3 VALUES(1073741823);
-- INSERT INTO t3 VALUES(1073741824);
-- INSERT INTO t3 VALUES(1073741825);
-- INSERT INTO t3 VALUES(1073741826);
-- INSERT INTO t3 VALUES(-1073741822);
-- INSERT INTO t3 VALUES(-1073741823);
-- INSERT INTO t3 VALUES(-1073741824);
-- INSERT INTO t3 VALUES(-1073741825);
-- INSERT INTO t3 VALUES(-1073741826);
-- INSERT INTO t3 VALUES(2147483646);
-- INSERT INTO t3 VALUES(2147483647);
-- INSERT INTO t3 VALUES(2147483648);
-- INSERT INTO t3 VALUES(2147483649);
-- INSERT INTO t3 VALUES(2147483650);
-- INSERT INTO t3 VALUES(-2147483646);
-- INSERT INTO t3 VALUES(-2147483647);
-- INSERT INTO t3 VALUES(-2147483648);
-- INSERT INTO t3 VALUES(-2147483649);
-- INSERT INTO t3 VALUES(-2147483650);
-- INSERT INTO t3 VALUES(4294967294);
-- INSERT INTO t3 VALUES(4294967295);
-- INSERT INTO t3 VALUES(4294967296);
-- INSERT INTO t3 VALUES(4294967297);
-- INSERT INTO t3 VALUES(4294967298);
-- INSERT INTO t3 VALUES(-4294967294);
-- INSERT INTO t3 VALUES(-4294967295);
-- INSERT INTO t3 VALUES(-4294967296);
-- INSERT INTO t3 VALUES(-4294967297);
-- INSERT INTO t3 VALUES(-4294967298);
-- INSERT INTO t3 VALUES(8589934590);
-- INSERT INTO t3 VALUES(8589934591);
-- INSERT INTO t3 VALUES(8589934592);
-- INSERT INTO t3 VALUES(8589934593);
-- INSERT INTO t3 VALUES(8589934594);
-- INSERT INTO t3 VALUES(-8589934590);
-- INSERT INTO t3 VALUES(-8589934591);
-- INSERT INTO t3 VALUES(-8589934592);
-- INSERT INTO t3 VALUES(-8589934593);
-- INSERT INTO t3 VALUES(-8589934594);
-- INSERT INTO t3 VALUES(17179869182);
-- INSERT INTO t3 VALUES(17179869183);
-- INSERT INTO t3 VALUES(17179869184);
-- INSERT INTO t3 VALUES(17179869185);
-- INSERT INTO t3 VALUES(17179869186);
-- INSERT INTO t3 VALUES(-17179869182);
-- INSERT INTO t3 VALUES(-17179869183);
-- INSERT INTO t3 VALUES(-17179869184);
-- INSERT INTO t3 VALUES(-17179869185);
-- INSERT INTO t3 VALUES(-17179869186);
-- INSERT INTO t3 VALUES(34359738366);
-- INSERT INTO t3 VALUES(34359738367);
-- INSERT INTO t3 VALUES(34359738368);
-- INSERT INTO t3 VALUES(34359738369);
-- INSERT INTO t3 VALUES(34359738370);
-- INSERT INTO t3 VALUES(-34359738366);
-- INSERT INTO t3 VALUES(-34359738367);
-- INSERT INTO t3 VALUES(-34359738368);
-- INSERT INTO t3 VALUES(-34359738369);
-- INSERT INTO t3 VALUES(-34359738370);
-- INSERT INTO t3 VALUES(68719476734);
-- INSERT INTO t3 VALUES(68719476735);
-- INSERT INTO t3 VALUES(68719476736);
-- INSERT INTO t3 VALUES(68719476737);
-- INSERT INTO t3 VALUES(68719476738);
-- INSERT INTO t3 VALUES(-68719476734);
-- INSERT INTO t3 VALUES(-68719476735);
-- INSERT INTO t3 VALUES(-68719476736);
-- INSERT INTO t3 VALUES(-68719476737);
-- INSERT INTO t3 VALUES(-68719476738);
-- INSERT INTO t3 VALUES(137438953470);
-- INSERT INTO t3 VALUES(137438953471);
-- INSERT INTO t3 VALUES(137438953472);
-- INSERT INTO t3 VALUES(137438953473);
-- INSERT INTO t3 VALUES(137438953474);
-- INSERT INTO t3 VALUES(-137438953470);
-- INSERT INTO t3 VALUES(-137438953471);
-- INSERT INTO t3 VALUES(-137438953472);
-- INSERT INTO t3 VALUES(-137438953473);
-- INSERT INTO t3 VALUES(-137438953474);
-- INSERT INTO t3 VALUES(274877906942);
-- INSERT INTO t3 VALUES(274877906943);
-- INSERT INTO t3 VALUES(274877906944);
-- INSERT INTO t3 VALUES(274877906945);
-- INSERT INTO t3 VALUES(274877906946);
-- INSERT INTO t3 VALUES(-274877906942);
-- INSERT INTO t3 VALUES(-274877906943);
-- INSERT INTO t3 VALUES(-274877906944);
-- INSERT INTO t3 VALUES(-274877906945);
-- INSERT INTO t3 VALUES(-274877906946);
-- INSERT INTO t3 VALUES(549755813886);
-- INSERT INTO t3 VALUES(549755813887);
-- INSERT INTO t3 VALUES(549755813888);
-- INSERT INTO t3 VALUES(549755813889);
-- INSERT INTO t3 VALUES(549755813890);
-- INSERT INTO t3 VALUES(-549755813886);
-- INSERT INTO t3 VALUES(-549755813887);
-- INSERT INTO t3 VALUES(-549755813888);
-- INSERT INTO t3 VALUES(-549755813889);
-- INSERT INTO t3 VALUES(-549755813890);
-- INSERT INTO t3 VALUES(1099511627774);
-- INSERT INTO t3 VALUES(1099511627775);
-- INSERT INTO t3 VALUES(1099511627776);
-- INSERT INTO t3 VALUES(1099511627777);
-- INSERT INTO t3 VALUES(1099511627778);
-- INSERT INTO t3 VALUES(-1099511627774);
-- INSERT INTO t3 VALUES(-1099511627775);
-- INSERT INTO t3 VALUES(-1099511627776);
-- INSERT INTO t3 VALUES(-1099511627777);
-- INSERT INTO t3 VALUES(-1099511627778);
-- INSERT INTO t3 VALUES(2199023255550);
-- INSERT INTO t3 VALUES(2199023255551);
-- INSERT INTO t3 VALUES(2199023255552);
-- INSERT INTO t3 VALUES(2199023255553);
-- INSERT INTO t3 VALUES(2199023255554);
-- INSERT INTO t3 VALUES(-2199023255550);
-- INSERT INTO t3 VALUES(-2199023255551);
-- INSERT INTO t3 VALUES(-2199023255552);
-- INSERT INTO t3 VALUES(-2199023255553);
-- INSERT INTO t3 VALUES(-2199023255554);
-- INSERT INTO t3 VALUES(4398046511102);
-- INSERT INTO t3 VALUES(4398046511103);
-- INSERT INTO t3 VALUES(4398046511104);
-- INSERT INTO t3 VALUES(4398046511105);
-- INSERT INTO t3 VALUES(4398046511106);
-- INSERT INTO t3 VALUES(-4398046511102);
-- INSERT INTO t3 VALUES(-4398046511103);
-- INSERT INTO t3 VALUES(-4398046511104);
-- INSERT INTO t3 VALUES(-4398046511105);
-- INSERT INTO t3 VALUES(-4398046511106);
-- INSERT INTO t3 VALUES(8796093022206);
-- INSERT INTO t3 VALUES(8796093022207);
-- INSERT INTO t3 VALUES(8796093022208);
-- INSERT INTO t3 VALUES(8796093022209);
-- INSERT INTO t3 VALUES(8796093022210);
-- INSERT INTO t3 VALUES(-8796093022206);
-- INSERT INTO t3 VALUES(-8796093022207);
-- INSERT INTO t3 VALUES(-8796093022208);
-- INSERT INTO t3 VALUES(-8796093022209);
-- INSERT INTO t3 VALUES(-8796093022210);
-- INSERT INTO t3 VALUES(17592186044414);
-- INSERT INTO t3 VALUES(17592186044415);
-- INSERT INTO t3 VALUES(17592186044416);
-- INSERT INTO t3 VALUES(17592186044417);
-- INSERT INTO t3 VALUES(17592186044418);
-- INSERT INTO t3 VALUES(-17592186044414);
-- INSERT INTO t3 VALUES(-17592186044415);
-- INSERT INTO t3 VALUES(-17592186044416);
-- INSERT INTO t3 VALUES(-17592186044417);
-- INSERT INTO t3 VALUES(-17592186044418);
-- INSERT INTO t3 VALUES(35184372088830);
-- INSERT INTO t3 VALUES(35184372088831);
-- INSERT INTO t3 VALUES(35184372088832);
-- INSERT INTO t3 VALUES(35184372088833);
-- INSERT INTO t3 VALUES(35184372088834);
-- INSERT INTO t3 VALUES(-35184372088830);
-- INSERT INTO t3 VALUES(-35184372088831);
-- INSERT INTO t3 VALUES(-35184372088832);
-- INSERT INTO t3 VALUES(-35184372088833);
-- INSERT INTO t3 VALUES(-35184372088834);
-- INSERT INTO t3 VALUES(70368744177662);
-- INSERT INTO t3 VALUES(70368744177663);
-- INSERT INTO t3 VALUES(70368744177664);
-- INSERT INTO t3 VALUES(70368744177665);
-- INSERT INTO t3 VALUES(70368744177666);
-- INSERT INTO t3 VALUES(-70368744177662);
-- INSERT INTO t3 VALUES(-70368744177663);
-- INSERT INTO t3 VALUES(-70368744177664);
-- INSERT INTO t3 VALUES(-70368744177665);
-- INSERT INTO t3 VALUES(-70368744177666);
-- INSERT INTO t3 VALUES(140737488355326);
-- INSERT INTO t3 VALUES(140737488355327);
-- INSERT INTO t3 VALUES(140737488355328);
-- INSERT INTO t3 VALUES(140737488355329);
-- INSERT INTO t3 VALUES(140737488355330);
-- INSERT INTO t3 VALUES(-140737488355326);
-- INSERT INTO t3 VALUES(-140737488355327);
-- INSERT INTO t3 VALUES(-140737488355328);
-- INSERT INTO t3 VALUES(-140737488355329);
-- INSERT INTO t3 VALUES(-140737488355330);
-- INSERT INTO t3 VALUES(281474976710654);
-- INSERT INTO t3 VALUES(281474976710655);
-- INSERT INTO t3 VALUES(281474976710656);
-- INSERT INTO t3 VALUES(281474976710657);
-- INSERT INTO t3 VALUES(281474976710658);
-- INSERT INTO t3 VALUES(-281474976710654);
-- INSERT INTO t3 VALUES(-281474976710655);
-- INSERT INTO t3 VALUES(-281474976710656);
-- INSERT INTO t3 VALUES(-281474976710657);
-- INSERT INTO t3 VALUES(-281474976710658);
-- INSERT INTO t3 VALUES(562949953421310);
-- INSERT INTO t3 VALUES(562949953421311);
-- INSERT INTO t3 VALUES(562949953421312);
-- INSERT INTO t3 VALUES(562949953421313);
-- INSERT INTO t3 VALUES(562949953421314);
-- INSERT INTO t3 VALUES(-562949953421310);
-- INSERT INTO t3 VALUES(-562949953421311);
-- INSERT INTO t3 VALUES(-562949953421312);
-- INSERT INTO t3 VALUES(-562949953421313);
-- INSERT INTO t3 VALUES(-562949953421314);
-- INSERT INTO t3 VALUES(1125899906842622);
-- INSERT INTO t3 VALUES(1125899906842623);
-- INSERT INTO t3 VALUES(1125899906842624);
-- INSERT INTO t3 VALUES(1125899906842625);
-- INSERT INTO t3 VALUES(1125899906842626);
-- INSERT INTO t3 VALUES(-1125899906842622);
-- INSERT INTO t3 VALUES(-1125899906842623);
-- INSERT INTO t3 VALUES(-1125899906842624);
-- INSERT INTO t3 VALUES(-1125899906842625);
-- INSERT INTO t3 VALUES(-1125899906842626);
-- INSERT INTO t3 VALUES(2251799813685246);
-- INSERT INTO t3 VALUES(2251799813685247);
-- INSERT INTO t3 VALUES(2251799813685248);
-- INSERT INTO t3 VALUES(2251799813685249);
-- INSERT INTO t3 VALUES(2251799813685250);
-- INSERT INTO t3 VALUES(-2251799813685246);
-- INSERT INTO t3 VALUES(-2251799813685247);
-- INSERT INTO t3 VALUES(-2251799813685248);
-- INSERT INTO t3 VALUES(-2251799813685249);
-- INSERT INTO t3 VALUES(-2251799813685250);
-- INSERT INTO t3 VALUES(4503599627370494);
-- INSERT INTO t3 VALUES(4503599627370495);
-- INSERT INTO t3 VALUES(4503599627370496);
-- INSERT INTO t3 VALUES(4503599627370497);
-- INSERT INTO t3 VALUES(4503599627370498);
-- INSERT INTO t3 VALUES(-4503599627370494);
-- INSERT INTO t3 VALUES(-4503599627370495);
-- INSERT INTO t3 VALUES(-4503599627370496);
-- INSERT INTO t3 VALUES(-4503599627370497);
-- INSERT INTO t3 VALUES(-4503599627370498);
-- INSERT INTO t3 VALUES(9007199254740990);
-- INSERT INTO t3 VALUES(9007199254740991);
-- INSERT INTO t3 VALUES(9007199254740992);
-- INSERT INTO t3 VALUES(9007199254740993);
-- INSERT INTO t3 VALUES(9007199254740994);
-- INSERT INTO t3 VALUES(-9007199254740990);
-- INSERT INTO t3 VALUES(-9007199254740991);
-- INSERT INTO t3 VALUES(-9007199254740992);
-- INSERT INTO t3 VALUES(-9007199254740993);
-- INSERT INTO t3 VALUES(-9007199254740994);
-- INSERT INTO t3 VALUES(18014398509481982);
-- INSERT INTO t3 VALUES(18014398509481983);
-- INSERT INTO t3 VALUES(18014398509481984);
-- INSERT INTO t3 VALUES(18014398509481985);
-- INSERT INTO t3 VALUES(18014398509481986);
-- INSERT INTO t3 VALUES(-18014398509481982);
-- INSERT INTO t3 VALUES(-18014398509481983);
-- INSERT INTO t3 VALUES(-18014398509481984);
-- INSERT INTO t3 VALUES(-18014398509481985);
-- INSERT INTO t3 VALUES(-18014398509481986);
-- INSERT INTO t3 VALUES(36028797018963966);
-- INSERT INTO t3 VALUES(36028797018963967);
-- INSERT INTO t3 VALUES(36028797018963968);
-- INSERT INTO t3 VALUES(36028797018963969);
-- INSERT INTO t3 VALUES(36028797018963970);
-- INSERT INTO t3 VALUES(-36028797018963966);
-- INSERT INTO t3 VALUES(-36028797018963967);
-- INSERT INTO t3 VALUES(-36028797018963968);
-- INSERT INTO t3 VALUES(-36028797018963969);
-- INSERT INTO t3 VALUES(-36028797018963970);
-- INSERT INTO t3 VALUES(72057594037927934);
-- INSERT INTO t3 VALUES(72057594037927935);
-- INSERT INTO t3 VALUES(72057594037927936);
-- INSERT INTO t3 VALUES(72057594037927937);
-- INSERT INTO t3 VALUES(72057594037927938);
-- INSERT INTO t3 VALUES(-72057594037927934);
-- INSERT INTO t3 VALUES(-72057594037927935);
-- INSERT INTO t3 VALUES(-72057594037927936);
-- INSERT INTO t3 VALUES(-72057594037927937);
-- INSERT INTO t3 VALUES(-72057594037927938);
-- INSERT INTO t3 VALUES(144115188075855870);
-- INSERT INTO t3 VALUES(144115188075855871);
-- INSERT INTO t3 VALUES(144115188075855872);
-- INSERT INTO t3 VALUES(144115188075855873);
-- INSERT INTO t3 VALUES(144115188075855874);
-- INSERT INTO t3 VALUES(-144115188075855870);
-- INSERT INTO t3 VALUES(-144115188075855871);
-- INSERT INTO t3 VALUES(-144115188075855872);
-- INSERT INTO t3 VALUES(-144115188075855873);
-- INSERT INTO t3 VALUES(-144115188075855874);
-- INSERT INTO t3 VALUES(288230376151711742);
-- INSERT INTO t3 VALUES(288230376151711743);
-- INSERT INTO t3 VALUES(288230376151711744);
-- INSERT INTO t3 VALUES(288230376151711745);
-- INSERT INTO t3 VALUES(288230376151711746);
-- INSERT INTO t3 VALUES(-288230376151711742);
-- INSERT INTO t3 VALUES(-288230376151711743);
-- INSERT INTO t3 VALUES(-288230376151711744);
-- INSERT INTO t3 VALUES(-288230376151711745);
-- INSERT INTO t3 VALUES(-288230376151711746);
-- INSERT INTO t3 VALUES(576460752303423486);
-- INSERT INTO t3 VALUES(576460752303423487);
-- INSERT INTO t3 VALUES(576460752303423488);
-- INSERT INTO t3 VALUES(576460752303423489);
-- INSERT INTO t3 VALUES(576460752303423490);
-- INSERT INTO t3 VALUES(-576460752303423486);
-- INSERT INTO t3 VALUES(-576460752303423487);
-- INSERT INTO t3 VALUES(-576460752303423488);
-- INSERT INTO t3 VALUES(-576460752303423489);
-- INSERT INTO t3 VALUES(-576460752303423490);
-- INSERT INTO t3 VALUES(1152921504606846974);
-- INSERT INTO t3 VALUES(1152921504606846975);
-- INSERT INTO t3 VALUES(1152921504606846976);
-- INSERT INTO t3 VALUES(1152921504606846977);
-- INSERT INTO t3 VALUES(1152921504606846978);
-- INSERT INTO t3 VALUES(-1152921504606846974);
-- INSERT INTO t3 VALUES(-1152921504606846975);
-- INSERT INTO t3 VALUES(-1152921504606846976);
-- INSERT INTO t3 VALUES(-1152921504606846977);
-- INSERT INTO t3 VALUES(-1152921504606846978);
-- INSERT INTO t3 VALUES(2305843009213693950);
-- INSERT INTO t3 VALUES(2305843009213693951);
-- INSERT INTO t3 VALUES(2305843009213693952);
-- INSERT INTO t3 VALUES(2305843009213693953);
-- INSERT INTO t3 VALUES(2305843009213693954);
-- INSERT INTO t3 VALUES(-2305843009213693950);
-- INSERT INTO t3 VALUES(-2305843009213693951);
-- INSERT INTO t3 VALUES(-2305843009213693952);
-- INSERT INTO t3 VALUES(-2305843009213693953);
-- INSERT INTO t3 VALUES(-2305843009213693954);
-- INSERT INTO t3 VALUES(4611686018427387902);
-- INSERT INTO t3 VALUES(4611686018427387903);
-- INSERT INTO t3 VALUES(4611686018427387904);
-- INSERT INTO t3 VALUES(4611686018427387905);
-- INSERT INTO t3 VALUES(4611686018427387906);
-- INSERT INTO t3 VALUES(-4611686018427387902);
-- INSERT INTO t3 VALUES(-4611686018427387903);
-- INSERT INTO t3 VALUES(-4611686018427387904);
-- INSERT INTO t3 VALUES(-4611686018427387905);
-- INSERT INTO t3 VALUES(-4611686018427387906);
-- INSERT INTO t3 VALUES(9223372036854775806);
-- INSERT INTO t3 VALUES(9223372036854775807);
-- INSERT INTO t3 VALUES(-9223372036854775806);
-- INSERT INTO t3 VALUES(-9223372036854775807);
-- INSERT INTO t3 VALUES(-9223372036854775808);
-- SELECT x FROM t3 ORDER BY x;
-- }
CREATE TABLE t3(x);
INSERT INTO t3 VALUES(-18);
INSERT INTO t3 VALUES(-17);
INSERT INTO t3 VALUES(-16);
INSERT INTO t3 VALUES(-15);
INSERT INTO t3 VALUES(-14);
INSERT INTO t3 VALUES(-13);
INSERT INTO t3 VALUES(-12);
INSERT INTO t3 VALUES(-11);
INSERT INTO t3 VALUES(-10);
INSERT INTO t3 VALUES(-9);
INSERT INTO t3 VALUES(-8);
INSERT INTO t3 VALUES(-7);
INSERT INTO t3 VALUES(-6);
INSERT INTO t3 VALUES(-5);
INSERT INTO t3 VALUES(-4);
INSERT INTO t3 VALUES(-3);
INSERT INTO t3 VALUES(-2);
INSERT INTO t3 VALUES(-1);
INSERT INTO t3 VALUES(0);
INSERT INTO t3 VALUES(1);
INSERT INTO t3 VALUES(2);
INSERT INTO t3 VALUES(3);
INSERT INTO t3 VALUES(4);
INSERT INTO t3 VALUES(5);
INSERT INTO t3 VALUES(6);
INSERT INTO t3 VALUES(7);
INSERT INTO t3 VALUES(8);
INSERT INTO t3 VALUES(9);
INSERT INTO t3 VALUES(10);
INSERT INTO t3 VALUES(11);
INSERT INTO t3 VALUES(12);
INSERT INTO t3 VALUES(13);
INSERT INTO t3 VALUES(14);
INSERT INTO t3 VALUES(15);
INSERT INTO t3 VALUES(16);
INSERT INTO t3 VALUES(17);
INSERT INTO t3 VALUES(18);
INSERT INTO t3 VALUES(30);
INSERT INTO t3 VALUES(31);
INSERT INTO t3 VALUES(32);
INSERT INTO t3 VALUES(33);
INSERT INTO t3 VALUES(34);
INSERT INTO t3 VALUES(-30);
INSERT INTO t3 VALUES(-31);
INSERT INTO t3 VALUES(-32);
INSERT INTO t3 VALUES(-33);
INSERT INTO t3 VALUES(-34);
INSERT INTO t3 VALUES(62);
INSERT INTO t3 VALUES(63);
INSERT INTO t3 VALUES(64);
INSERT INTO t3 VALUES(65);
INSERT INTO t3 VALUES(66);
INSERT INTO t3 VALUES(-62);
INSERT INTO t3 VALUES(-63);
INSERT INTO t3 VALUES(-64);
INSERT INTO t3 VALUES(-65);
INSERT INTO t3 VALUES(-66);
INSERT INTO t3 VALUES(126);
INSERT INTO t3 VALUES(127);
INSERT INTO t3 VALUES(128);
INSERT INTO t3 VALUES(129);
INSERT INTO t3 VALUES(130);
INSERT INTO t3 VALUES(-126);
INSERT INTO t3 VALUES(-127);
INSERT INTO t3 VALUES(-128);
INSERT INTO t3 VALUES(-129);
INSERT INTO t3 VALUES(-130);
INSERT INTO t3 VALUES(254);
INSERT INTO t3 VALUES(255);
INSERT INTO t3 VALUES(256);
INSERT INTO t3 VALUES(257);
INSERT INTO t3 VALUES(258);
INSERT INTO t3 VALUES(-254);
INSERT INTO t3 VALUES(-255);
INSERT INTO t3 VALUES(-256);
INSERT INTO t3 VALUES(-257);
INSERT INTO t3 VALUES(-258);
INSERT INTO t3 VALUES(510);
INSERT INTO t3 VALUES(511);
INSERT INTO t3 VALUES(512);
INSERT INTO t3 VALUES(513);
INSERT INTO t3 VALUES(514);
INSERT INTO t3 VALUES(-510);
INSERT INTO t3 VALUES(-511);
INSERT INTO t3 VALUES(-512);
INSERT INTO t3 VALUES(-513);
INSERT INTO t3 VALUES(-514);
INSERT INTO t3 VALUES(1022);
INSERT INTO t3 VALUES(1023);
INSERT INTO t3 VALUES(1024);
INSERT INTO t3 VALUES(1025);
INSERT INTO t3 VALUES(1026);
INSERT INTO t3 VALUES(-1022);
INSERT INTO t3 VALUES(-1023);
INSERT INTO t3 VALUES(-1024);
INSERT INTO t3 VALUES(-1025);
INSERT INTO t3 VALUES(-1026);
INSERT INTO t3 VALUES(2046);
INSERT INTO t3 VALUES(2047);
INSERT INTO t3 VALUES(2048);
INSERT INTO t3 VALUES(2049);
INSERT INTO t3 VALUES(2050);
INSERT INTO t3 VALUES(-2046);
INSERT INTO t3 VALUES(-2047);
INSERT INTO t3 VALUES(-2048);
INSERT INTO t3 VALUES(-2049);
INSERT INTO t3 VALUES(-2050);
INSERT INTO t3 VALUES(4094);
INSERT INTO t3 VALUES(4095);
INSERT INTO t3 VALUES(4096);
INSERT INTO t3 VALUES(4097);
INSERT INTO t3 VALUES(4098);
INSERT INTO t3 VALUES(-4094);
INSERT INTO t3 VALUES(-4095);
INSERT INTO t3 VALUES(-4096);
INSERT INTO t3 VALUES(-4097);
INSERT INTO t3 VALUES(-4098);
INSERT INTO t3 VALUES(8190);
INSERT INTO t3 VALUES(8191);
INSERT INTO t3 VALUES(8192);
INSERT INTO t3 VALUES(8193);
INSERT INTO t3 VALUES(8194);
INSERT INTO t3 VALUES(-8190);
INSERT INTO t3 VALUES(-8191);
INSERT INTO t3 VALUES(-8192);
INSERT INTO t3 VALUES(-8193);
INSERT INTO t3 VALUES(-8194);
INSERT INTO t3 VALUES(16382);
INSERT INTO t3 VALUES(16383);
INSERT INTO t3 VALUES(16384);
INSERT INTO t3 VALUES(16385);
INSERT INTO t3 VALUES(16386);
INSERT INTO t3 VALUES(-16382);
INSERT INTO t3 VALUES(-16383);
INSERT INTO t3 VALUES(-16384);
INSERT INTO t3 VALUES(-16385);
INSERT INTO t3 VALUES(-16386);
INSERT INTO t3 VALUES(32766);
INSERT INTO t3 VALUES(32767);
INSERT INTO t3 VALUES(32768);
INSERT INTO t3 VALUES(32769);
INSERT INTO t3 VALUES(32770);
INSERT INTO t3 VALUES(-32766);
INSERT INTO t3 VALUES(-32767);
INSERT INTO t3 VALUES(-32768);
INSERT INTO t3 VALUES(-32769);
INSERT INTO t3 VALUES(-32770);
INSERT INTO t3 VALUES(65534);
INSERT INTO t3 VALUES(65535);
INSERT INTO t3 VALUES(65536);
INSERT INTO t3 VALUES(65537);
INSERT INTO t3 VALUES(65538);
INSERT INTO t3 VALUES(-65534);
INSERT INTO t3 VALUES(-65535);
INSERT INTO t3 VALUES(-65536);
INSERT INTO t3 VALUES(-65537);
INSERT INTO t3 VALUES(-65538);
INSERT INTO t3 VALUES(131070);
INSERT INTO t3 VALUES(131071);
INSERT INTO t3 VALUES(131072);
INSERT INTO t3 VALUES(131073);
INSERT INTO t3 VALUES(131074);
INSERT INTO t3 VALUES(-131070);
INSERT INTO t3 VALUES(-131071);
INSERT INTO t3 VALUES(-131072);
INSERT INTO t3 VALUES(-131073);
INSERT INTO t3 VALUES(-131074);
INSERT INTO t3 VALUES(262142);
INSERT INTO t3 VALUES(262143);
INSERT INTO t3 VALUES(262144);
INSERT INTO t3 VALUES(262145);
INSERT INTO t3 VALUES(262146);
INSERT INTO t3 VALUES(-262142);
INSERT INTO t3 VALUES(-262143);
INSERT INTO t3 VALUES(-262144);
INSERT INTO t3 VALUES(-262145);
INSERT INTO t3 VALUES(-262146);
INSERT INTO t3 VALUES(524286);
INSERT INTO t3 VALUES(524287);
INSERT INTO t3 VALUES(524288);
INSERT INTO t3 VALUES(524289);
INSERT INTO t3 VALUES(524290);
INSERT INTO t3 VALUES(-524286);
INSERT INTO t3 VALUES(-524287);
INSERT INTO t3 VALUES(-524288);
INSERT INTO t3 VALUES(-524289);
INSERT INTO t3 VALUES(-524290);
INSERT INTO t3 VALUES(1048574);
INSERT INTO t3 VALUES(1048575);
INSERT INTO t3 VALUES(1048576);
INSERT INTO t3 VALUES(1048577);
INSERT INTO t3 VALUES(1048578);
INSERT INTO t3 VALUES(-1048574);
INSERT INTO t3 VALUES(-1048575);
INSERT INTO t3 VALUES(-1048576);
INSERT INTO t3 VALUES(-1048577);
INSERT INTO t3 VALUES(-1048578);
INSERT INTO t3 VALUES(2097150);
INSERT INTO t3 VALUES(2097151);
INSERT INTO t3 VALUES(2097152);
INSERT INTO t3 VALUES(2097153);
INSERT INTO t3 VALUES(2097154);
INSERT INTO t3 VALUES(-2097150);
INSERT INTO t3 VALUES(-2097151);
INSERT INTO t3 VALUES(-2097152);
INSERT INTO t3 VALUES(-2097153);
INSERT INTO t3 VALUES(-2097154);
INSERT INTO t3 VALUES(4194302);
INSERT INTO t3 VALUES(4194303);
INSERT INTO t3 VALUES(4194304);
INSERT INTO t3 VALUES(4194305);
INSERT INTO t3 VALUES(4194306);
INSERT INTO t3 VALUES(-4194302);
INSERT INTO t3 VALUES(-4194303);
INSERT INTO t3 VALUES(-4194304);
INSERT INTO t3 VALUES(-4194305);
INSERT INTO t3 VALUES(-4194306);
INSERT INTO t3 VALUES(8388606);
INSERT INTO t3 VALUES(8388607);
INSERT INTO t3 VALUES(8388608);
INSERT INTO t3 VALUES(8388609);
INSERT INTO t3 VALUES(8388610);
INSERT INTO t3 VALUES(-8388606);
INSERT INTO t3 VALUES(-8388607);
INSERT INTO t3 VALUES(-8388608);
INSERT INTO t3 VALUES(-8388609);
INSERT INTO t3 VALUES(-8388610);
INSERT INTO t3 VALUES(16777214);
INSERT INTO t3 VALUES(16777215);
INSERT INTO t3 VALUES(16777216);
INSERT INTO t3 VALUES(16777217);
INSERT INTO t3 VALUES(16777218);
INSERT INTO t3 VALUES(-16777214);
INSERT INTO t3 VALUES(-16777215);
INSERT INTO t3 VALUES(-16777216);
INSERT INTO t3 VALUES(-16777217);
INSERT INTO t3 VALUES(-16777218);
INSERT INTO t3 VALUES(33554430);
INSERT INTO t3 VALUES(33554431);
INSERT INTO t3 VALUES(33554432);
INSERT INTO t3 VALUES(33554433);
INSERT INTO t3 VALUES(33554434);
INSERT INTO t3 VALUES(-33554430);
INSERT INTO t3 VALUES(-33554431);
INSERT INTO t3 VALUES(-33554432);
INSERT INTO t3 VALUES(-33554433);
INSERT INTO t3 VALUES(-33554434);
INSERT INTO t3 VALUES(67108862);
INSERT INTO t3 VALUES(67108863);
INSERT INTO t3 VALUES(67108864);
INSERT INTO t3 VALUES(67108865);
INSERT INTO t3 VALUES(67108866);
INSERT INTO t3 VALUES(-67108862);
INSERT INTO t3 VALUES(-67108863);
INSERT INTO t3 VALUES(-67108864);
INSERT INTO t3 VALUES(-67108865);
INSERT INTO t3 VALUES(-67108866);
INSERT INTO t3 VALUES(134217726);
INSERT INTO t3 VALUES(134217727);
INSERT INTO t3 VALUES(134217728);
INSERT INTO t3 VALUES(134217729);
INSERT INTO t3 VALUES(134217730);
INSERT INTO t3 VALUES(-134217726);
INSERT INTO t3 VALUES(-134217727);
INSERT INTO t3 VALUES(-134217728);
INSERT INTO t3 VALUES(-134217729);
INSERT INTO t3 VALUES(-134217730);
INSERT INTO t3 VALUES(268435454);
INSERT INTO t3 VALUES(268435455);
INSERT INTO t3 VALUES(268435456);
INSERT INTO t3 VALUES(268435457);
INSERT INTO t3 VALUES(268435458);
INSERT INTO t3 VALUES(-268435454);
INSERT INTO t3 VALUES(-268435455);
INSERT INTO t3 VALUES(-268435456);
INSERT INTO t3 VALUES(-268435457);
INSERT INTO t3 VALUES(-268435458);
INSERT INTO t3 VALUES(536870910);
INSERT INTO t3 VALUES(536870911);
INSERT INTO t3 VALUES(536870912);
INSERT INTO t3 VALUES(536870913);
INSERT INTO t3 VALUES(536870914);
INSERT INTO t3 VALUES(-536870910);
INSERT INTO t3 VALUES(-536870911);
INSERT INTO t3 VALUES(-536870912);
INSERT INTO t3 VALUES(-536870913);
INSERT INTO t3 VALUES(-536870914);
INSERT INTO t3 VALUES(1073741822);
INSERT INTO t3 VALUES(1073741823);
INSERT INTO t3 VALUES(1073741824);
INSERT INTO t3 VALUES(1073741825);
INSERT INTO t3 VALUES(1073741826);
INSERT INTO t3 VALUES(-1073741822);
INSERT INTO t3 VALUES(-1073741823);
INSERT INTO t3 VALUES(-1073741824);
INSERT INTO t3 VALUES(-1073741825);
INSERT INTO t3 VALUES(-1073741826);
INSERT INTO t3 VALUES(2147483646);
INSERT INTO t3 VALUES(2147483647);
INSERT INTO t3 VALUES(2147483648);
INSERT INTO t3 VALUES(2147483649);
INSERT INTO t3 VALUES(2147483650);
INSERT INTO t3 VALUES(-2147483646);
INSERT INTO t3 VALUES(-2147483647);
INSERT INTO t3 VALUES(-2147483648);
INSERT INTO t3 VALUES(-2147483649);
INSERT INTO t3 VALUES(-2147483650);
INSERT INTO t3 VALUES(4294967294);
INSERT INTO t3 VALUES(4294967295);
INSERT INTO t3 VALUES(4294967296);
INSERT INTO t3 VALUES(4294967297);
INSERT INTO t3 VALUES(4294967298);
INSERT INTO t3 VALUES(-4294967294);
INSERT INTO t3 VALUES(-4294967295);
INSERT INTO t3 VALUES(-4294967296);
INSERT INTO t3 VALUES(-4294967297);
INSERT INTO t3 VALUES(-4294967298);
INSERT INTO t3 VALUES(8589934590);
INSERT INTO t3 VALUES(8589934591);
INSERT INTO t3 VALUES(8589934592);
INSERT INTO t3 VALUES(8589934593);
INSERT INTO t3 VALUES(8589934594);
INSERT INTO t3 VALUES(-8589934590);
INSERT INTO t3 VALUES(-8589934591);
INSERT INTO t3 VALUES(-8589934592);
INSERT INTO t3 VALUES(-8589934593);
INSERT INTO t3 VALUES(-8589934594);
INSERT INTO t3 VALUES(17179869182);
INSERT INTO t3 VALUES(17179869183);
INSERT INTO t3 VALUES(17179869184);
INSERT INTO t3 VALUES(17179869185);
INSERT INTO t3 VALUES(17179869186);
INSERT INTO t3 VALUES(-17179869182);
INSERT INTO t3 VALUES(-17179869183);
INSERT INTO t3 VALUES(-17179869184);
INSERT INTO t3 VALUES(-17179869185);
INSERT INTO t3 VALUES(-17179869186);
INSERT INTO t3 VALUES(34359738366);
INSERT INTO t3 VALUES(34359738367);
INSERT INTO t3 VALUES(34359738368);
INSERT INTO t3 VALUES(34359738369);
INSERT INTO t3 VALUES(34359738370);
INSERT INTO t3 VALUES(-34359738366);
INSERT INTO t3 VALUES(-34359738367);
INSERT INTO t3 VALUES(-34359738368);
INSERT INTO t3 VALUES(-34359738369);
INSERT INTO t3 VALUES(-34359738370);
INSERT INTO t3 VALUES(68719476734);
INSERT INTO t3 VALUES(68719476735);
INSERT INTO t3 VALUES(68719476736);
INSERT INTO t3 VALUES(68719476737);
INSERT INTO t3 VALUES(68719476738);
INSERT INTO t3 VALUES(-68719476734);
INSERT INTO t3 VALUES(-68719476735);
INSERT INTO t3 VALUES(-68719476736);
INSERT INTO t3 VALUES(-68719476737);
INSERT INTO t3 VALUES(-68719476738);
INSERT INTO t3 VALUES(137438953470);
INSERT INTO t3 VALUES(137438953471);
INSERT INTO t3 VALUES(137438953472);
INSERT INTO t3 VALUES(137438953473);
INSERT INTO t3 VALUES(137438953474);
INSERT INTO t3 VALUES(-137438953470);
INSERT INTO t3 VALUES(-137438953471);
INSERT INTO t3 VALUES(-137438953472);
INSERT INTO t3 VALUES(-137438953473);
INSERT INTO t3 VALUES(-137438953474);
INSERT INTO t3 VALUES(274877906942);
INSERT INTO t3 VALUES(274877906943);
INSERT INTO t3 VALUES(274877906944);
INSERT INTO t3 VALUES(274877906945);
INSERT INTO t3 VALUES(274877906946);
INSERT INTO t3 VALUES(-274877906942);
INSERT INTO t3 VALUES(-274877906943);
INSERT INTO t3 VALUES(-274877906944);
INSERT INTO t3 VALUES(-274877906945);
INSERT INTO t3 VALUES(-274877906946);
INSERT INTO t3 VALUES(549755813886);
INSERT INTO t3 VALUES(549755813887);
INSERT INTO t3 VALUES(549755813888);
INSERT INTO t3 VALUES(549755813889);
INSERT INTO t3 VALUES(549755813890);
INSERT INTO t3 VALUES(-549755813886);
INSERT INTO t3 VALUES(-549755813887);
INSERT INTO t3 VALUES(-549755813888);
INSERT INTO t3 VALUES(-549755813889);
INSERT INTO t3 VALUES(-549755813890);
INSERT INTO t3 VALUES(1099511627774);
INSERT INTO t3 VALUES(1099511627775);
INSERT INTO t3 VALUES(1099511627776);
INSERT INTO t3 VALUES(1099511627777);
INSERT INTO t3 VALUES(1099511627778);
INSERT INTO t3 VALUES(-1099511627774);
INSERT INTO t3 VALUES(-1099511627775);
INSERT INTO t3 VALUES(-1099511627776);
INSERT INTO t3 VALUES(-1099511627777);
INSERT INTO t3 VALUES(-1099511627778);
INSERT INTO t3 VALUES(2199023255550);
INSERT INTO t3 VALUES(2199023255551);
INSERT INTO t3 VALUES(2199023255552);
INSERT INTO t3 VALUES(2199023255553);
INSERT INTO t3 VALUES(2199023255554);
INSERT INTO t3 VALUES(-2199023255550);
INSERT INTO t3 VALUES(-2199023255551);
INSERT INTO t3 VALUES(-2199023255552);
INSERT INTO t3 VALUES(-2199023255553);
INSERT INTO t3 VALUES(-2199023255554);
INSERT INTO t3 VALUES(4398046511102);
INSERT INTO t3 VALUES(4398046511103);
INSERT INTO t3 VALUES(4398046511104);
INSERT INTO t3 VALUES(4398046511105);
INSERT INTO t3 VALUES(4398046511106);
INSERT INTO t3 VALUES(-4398046511102);
INSERT INTO t3 VALUES(-4398046511103);
INSERT INTO t3 VALUES(-4398046511104);
INSERT INTO t3 VALUES(-4398046511105);
INSERT INTO t3 VALUES(-4398046511106);
INSERT INTO t3 VALUES(8796093022206);
INSERT INTO t3 VALUES(8796093022207);
INSERT INTO t3 VALUES(8796093022208);
INSERT INTO t3 VALUES(8796093022209);
INSERT INTO t3 VALUES(8796093022210);
INSERT INTO t3 VALUES(-8796093022206);
INSERT INTO t3 VALUES(-8796093022207);
INSERT INTO t3 VALUES(-8796093022208);
INSERT INTO t3 VALUES(-8796093022209);
INSERT INTO t3 VALUES(-8796093022210);
INSERT INTO t3 VALUES(17592186044414);
INSERT INTO t3 VALUES(17592186044415);
INSERT INTO t3 VALUES(17592186044416);
INSERT INTO t3 VALUES(17592186044417);
INSERT INTO t3 VALUES(17592186044418);
INSERT INTO t3 VALUES(-17592186044414);
INSERT INTO t3 VALUES(-17592186044415);
INSERT INTO t3 VALUES(-17592186044416);
INSERT INTO t3 VALUES(-17592186044417);
INSERT INTO t3 VALUES(-17592186044418);
INSERT INTO t3 VALUES(35184372088830);
INSERT INTO t3 VALUES(35184372088831);
INSERT INTO t3 VALUES(35184372088832);
INSERT INTO t3 VALUES(35184372088833);
INSERT INTO t3 VALUES(35184372088834);
INSERT INTO t3 VALUES(-35184372088830);
INSERT INTO t3 VALUES(-35184372088831);
INSERT INTO t3 VALUES(-35184372088832);
INSERT INTO t3 VALUES(-35184372088833);
INSERT INTO t3 VALUES(-35184372088834);
INSERT INTO t3 VALUES(70368744177662);
INSERT INTO t3 VALUES(70368744177663);
INSERT INTO t3 VALUES(70368744177664);
INSERT INTO t3 VALUES(70368744177665);
INSERT INTO t3 VALUES(70368744177666);
INSERT INTO t3 VALUES(-70368744177662);
INSERT INTO t3 VALUES(-70368744177663);
INSERT INTO t3 VALUES(-70368744177664);
INSERT INTO t3 VALUES(-70368744177665);
INSERT INTO t3 VALUES(-70368744177666);
INSERT INTO t3 VALUES(140737488355326);
INSERT INTO t3 VALUES(140737488355327);
INSERT INTO t3 VALUES(140737488355328);
INSERT INTO t3 VALUES(140737488355329);
INSERT INTO t3 VALUES(140737488355330);
INSERT INTO t3 VALUES(-140737488355326);
INSERT INTO t3 VALUES(-140737488355327);
INSERT INTO t3 VALUES(-140737488355328);
INSERT INTO t3 VALUES(-140737488355329);
INSERT INTO t3 VALUES(-140737488355330);
INSERT INTO t3 VALUES(281474976710654);
INSERT INTO t3 VALUES(281474976710655);
INSERT INTO t3 VALUES(281474976710656);
INSERT INTO t3 VALUES(281474976710657);
INSERT INTO t3 VALUES(281474976710658);
INSERT INTO t3 VALUES(-281474976710654);
INSERT INTO t3 VALUES(-281474976710655);
INSERT INTO t3 VALUES(-281474976710656);
INSERT INTO t3 VALUES(-281474976710657);
INSERT INTO t3 VALUES(-281474976710658);
INSERT INTO t3 VALUES(562949953421310);
INSERT INTO t3 VALUES(562949953421311);
INSERT INTO t3 VALUES(562949953421312);
INSERT INTO t3 VALUES(562949953421313);
INSERT INTO t3 VALUES(562949953421314);
INSERT INTO t3 VALUES(-562949953421310);
INSERT INTO t3 VALUES(-562949953421311);
INSERT INTO t3 VALUES(-562949953421312);
INSERT INTO t3 VALUES(-562949953421313);
INSERT INTO t3 VALUES(-562949953421314);
INSERT INTO t3 VALUES(1125899906842622);
INSERT INTO t3 VALUES(1125899906842623);
INSERT INTO t3 VALUES(1125899906842624);
INSERT INTO t3 VALUES(1125899906842625);
INSERT INTO t3 VALUES(1125899906842626);
INSERT INTO t3 VALUES(-1125899906842622);
INSERT INTO t3 VALUES(-1125899906842623);
INSERT INTO t3 VALUES(-1125899906842624);
INSERT INTO t3 VALUES(-1125899906842625);
INSERT INTO t3 VALUES(-1125899906842626);
INSERT INTO t3 VALUES(2251799813685246);
INSERT INTO t3 VALUES(2251799813685247);
INSERT INTO t3 VALUES(2251799813685248);
INSERT INTO t3 VALUES(2251799813685249);
INSERT INTO t3 VALUES(2251799813685250);
INSERT INTO t3 VALUES(-2251799813685246);
INSERT INTO t3 VALUES(-2251799813685247);
INSERT INTO t3 VALUES(-2251799813685248);
INSERT INTO t3 VALUES(-2251799813685249);
INSERT INTO t3 VALUES(-2251799813685250);
INSERT INTO t3 VALUES(4503599627370494);
INSERT INTO t3 VALUES(4503599627370495);
INSERT INTO t3 VALUES(4503599627370496);
INSERT INTO t3 VALUES(4503599627370497);
INSERT INTO t3 VALUES(4503599627370498);
INSERT INTO t3 VALUES(-4503599627370494);
INSERT INTO t3 VALUES(-4503599627370495);
INSERT INTO t3 VALUES(-4503599627370496);
INSERT INTO t3 VALUES(-4503599627370497);
INSERT INTO t3 VALUES(-4503599627370498);
INSERT INTO t3 VALUES(9007199254740990);
INSERT INTO t3 VALUES(9007199254740991);
INSERT INTO t3 VALUES(9007199254740992);
INSERT INTO t3 VALUES(9007199254740993);
INSERT INTO t3 VALUES(9007199254740994);
INSERT INTO t3 VALUES(-9007199254740990);
INSERT INTO t3 VALUES(-9007199254740991);
INSERT INTO t3 VALUES(-9007199254740992);
INSERT INTO t3 VALUES(-9007199254740993);
INSERT INTO t3 VALUES(-9007199254740994);
INSERT INTO t3 VALUES(18014398509481982);
INSERT INTO t3 VALUES(18014398509481983);
INSERT INTO t3 VALUES(18014398509481984);
INSERT INTO t3 VALUES(18014398509481985);
INSERT INTO t3 VALUES(18014398509481986);
INSERT INTO t3 VALUES(-18014398509481982);
INSERT INTO t3 VALUES(-18014398509481983);
INSERT INTO t3 VALUES(-18014398509481984);
INSERT INTO t3 VALUES(-18014398509481985);
INSERT INTO t3 VALUES(-18014398509481986);
INSERT INTO t3 VALUES(36028797018963966);
INSERT INTO t3 VALUES(36028797018963967);
INSERT INTO t3 VALUES(36028797018963968);
INSERT INTO t3 VALUES(36028797018963969);
INSERT INTO t3 VALUES(36028797018963970);
INSERT INTO t3 VALUES(-36028797018963966);
INSERT INTO t3 VALUES(-36028797018963967);
INSERT INTO t3 VALUES(-36028797018963968);
INSERT INTO t3 VALUES(-36028797018963969);
INSERT INTO t3 VALUES(-36028797018963970);
INSERT INTO t3 VALUES(72057594037927934);
INSERT INTO t3 VALUES(72057594037927935);
INSERT INTO t3 VALUES(72057594037927936);
INSERT INTO t3 VALUES(72057594037927937);
INSERT INTO t3 VALUES(72057594037927938);
INSERT INTO t3 VALUES(-72057594037927934);
INSERT INTO t3 VALUES(-72057594037927935);
INSERT INTO t3 VALUES(-72057594037927936);
INSERT INTO t3 VALUES(-72057594037927937);
INSERT INTO t3 VALUES(-72057594037927938);
INSERT INTO t3 VALUES(144115188075855870);
INSERT INTO t3 VALUES(144115188075855871);
INSERT INTO t3 VALUES(144115188075855872);
INSERT INTO t3 VALUES(144115188075855873);
INSERT INTO t3 VALUES(144115188075855874);
INSERT INTO t3 VALUES(-144115188075855870);
INSERT INTO t3 VALUES(-144115188075855871);
INSERT INTO t3 VALUES(-144115188075855872);
INSERT INTO t3 VALUES(-144115188075855873);
INSERT INTO t3 VALUES(-144115188075855874);
INSERT INTO t3 VALUES(288230376151711742);
INSERT INTO t3 VALUES(288230376151711743);
INSERT INTO t3 VALUES(288230376151711744);
INSERT INTO t3 VALUES(288230376151711745);
INSERT INTO t3 VALUES(288230376151711746);
INSERT INTO t3 VALUES(-288230376151711742);
INSERT INTO t3 VALUES(-288230376151711743);
INSERT INTO t3 VALUES(-288230376151711744);
INSERT INTO t3 VALUES(-288230376151711745);
INSERT INTO t3 VALUES(-288230376151711746);
INSERT INTO t3 VALUES(576460752303423486);
INSERT INTO t3 VALUES(576460752303423487);
INSERT INTO t3 VALUES(576460752303423488);
INSERT INTO t3 VALUES(576460752303423489);
INSERT INTO t3 VALUES(576460752303423490);
INSERT INTO t3 VALUES(-576460752303423486);
INSERT INTO t3 VALUES(-576460752303423487);
INSERT INTO t3 VALUES(-576460752303423488);
INSERT INTO t3 VALUES(-576460752303423489);
INSERT INTO t3 VALUES(-576460752303423490);
INSERT INTO t3 VALUES(1152921504606846974);
INSERT INTO t3 VALUES(1152921504606846975);
INSERT INTO t3 VALUES(1152921504606846976);
INSERT INTO t3 VALUES(1152921504606846977);
INSERT INTO t3 VALUES(1152921504606846978);
INSERT INTO t3 VALUES(-1152921504606846974);
INSERT INTO t3 VALUES(-1152921504606846975);
INSERT INTO t3 VALUES(-1152921504606846976);
INSERT INTO t3 VALUES(-1152921504606846977);
INSERT INTO t3 VALUES(-1152921504606846978);
INSERT INTO t3 VALUES(2305843009213693950);
INSERT INTO t3 VALUES(2305843009213693951);
INSERT INTO t3 VALUES(2305843009213693952);
INSERT INTO t3 VALUES(2305843009213693953);
INSERT INTO t3 VALUES(2305843009213693954);
INSERT INTO t3 VALUES(-2305843009213693950);
INSERT INTO t3 VALUES(-2305843009213693951);
INSERT INTO t3 VALUES(-2305843009213693952);
INSERT INTO t3 VALUES(-2305843009213693953);
INSERT INTO t3 VALUES(-2305843009213693954);
INSERT INTO t3 VALUES(4611686018427387902);
INSERT INTO t3 VALUES(4611686018427387903);
INSERT INTO t3 VALUES(4611686018427387904);
INSERT INTO t3 VALUES(4611686018427387905);
INSERT INTO t3 VALUES(4611686018427387906);
INSERT INTO t3 VALUES(-4611686018427387902);
INSERT INTO t3 VALUES(-4611686018427387903);
INSERT INTO t3 VALUES(-4611686018427387904);
INSERT INTO t3 VALUES(-4611686018427387905);
INSERT INTO t3 VALUES(-4611686018427387906);
INSERT INTO t3 VALUES(9223372036854775806);
INSERT INTO t3 VALUES(9223372036854775807);
INSERT INTO t3 VALUES(-9223372036854775806);
INSERT INTO t3 VALUES(-9223372036854775807);
INSERT INTO t3 VALUES(-9223372036854775808);
SELECT x FROM t3 ORDER BY x; | the_stack |
--
-- JOIN
-- Test JOIN clauses
--
CREATE TABLE J1_TBL (
i integer,
j integer,
t text
);
CREATE TABLE J2_TBL (
i integer,
k integer
);
INSERT INTO J1_TBL VALUES (1, 4, 'one');
INSERT INTO J1_TBL VALUES (2, 3, 'two');
INSERT INTO J1_TBL VALUES (3, 2, 'three');
INSERT INTO J1_TBL VALUES (4, 1, 'four');
INSERT INTO J1_TBL VALUES (5, 0, 'five');
INSERT INTO J1_TBL VALUES (6, 6, 'six');
INSERT INTO J1_TBL VALUES (7, 7, 'seven');
INSERT INTO J1_TBL VALUES (8, 8, 'eight');
INSERT INTO J1_TBL VALUES (0, NULL, 'zero');
INSERT INTO J1_TBL VALUES (NULL, NULL, 'null');
INSERT INTO J1_TBL VALUES (NULL, 0, 'zero');
INSERT INTO J2_TBL VALUES (1, -1);
INSERT INTO J2_TBL VALUES (2, 2);
INSERT INTO J2_TBL VALUES (3, -3);
INSERT INTO J2_TBL VALUES (2, 4);
INSERT INTO J2_TBL VALUES (5, -5);
INSERT INTO J2_TBL VALUES (5, -5);
INSERT INTO J2_TBL VALUES (0, NULL);
INSERT INTO J2_TBL VALUES (NULL, NULL);
INSERT INTO J2_TBL VALUES (NULL, 0);
--
-- CORRELATION NAMES
-- Make sure that table/column aliases are supported
-- before diving into more complex join syntax.
--
SELECT '' AS "xxx", *
FROM J1_TBL AS tx_join ORDER BY 2,3;
SELECT '' AS "xxx", *
FROM J1_TBL tx_join ORDER BY 2,3;
SELECT '' AS "xxx", *
FROM J1_TBL AS t1_join (a, b, c) ORDER BY 2,3;
SELECT '' AS "xxx", *
FROM J1_TBL t1_join (a, b, c) ORDER BY 2,3;
SELECT '' AS "xxx", *
FROM J1_TBL t1_join (a, b, c), J2_TBL t2_join (d, e) ORDER BY 2,3,4,5,6;
SELECT '' AS "xxx", t1_join.a, t2_join.e
FROM J1_TBL t1_join (a, b, c), J2_TBL t2_join (d, e)
WHERE t1_join.a = t2_join.d ORDER BY 2,3;
--
-- CROSS JOIN
-- Qualifications are not allowed on cross joins,
-- which degenerate into a standard unqualified inner join.
--
SELECT '' AS "xxx", *
FROM J1_TBL CROSS JOIN J2_TBL ORDER BY 2,3,4,5,6;
-- ambiguous column
SELECT '' AS "xxx", i, k, t
FROM J1_TBL CROSS JOIN J2_TBL ORDER BY 2,3,4;
-- resolve previous ambiguity by specifying the table name
SELECT '' AS "xxx", t1_join.i, k, t
FROM J1_TBL t1_join CROSS JOIN J2_TBL t2_join ORDER BY 2,3,4;
SELECT '' AS "xxx", ii, tt, kk
FROM (J1_TBL CROSS JOIN J2_TBL)
AS tx_join (ii, jj, tt, ii2, kk) ORDER BY 2,3,4;
SELECT '' AS "xxx", tx_join.ii, tx_join.jj, tx_join.kk
FROM (J1_TBL t1_join (a, b, c) CROSS JOIN J2_TBL t2_join (d, e))
AS tx_join (ii, jj, tt, ii2, kk) ORDER BY 2,3,4;
SELECT '' AS "xxx", *
FROM J1_TBL CROSS JOIN J2_TBL a CROSS JOIN J2_TBL b ORDER BY 2,3,4,5,6,7,8;
--
--
-- Inner joins (equi-joins)
--
--
--
-- Inner joins (equi-joins) with USING clause
-- The USING syntax changes the shape of the resulting table
-- by including a column in the USING clause only once in the result.
--
-- Inner equi-join on specified column
SELECT '' AS "xxx", *
FROM J1_TBL INNER JOIN J2_TBL USING (i) ORDER BY 2,3,4,5;
-- Same as above, slightly different syntax
SELECT '' AS "xxx", *
FROM J1_TBL JOIN J2_TBL USING (i) ORDER BY 2,3,4,5;
SELECT '' AS "xxx", *
FROM J1_TBL t1_join (a, b, c) JOIN J2_TBL t2_join (a, d) USING (a)
ORDER BY a, d;
SELECT '' AS "xxx", *
FROM J1_TBL t1_join (a, b, c) JOIN J2_TBL t2_join (a, b) USING (b)
ORDER BY b, t1_join.a;
--
-- NATURAL JOIN
-- Inner equi-join on all columns with the same name
--
SELECT '' AS "xxx", *
FROM J1_TBL NATURAL JOIN J2_TBL ORDER BY 2,3,4,5;
SELECT '' AS "xxx", *
FROM J1_TBL t1_join (a, b, c) NATURAL JOIN J2_TBL t2_join (a, d) ORDER BY 2,3,4,5;
SELECT '' AS "xxx", *
FROM J1_TBL t1_join (a, b, c) NATURAL JOIN J2_TBL t2_join (d, a) ORDER BY 2,3,4,5;
-- mismatch number of columns
-- currently, Postgres will fill in with underlying names
SELECT '' AS "xxx", *
FROM J1_TBL t1_join (a, b) NATURAL JOIN J2_TBL t2_join (a) ORDER BY 2,3,4,5;
--
-- Inner joins (equi-joins)
--
SELECT '' AS "xxx", *
FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.i) ORDER BY 2,3,4,5,6;
SELECT '' AS "xxx", *
FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.k) ORDER BY 2,3,4,5,6;
--
-- Non-equi-joins
--
SELECT '' AS "xxx", *
FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i <= J2_TBL.k) ORDER BY 2,3,4,5,6;
--
-- Outer joins
-- Note that OUTER is a noise word
--
SELECT '' AS "xxx", *
FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i)
ORDER BY i, k, t;
SELECT '' AS "xxx", *
FROM J1_TBL LEFT JOIN J2_TBL USING (i)
ORDER BY i, k, t;
SELECT '' AS "xxx", *
FROM J1_TBL RIGHT OUTER JOIN J2_TBL USING (i) ORDER BY 2,3,4,5;
SELECT '' AS "xxx", *
FROM J1_TBL RIGHT JOIN J2_TBL USING (i) ORDER BY 2,3,4,5;
SELECT '' AS "xxx", *
FROM J1_TBL FULL OUTER JOIN J2_TBL USING (i)
ORDER BY i, k, t;
SELECT '' AS "xxx", *
FROM J1_TBL FULL JOIN J2_TBL USING (i)
ORDER BY i, k, t;
SELECT '' AS "xxx", *
FROM J1_TBL LEFT JOIN J2_TBL USING (i) WHERE (k = 1) ORDER BY 2,3,4,5;
SELECT '' AS "xxx", *
FROM J1_TBL LEFT JOIN J2_TBL USING (i) WHERE (i = 1) ORDER BY 2,3,4,5;
--
-- More complicated constructs
--
--
-- Multiway full join
--
CREATE TABLE t1_join (name TEXT, n INTEGER);
CREATE TABLE t2_join (name TEXT, n INTEGER);
CREATE TABLE t3_join (name TEXT, n INTEGER);
INSERT INTO t1_join VALUES ( 'aa', 11 );
INSERT INTO t2_join VALUES ( 'aa', 12 );
INSERT INTO t2_join VALUES ( 'bb', 22 );
INSERT INTO t2_join VALUES ( 'dd', 42 );
INSERT INTO t3_join VALUES ( 'aa', 13 );
INSERT INTO t3_join VALUES ( 'bb', 23 );
INSERT INTO t3_join VALUES ( 'cc', 33 );
SELECT * FROM t1_join FULL JOIN t2_join USING (name) FULL JOIN t3_join USING (name) ORDER BY 1,2,3,4;
--
-- Test interactions of join syntax and subqueries
--
-- Basic cases (we expect planner to pull up the subquery here)
SELECT * FROM
(SELECT * FROM t2_join) as s2
INNER JOIN
(SELECT * FROM t3_join) s3
USING (name) ORDER BY 1,2,3;
SELECT * FROM
(SELECT * FROM t2_join) as s2
LEFT JOIN
(SELECT * FROM t3_join) s3
USING (name) ORDER BY 1,2,3;
SELECT * FROM
(SELECT * FROM t2_join) as s2
FULL JOIN
(SELECT * FROM t3_join) s3
USING (name) ORDER BY 1,2,3;
-- Cases with non-nullable expressions in subquery results;
-- make sure these go to null as expected
SELECT * FROM
(SELECT name, n as s2_n, 2 as s2_2 FROM t2_join) as s2
NATURAL INNER JOIN
(SELECT name, n as s3_n, 3 as s3_2 FROM t3_join) s3 ORDER BY 1,2,3;
SELECT * FROM
(SELECT name, n as s2_n, 2 as s2_2 FROM t2_join) as s2
NATURAL LEFT JOIN
(SELECT name, n as s3_n, 3 as s3_2 FROM t3_join) s3 ORDER BY 1,2,3;
SELECT * FROM
(SELECT name, n as s2_n, 2 as s2_2 FROM t2_join) as s2
NATURAL FULL JOIN
(SELECT name, n as s3_n, 3 as s3_2 FROM t3_join) s3 ORDER BY 1,2,3;
SELECT * FROM
(SELECT name, n as s1_n, 1 as s1_1 FROM t1_join) as s1
NATURAL INNER JOIN
(SELECT name, n as s2_n, 2 as s2_2 FROM t2_join) as s2
NATURAL INNER JOIN
(SELECT name, n as s3_n, 3 as s3_2 FROM t3_join) s3 ORDER BY 1,2,3;
SELECT * FROM
(SELECT name, n as s1_n, 1 as s1_1 FROM t1_join) as s1
NATURAL FULL JOIN
(SELECT name, n as s2_n, 2 as s2_2 FROM t2_join) as s2
NATURAL FULL JOIN
(SELECT name, n as s3_n, 3 as s3_2 FROM t3_join) s3 ORDER BY 1,2,3;
SELECT * FROM
(SELECT name, n as s1_n FROM t1_join) as s1
NATURAL FULL JOIN
(SELECT * FROM
(SELECT name, n as s2_n FROM t2_join) as s2
NATURAL FULL JOIN
(SELECT name, n as s3_n FROM t3_join) as s3
) ss2 ORDER BY 1,2,3;
SELECT * FROM
(SELECT name, n as s1_n FROM t1_join) as s1
NATURAL FULL JOIN
(SELECT * FROM
(SELECT name, n as s2_n, 2 as s2_2 FROM t2_join) as s2
NATURAL FULL JOIN
(SELECT name, n as s3_n FROM t3_join) as s3
) ss2 ORDER BY 1,2,3;
-- Test for propagation of nullability constraints into sub-joins
create temp table x (x1 int, x2 int);
insert into x values (1,11);
insert into x values (2,22);
insert into x values (3,null);
insert into x values (4,44);
insert into x values (5,null);
create temp table y (y1 int, y2 int);
insert into y values (1,111);
insert into y values (2,222);
insert into y values (3,333);
insert into y values (4,null);
select * from x ORDER BY 1,2;
select * from y ORDER BY 1,2;
select * from x left join y on (x1 = y1 and x2 is not null) ORDER BY 1,2,3,4;
select * from x left join y on (x1 = y1 and y2 is not null) ORDER BY 1,2,3,4;
select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
on (x1 = xx1) ORDER BY 1,2,3,4;
select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
on (x1 = xx1 and x2 is not null) ORDER BY 1,2,3,4;
select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
on (x1 = xx1 and y2 is not null) ORDER BY 1,2,3,4;
select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
on (x1 = xx1 and xx2 is not null) ORDER BY 1,2,3,4;
-- these should NOT give the same answers as above
select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
on (x1 = xx1) where (x2 is not null) ORDER BY 1,2,3,4;
select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
on (x1 = xx1) where (y2 is not null) ORDER BY 1,2,3,4;
select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
on (x1 = xx1) where (xx2 is not null) ORDER BY 1,2,3,4;
--
-- regression test: check for bug with propagation of implied equality
-- to outside an IN
--
select count(*) from tenk1 a where unique1 in
(select unique1 from tenk1 b join tenk1 c using (unique1)
where b.unique2 = 42);
--
-- regression test: check for failure to generate a plan with multiple
-- degenerate IN clauses
--
select count(*) from tenk1 x where
x.unique1 in (select a.f1 from int4_tbl a,float8_tbl b where a.f1=b.f1) and
x.unique1 = 0 and
x.unique1 in (select aa.f1 from int4_tbl aa,float8_tbl bb where aa.f1=bb.f1);
--
-- Clean up
--
DROP TABLE t1_join;
DROP TABLE t2_join;
DROP TABLE t3_join;
DROP TABLE J1_TBL;
DROP TABLE J2_TBL;
-- Both DELETE and UPDATE allow the specification of additional tables
-- to "join" against to determine which rows should be modified.
CREATE TEMP TABLE t1_join (a int, b int);
CREATE TEMP TABLE t2_join (a int, b int);
CREATE TEMP TABLE t3_join (x int, y int);
CREATE TEMP TABLE t4_join (x int, y int);
INSERT INTO t1_join VALUES (5, 10);
INSERT INTO t1_join VALUES (15, 20);
INSERT INTO t1_join VALUES (100, 100);
INSERT INTO t1_join VALUES (200, 1000);
INSERT INTO t2_join VALUES (200, 2000);
INSERT INTO t3_join VALUES (5, 20);
INSERT INTO t3_join VALUES (6, 7);
INSERT INTO t3_join VALUES (7, 8);
INSERT INTO t3_join VALUES (500, 100);
INSERT INTO t4_join SELECT * FROM t3_join;
DELETE FROM t3_join USING t1_join table1 WHERE t3_join.x = table1.a;
SELECT * FROM t3_join ORDER BY 1,2;
DELETE FROM t4_join USING t1_join JOIN t2_join USING (a) WHERE t4_join.x > t1_join.a;
SELECT * FROM t4_join ORDER BY 1,2;
DELETE FROM t3_join USING t3_join t3_other WHERE t3_join.x = t3_other.x AND t3_join.y = t3_other.y;
SELECT * FROM t3_join ORDER BY 1,2;
--
-- regression test for 8.1 merge right join bug
--
CREATE TEMP TABLE tt1 ( tt1_id int4, joincol int4 );
INSERT INTO tt1 VALUES (1, 11);
INSERT INTO tt1 VALUES (2, NULL);
CREATE TEMP TABLE tt2 ( tt2_id int4, joincol int4 );
INSERT INTO tt2 VALUES (21, 11);
INSERT INTO tt2 VALUES (22, 11);
set enable_hashjoin to off;
set enable_nestloop to off;
-- these should give the same results
select tt1.*, tt2.* from tt1 left join tt2 on tt1.joincol = tt2.joincol ORDER BY 1,2,3;
select tt1.*, tt2.* from tt2 right join tt1 on tt1.joincol = tt2.joincol ORDER BY 1,2,3;
reset enable_hashjoin;
reset enable_nestloop;
--
-- regression test for 8.2 bug with improper re-ordering of left joins
--
create temp table tt3(f1 int, f2 text);
insert into tt3 select x, repeat('xyzzy', 100) from generate_series(1,10000) x;
create index tt3i on tt3(f1);
analyze tt3;
create temp table tt4(f1 int);
insert into tt4 values (0),(1),(9999);
analyze tt4;
SELECT a.f1
FROM tt4 a
LEFT JOIN (
SELECT b.f1
FROM tt3 b LEFT JOIN tt3 c ON (b.f1 = c.f1)
WHERE c.f1 IS NULL
) AS d ON (a.f1 = d.f1)
WHERE d.f1 IS NULL;
--
-- regression test for problems of the sort depicted in bug #3494
--
create temp table tt5(f1 int, f2 int);
create temp table tt6(f1 int, f2 int);
insert into tt5 values(1, 10);
insert into tt5 values(1, 11);
insert into tt6 values(1, 9);
insert into tt6 values(1, 2);
insert into tt6 values(2, 9);
select * from tt5,tt6 where tt5.f1 = tt6.f1 and tt5.f1 = tt5.f2 - tt6.f2;
--
-- regression test for problems of the sort depicted in bug #3588
--
create temp table xx (pkxx int);
create temp table yy (pkyy int, pkxx int);
insert into xx values (1);
insert into xx values (2);
insert into xx values (3);
insert into yy values (101, 1);
insert into yy values (201, 2);
insert into yy values (301, NULL);
select yy.pkyy as yy_pkyy, yy.pkxx as yy_pkxx, yya.pkyy as yya_pkyy,
xxa.pkxx as xxa_pkxx, xxb.pkxx as xxb_pkxx
from yy
left join (SELECT * FROM yy where pkyy = 101) as yya ON yy.pkyy = yya.pkyy
left join xx xxa on yya.pkxx = xxa.pkxx
left join xx xxb on coalesce (xxa.pkxx, 1) = xxb.pkxx;
--
-- regression test for improper pushing of constants across outer-join clauses
-- (as seen in early 8.2.x releases)
--
create temp table zt1 (f1 int primary key) distributed by (f1);
create temp table zt2 (f2 int primary key) distributed by (f2);
create temp table zt3 (f3 int primary key) distributed by (f3);
insert into zt1 values(53);
insert into zt2 values(53);
select * from
zt2 left join zt3 on (f2 = f3)
left join zt1 on (f3 = f1)
where f2 = 53;
create temp view zv1 as select *,'dummy'::text AS junk from zt1;
select * from
zt2 left join zt3 on (f2 = f3)
left join zv1 on (f3 = f1)
where f2 = 53;
-- test numeric hash join
set enable_hashjoin to on;
set enable_mergejoin to off;
set enable_nestloop to off;
create table nhtest (i numeric(10, 2)) distributed by (i);
insert into nhtest values(100000.22);
insert into nhtest values(300000.19);
explain select * from nhtest a join nhtest b using (i);
select * from nhtest a join nhtest b using (i);
--
-- test hash join
--
create table hjtest (i int, j int) distributed by (i,j);
insert into hjtest values(3, 4);
select count(*) from hjtest a1, hjtest a2 where a2.i = least (a1.i,4) and a2.j = 4;
--
-- Predicate propagation over equality conditions
--
drop schema if exists pred;
create schema pred;
set search_path=pred;
create table t1 (x int, y int, z int) distributed by (y);
create table t2 (x int, y int, z int) distributed by (x);
insert into t1 select i, i, i from generate_series(1,100) i;
insert into t2 select * from t1;
analyze t1;
analyze t2;
--
-- infer over equalities
--
explain select count(*) from t1,t2 where t1.x = 100 and t1.x = t2.x;
select count(*) from t1,t2 where t1.x = 100 and t1.x = t2.x;
--
-- infer over >=
--
explain select * from t1,t2 where t1.x = 100 and t2.x >= t1.x;
select * from t1,t2 where t1.x = 100 and t2.x >= t1.x;
--
-- multiple inferences
--
set optimizer_segments=2;
explain select * from t1,t2 where t1.x = 100 and t1.x = t2.y and t1.x <= t2.x;
reset optimizer_segments;
select * from t1,t2 where t1.x = 100 and t1.x = t2.y and t1.x <= t2.x;
--
-- MPP-18537: hash clause references a constant in outer child target list
--
create table hjn_test (i int, j int) distributed by (i,j);
insert into hjn_test values(3, 4);
create table int4_tbl (f1 int);
insert into int4_tbl values(123456), (-2147483647), (0), (-123456), (2147483647);
select count(*) from hjn_test, (select 3 as bar) foo where hjn_test.i = least (foo.bar,4) and hjn_test.j = 4;
select count(*) from hjn_test, (select 3 as bar) foo where hjn_test.i = least (foo.bar,(array[4])[1]) and hjn_test.j = (array[4])[1];
select count(*) from hjn_test, (select 3 as bar) foo where least (foo.bar,(array[4])[1]) = hjn_test.i and hjn_test.j = (array[4])[1];
select count(*) from hjn_test, (select 3 as bar) foo where hjn_test.i = least (foo.bar, least(4,10)) and hjn_test.j = least(4,10);
select * from int4_tbl a join int4_tbl b on (a.f1 = (select f1 from int4_tbl c where c.f1=b.f1));
set enable_hashjoin to off;
select count(*) from hjn_test, (select 3 as bar) foo where hjn_test.i = least (foo.bar,4) and hjn_test.j = 4;
select count(*) from hjn_test, (select 3 as bar) foo where hjn_test.i = least (foo.bar,(array[4])[1]) and hjn_test.j = (array[4])[1];
select count(*) from hjn_test, (select 3 as bar) foo where least (foo.bar,(array[4])[1]) = hjn_test.i and hjn_test.j = (array[4])[1];
select count(*) from hjn_test, (select 3 as bar) foo where hjn_test.i = least (foo.bar, least(4,10)) and hjn_test.j = least(4,10);
select * from int4_tbl a join int4_tbl b on (a.f1 = (select f1 from int4_tbl c where c.f1=b.f1));
reset enable_hashjoin;
drop schema pred cascade; | the_stack |
------------------------------------------------------------------------
-- TITLE:
-- gui_scenario.sql
--
-- AUTHOR:
-- Will Duquette
--
-- DESCRIPTION:
-- SQL Schema: Application-specific views, Scenario Data
--
-- This file is loaded by app.tcl!
--
-- GUI views translate the internal data formats of the scenariodb(n)
-- tables into presentation format. They are defined here instead of
-- in scenariodb(n) so that they can contain application-specific
-- SQL functions.
--
------------------------------------------------------------------------
------------------------------------------------------------------------
-- ACTORS
-- gui_actors: Actor data
CREATE TEMPORARY VIEW gui_actors AS
SELECT a AS id,
a AS a,
'/app/actor/' || a AS url,
fancy AS fancy,
link('/app/actor/' || a, a) AS link,
link('/app/actor/' || a, pair(longname, a)) AS longlink,
longname AS longname,
bsid AS bsid,
bsysname AS bsysname,
supports AS supports,
CASE WHEN supports NOT IN ('SELF','NONE')
THEN link('/app/actor/' || supports, supports)
ELSE supports
END AS supports_link,
atype AS atype,
auto_maintain AS auto_maintain,
pretty_am_flag AS pretty_am_flag,
cash_reserve AS cash_reserve,
cash_on_hand AS cash_on_hand,
income_goods AS income_goods,
shares_black_nr AS shares_black_nr,
income_black_tax AS income_black_tax,
income_pop AS income_pop,
income_graft AS income_graft,
income_world AS income_world,
budget AS budget,
income AS income
FROM fmt_actors;
------------------------------------------------------------------------
-- NEIGHBORHOODS
-- gui_neighborhoods: Neighborhood data collected from all over
CREATE TEMPORARY VIEW gui_nbhoods AS
SELECT id AS id,
n AS n,
'/app/nbhood/' || n AS url,
pair(longname, n) AS fancy,
link('/app/nbhood/' || n, n) AS link,
link('/app/nbhood/' || n, pair(longname, n)) AS longlink,
longname AS longname,
local AS local,
urbanization AS urbanization,
controller AS controller,
since_ticks AS since_ticks,
since AS since,
pcf AS pcf,
stacking_order AS stacking_order,
obscured_by AS obscured_by,
refpoint AS refpoint,
polygon AS polygon,
volatility AS volatility,
population AS population,
subsistence AS subsistence,
consumers AS consumers,
labor_force AS labor_force,
unemployed AS unemployed,
-- TBD: These should be "nbmood", not "mood".
mood0 AS mood0,
mood AS mood
FROM fmt_nbhoods;
-- gui_nbrel_mn: Neighborhood Proximities
CREATE TEMPORARY VIEW gui_nbrel_mn AS
SELECT MN.id AS id,
MN.m AS m,
M.longlink AS m_longlink,
MN.n AS n,
N.longlink AS n_longlink,
MN.proximity AS proximity
FROM fmt_nbrel_mn AS MN
JOIN gui_nbhoods AS M ON (MN.m = M.n)
JOIN gui_nbhoods AS N ON (MN.n = N.n)
WHERE MN.m != MN.n;
------------------------------------------------------------------------
-- GROUPS
-- gui_groups: Data common to all groups
CREATE TEMPORARY VIEW gui_groups AS
SELECT id AS id,
g AS g,
'/app/group/' || g AS url,
fancy AS fancy,
link('/app/group/' || g, g) AS link,
link('/app/group/' || g, pair(longname, g)) AS longlink,
gtype AS gtype,
link('/app/groups/' || lower(gtype), gtype) AS gtypelink,
longname AS longname,
bsid AS bsid,
color AS color,
demeanor AS demeanor,
cost AS cost,
a AS a
FROM fmt_groups;
-- gui_civgroups: Civilian group data
CREATE TEMPORARY VIEW gui_civgroups AS
SELECT G.id AS id,
G.g AS g,
G.url AS url,
G.fancy AS fancy,
G.link AS link,
G.longlink AS longlink,
G.gtype AS gtype,
G.longname AS longname,
G.color AS color,
G.demeanor AS demeanor,
CG.basepop AS basepop,
CG.n AS n,
CG.bsid AS bsid,
CG.bsysname AS bsysname,
CG.pretty_sa_flag AS pretty_sa_flag,
CG.sa_flag AS sa_flag,
CG.pop_cr AS pop_cr,
CG.housing AS housing,
CG.lfp AS lfp,
CG.population AS population,
CG.hist_flag AS hist_flag,
CG.attrition AS attrition,
CG.subsistence AS subsistence,
CG.consumers AS consumers,
CG.labor_force AS labor_force,
CG.unemployed AS unemployed,
CG.req_funding AS req_funding,
CG.sat_funding AS sat_funding,
CG.ur AS ur,
CG.upc AS upc,
CG.uaf AS uaf,
CG.tc AS tc,
CG.aloc AS aloc,
CG.eloc AS eloc,
CG.rloc AS rloc,
CG.povfrac AS povfrac,
CG.povpct AS povpct,
CG.mood0 AS mood0,
CG.mood AS mood
FROM gui_groups AS G
JOIN fmt_civgroups AS CG USING (g);
-- gui_frcgroups: Force group data
CREATE TEMPORARY VIEW gui_frcgroups AS
SELECT G.id AS id,
G.g AS g,
G.url AS url,
F.fancy AS fancy,
G.link AS link,
G.longlink AS longlink,
F.gtype AS gtype,
F.longname AS longname,
F.color AS color,
F.demeanor AS demeanor,
F.personnel AS personnel,
F.cost AS cost,
F.a AS a,
F.forcetype AS forcetype,
F.training AS training,
F.equip_level AS equip_level,
F.base_personnel AS base_personnel,
F.local AS local,
F.pretty_local AS pretty_local
FROM gui_groups AS G
JOIN fmt_frcgroups AS F USING (g);
-- gui_orggroups: Organization Group data
CREATE TEMPORARY VIEW gui_orggroups AS
SELECT G.id AS id,
G.g AS g,
G.url AS url,
O.fancy AS fancy,
G.link AS link,
G.longlink AS longlink,
O.gtype AS gtype,
O.longname AS longname,
O.color AS color,
O.demeanor AS demeanor,
O.personnel AS personnel,
O.cost AS cost,
O.a AS a,
O.orgtype AS orgtype,
O.base_personnel AS base_personnel
FROM gui_groups AS G
JOIN fmt_orggroups AS O USING (g);
-- gui_agroups: All groups that can be owned by actors
CREATE TEMP VIEW gui_agroups AS
SELECT g, url, fancy, link, longlink, gtype, longname, a, cost,
forcetype AS subtype,
'FRC/' || forcetype AS fulltype
FROM gui_frcgroups
UNION
SELECT g, url, fancy, link, longlink, gtype, longname, a, cost,
orgtype AS subtype,
'ORG/' || orgtype AS fulltype
FROM gui_orggroups;
-----------------------------------------------------------------------
-- End of File
----------------------------------------------------------------------- | the_stack |
--
-- CREATE_INDEX
-- Create ancillary data structures (i.e. indices)
--
--
-- BTREE
--
CREATE INDEX onek_unique1 ON onek USING btree(unique1 int4_ops);
CREATE INDEX IF NOT EXISTS onek_unique1 ON onek USING btree(unique1 int4_ops);
CREATE INDEX IF NOT EXISTS ON onek USING btree(unique1 int4_ops);
CREATE INDEX onek_unique2 ON onek USING btree(unique2 int4_ops);
CREATE INDEX onek_hundred ON onek USING btree(hundred int4_ops);
CREATE INDEX onek_stringu1 ON onek USING btree(stringu1 name_ops);
CREATE INDEX tenk1_unique1 ON tenk1 USING btree(unique1 int4_ops);
CREATE INDEX tenk1_unique2 ON tenk1 USING btree(unique2 int4_ops);
CREATE INDEX tenk1_hundred ON tenk1 USING btree(hundred int4_ops);
CREATE INDEX tenk1_thous_tenthous ON tenk1 (thousand, tenthous);
CREATE INDEX tenk2_unique1 ON tenk2 USING btree(unique1 int4_ops);
CREATE INDEX tenk2_unique2 ON tenk2 USING btree(unique2 int4_ops);
CREATE INDEX tenk2_hundred ON tenk2 USING btree(hundred int4_ops);
-- test comments
COMMENT ON INDEX six_wrong IS 'bad index';
COMMENT ON INDEX six IS 'good index';
COMMENT ON INDEX six IS NULL;
--
-- BTREE ascending/descending cases
--
-- we load int4/text from pure descending data (each key is a new
-- low key) and name/f8 from pure ascending data (each key is a new
-- high key). we had a bug where new low keys would sometimes be
-- "lost".
--
CREATE INDEX bt_i4_index ON bt_i4_heap USING btree (seqno int4_ops);
CREATE INDEX bt_name_index ON bt_name_heap USING btree (seqno name_ops);
-- CREATE INDEX bt_txt_index ON bt_txt_heap USING btree (seqno text_ops);
CREATE INDEX bt_f8_index ON bt_f8_heap USING btree (seqno float8_ops);
--
-- HASH
--
CREATE INDEX hash_i4_index ON hash_i4_heap USING hash (random int4_ops);
CREATE INDEX hash_name_index ON hash_name_heap USING hash (random name_ops);
-- CREATE INDEX hash_txt_index ON hash_txt_heap USING hash (random text_ops);
CREATE INDEX hash_f8_index ON hash_f8_heap USING hash (random float8_ops) WITH (fillfactor=60);
CREATE TEMP TABLE unlogged_hash_table (id int4);
CREATE INDEX unlogged_hash_index ON unlogged_hash_table USING hash (id int4_ops);
DROP TABLE unlogged_hash_table;
-- CREATE INDEX hash_ovfl_index ON hash_ovfl_heap USING hash (x int4_ops);
-- Test hash index build tuplesorting. Force hash tuplesort using low
-- maintenance_work_mem setting and fillfactor:
SET maintenance_work_mem = '1MB';
CREATE INDEX hash_tuplesort_idx ON tenk1 USING hash (stringu1 name_ops) WITH (fillfactor = 10);
EXPLAIN (COSTS OFF)
SELECT count(*) FROM tenk1 WHERE stringu1 = 'TVAAAA';
SELECT count(*) FROM tenk1 WHERE stringu1 = 'TVAAAA';
DROP INDEX hash_tuplesort_idx;
RESET maintenance_work_mem;
--
-- Test unique index with included columns
--
CREATE TABLE covering_index_heap (f1 int, f2 int, f3 text);
CREATE UNIQUE INDEX covering_index_index on covering_index_heap (f1,f2);
INSERT INTO covering_index_heap VALUES(1,1,'AAA');
INSERT INTO covering_index_heap VALUES(1,2,'AAA');
-- this should fail because of unique index on f1,f2:
INSERT INTO covering_index_heap VALUES(1,2,'BBB');
-- and this shouldn't:
INSERT INTO covering_index_heap VALUES(1,4,'AAA');
-- Try to build index on table that already contains data
CREATE UNIQUE INDEX covering_pkey on covering_index_heap (f1,f2);
-- Try to use existing covering index as primary key
-- ALTER TABLE covering_index_heap ADD CONSTRAINT covering_pkey PRIMARY KEY USING INDEX covering_pkey;
DROP TABLE covering_index_heap;
--
-- Test ADD CONSTRAINT USING INDEX
--
CREATE TABLE cwi_test( a int , b varchar(10), c char);
-- add some data so that all tests have something to work with.
INSERT INTO cwi_test VALUES(1, 2), (3, 4), (5, 6);
CREATE UNIQUE INDEX cwi_uniq_idx ON cwi_test(a , b);
--ALTER TABLE cwi_test ADD primary key USING INDEX cwi_uniq_idx;
\d cwi_test
\d cwi_uniq_idx
CREATE UNIQUE INDEX cwi_uniq2_idx ON cwi_test(b , a);
--ALTER TABLE cwi_test DROP CONSTRAINT cwi_uniq_idx,
-- ADD CONSTRAINT cwi_replaced_pkey PRIMARY KEY
-- USING INDEX cwi_uniq2_idx;
--\d cwi_test
--\d cwi_replaced_pkey
--DROP INDEX cwi_replaced_pkey; -- Should fail; a constraint depends on it
DROP TABLE cwi_test;
-- ADD CONSTRAINT USING INDEX is forbidden on partitioned tables
CREATE TABLE cwi_test(a int) PARTITION BY hash (a);
create unique index on cwi_test (a);
--alter table cwi_test add primary key using index cwi_test_a_idx ;
DROP TABLE cwi_test;
--
-- Tests for IS NULL/IS NOT NULL with b-tree indexes
--
drop table if exists onek_with_null;
create table onek_with_null (like onek);
INSERT INTO onek_with_null (unique1,unique2) VALUES (NULL, -1), (NULL, NULL);
CREATE UNIQUE INDEX onek_nulltest ON onek_with_null (unique2,unique1);
SET enable_seqscan = OFF;
SET enable_indexscan = ON;
SET enable_bitmapscan = ON;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique2 IS NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NOT NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique2 IS NOT NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NOT NULL AND unique1 > 500;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique1 > 500;
DROP INDEX onek_nulltest;
CREATE UNIQUE INDEX onek_nulltest ON onek_with_null (unique2 desc,unique1);
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique2 IS NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NOT NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique2 IS NOT NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NOT NULL AND unique1 > 500;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique1 > 500;
DROP INDEX onek_nulltest;
CREATE UNIQUE INDEX onek_nulltest ON onek_with_null (unique2 desc nulls last,unique1);
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique2 IS NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NOT NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique2 IS NOT NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NOT NULL AND unique1 > 500;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique1 > 500;
DROP INDEX onek_nulltest;
CREATE UNIQUE INDEX onek_nulltest ON onek_with_null (unique2 nulls first,unique1);
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique2 IS NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NOT NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique2 IS NOT NULL;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NOT NULL AND unique1 > 500;
SELECT count(*) FROM onek_with_null WHERE unique1 IS NULL AND unique1 > 500;
DROP INDEX onek_nulltest;
-- Check initial-positioning logic too
CREATE UNIQUE INDEX onek_nulltest ON onek_with_null (unique2);
SET enable_seqscan = OFF;
SET enable_indexscan = ON;
SET enable_bitmapscan = OFF;
SELECT unique1, unique2 FROM onek_with_null
ORDER BY unique2 LIMIT 2;
SELECT unique1, unique2 FROM onek_with_null WHERE unique2 >= -1
ORDER BY unique2 LIMIT 2;
SELECT unique1, unique2 FROM onek_with_null WHERE unique2 >= 0
ORDER BY unique2 LIMIT 2;
SELECT unique1, unique2 FROM onek_with_null
ORDER BY unique2 DESC LIMIT 2;
SELECT unique1, unique2 FROM onek_with_null WHERE unique2 >= -1
ORDER BY unique2 DESC LIMIT 2;
SELECT unique1, unique2 FROM onek_with_null WHERE unique2 < 999
ORDER BY unique2 DESC LIMIT 2;
RESET enable_seqscan;
RESET enable_indexscan;
RESET enable_bitmapscan;
DROP TABLE onek_with_null;
--
-- Check bitmap index path planning
--
EXPLAIN (COSTS OFF)
SELECT * FROM tenk1
WHERE thousand = 42 AND (tenthous = 1 OR tenthous = 3 OR tenthous = 42);
SELECT * FROM tenk1
WHERE thousand = 42 AND (tenthous = 1 OR tenthous = 3 OR tenthous = 42);
EXPLAIN (COSTS OFF)
SELECT count(*) FROM tenk1
WHERE hundred = 42 AND (thousand = 42 OR thousand = 99);
SELECT count(*) FROM tenk1
WHERE hundred = 42 AND (thousand = 42 OR thousand = 99);
explain (costs off)
SELECT unique1 FROM tenk1
WHERE unique1 IN (1,42,7)
ORDER BY unique1;
SELECT unique1 FROM tenk1
WHERE unique1 IN (1,42,7)
ORDER BY unique1;
explain (costs off)
SELECT thousand, tenthous FROM tenk1
WHERE thousand < 2 AND tenthous IN (1001,3000)
ORDER BY thousand;
SELECT thousand, tenthous FROM tenk1
WHERE thousand < 2 AND tenthous IN (1001,3000)
ORDER BY thousand;
SET enable_indexonlyscan = OFF;
explain (costs off)
SELECT thousand, tenthous FROM tenk1
WHERE thousand < 2 AND tenthous IN (1001,3000)
ORDER BY thousand;
SELECT thousand, tenthous FROM tenk1
WHERE thousand < 2 AND tenthous IN (1001,3000)
ORDER BY thousand;
RESET enable_indexonlyscan;
--
-- Check elimination of constant-NULL subexpressions
--
explain (costs off)
select * from tenk1 where (thousand, tenthous) in ((1,1001), (null,null));
--
-- Check matching of boolean index columns to WHERE conditions and sort keys
--
create temp table boolindex (b bool, i int, unique(b, i), junk float);
explain (costs off)
select * from boolindex order by b, i limit 10;
explain (costs off)
select * from boolindex where b order by i limit 10;
explain (costs off)
select * from boolindex where b = true order by i desc limit 10;
explain (costs off)
select * from boolindex where not b order by i limit 10;
--
-- Test for multilevel page deletion
--
CREATE TABLE delete_test_table (a bigint, b bigint, c bigint, d bigint);
INSERT INTO delete_test_table SELECT i, 1, 2, 3 FROM generate_series(1,80000) i;
ALTER TABLE delete_test_table ADD PRIMARY KEY (a,b,c,d);
DELETE FROM delete_test_table WHERE a > 40000;
DELETE FROM delete_test_table WHERE a > 10;
DROP TABLE delete_test_table;
-- index inside schema
CREATE SCHEMA schema_to_reindex;
SET search_path = 'schema_to_reindex';
CREATE TABLE table1(col1 SERIAL PRIMARY KEY);
INSERT INTO table1 SELECT generate_series(1,400);
CREATE TABLE table2(col1 SERIAL PRIMARY KEY, col2 TEXT NOT NULL);
INSERT INTO table2 SELECT generate_series(1,400), 'abc';
-- CREATE INDEX ON table2(col2);
CREATE MATERIALIZED VIEW matview AS SELECT col1 FROM table2;
CREATE INDEX ON matview(col1);
CREATE VIEW view AS SELECT col2 FROM table2;
DROP TABLE table1;
DROP TABLE table2 cascade;
DROP SCHEMA schema_to_reindex CASCADE; | the_stack |
-- 2019-01-07T13:18:34.962
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat (AD_Client_ID,AD_ImpFormat_ID,AD_Org_ID,AD_Table_ID,Created,CreatedBy,FormatType,IsActive,IsMultiLine,Name,Processing,Updated,UpdatedBy) VALUES (1000000,540025,0,540880,TO_TIMESTAMP('2019-01-07 13:18:34','YYYY-MM-DD HH24:MI:SS'),100,'S','Y','N','Pharma product IFA - IA68','N',TO_TIMESTAMP('2019-01-07 13:18:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.136
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558138,540025,540787,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00SSATZ',1,1,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.224
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558139,540025,540788,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PZN',2,2,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.325
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558140,540025,540789,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A00GDAT',3,3,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.390
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558141,540025,540790,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PBEZ',4,4,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.449
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558142,540025,540791,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PGMENG',5,5,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.512
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558144,540025,540792,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00DARFO',6,6,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.583
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558145,540025,540793,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00ANBNR4',7,7,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.649
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558147,540025,540794,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00LKZ',8,8,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.707
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558148,540025,540795,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00GTIN',9,9,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.768
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558149,540025,540796,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00ARTNR',10,10,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.838
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558150,540025,540797,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00HMNR',11,11,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.910
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558151,540025,540798,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PNAM',12,12,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:53.984
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558153,540025,540799,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00PPN',13,13,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.063
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558154,540025,540800,1000000,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A05GDAT',14,14,TO_TIMESTAMP('2019-01-07 13:18:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.132
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558156,540025,540801,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A05LZEIT',15,15,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.219
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558158,540025,540802,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05TMAX',16,16,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.279
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558159,540025,540803,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05TMIN',17,17,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.349
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558165,540025,540804,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A05LZEICH',18,18,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.419
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558166,540025,540805,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A04GDAT',19,19,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.482
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558167,540025,540806,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04LAENGE',20,20,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.548
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558168,540025,540807,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04HOEHE',21,21,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.625
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558169,540025,540808,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04BREITE',22,22,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.686
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558170,540025,540809,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04GWCHT',23,23,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.753
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558172,540025,540810,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04MBEST',24,24,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.825
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558173,540025,540811,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A01GDAT',25,25,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.893
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558174,540025,540812,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SKAEP',26,26,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:54.960
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558175,540025,540813,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAPU',27,27,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.035
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558176,540025,540814,1000000,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAEP',28,28,TO_TIMESTAMP('2019-01-07 13:18:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.101
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558177,540025,540815,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAVP',29,29,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.165
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558178,540025,540816,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SUVP',30,30,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.236
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558179,540025,540817,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SZBV',31,31,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.306
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558180,540025,540818,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAB130A',32,32,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.373
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558181,540025,540819,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01KAEP',33,33,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.436
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558182,540025,540820,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01APU',34,34,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.499
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558183,540025,540821,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01AMPVSGB',35,35,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.565
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558184,540025,540822,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01AMPVAMG',36,36,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.639
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558185,540025,540823,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AEP',37,37,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.705
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558186,540025,540824,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AVP',38,38,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.767
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558187,540025,540825,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01UVP',39,39,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.845
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558188,540025,540826,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01ZBV',40,40,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.912
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558190,540025,540827,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01PPU',41,41,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:55.976
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558191,540025,540828,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AB130A2',42,42,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.048
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558192,540025,540829,1000000,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01APU783A',43,43,TO_TIMESTAMP('2019-01-07 13:18:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.116
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558193,540025,540830,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AEPPPU',44,44,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.182
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558194,540025,540831,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AVPPPU',45,45,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.250
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558195,540025,540832,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01DPPUAPU',46,46,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.309
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558196,540025,540833,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01RESERV1',47,47,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.376
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558197,540025,540834,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01RESERV2',48,48,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.455
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558198,540025,540835,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01RESERV3',49,49,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.519
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558199,540025,540836,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A02GDAT',50,50,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.586
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558205,540025,540837,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02BOPST',51,51,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.660
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558207,540025,540838,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02DROCH',52,52,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.725
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558208,540025,540839,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02TIERAM',53,53,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.787
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558209,540025,540840,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02NEGLIS',54,54,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.857
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558210,540025,540841,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02HMZV',55,55,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.924
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558218,540025,540842,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02ZULREG',56,56,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:56.991
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558232,540025,540843,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02EB130B',57,57,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.064
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558238,540025,540844,1000000,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02WEEEREG',58,58,TO_TIMESTAMP('2019-01-07 13:18:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.133
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558240,540025,540845,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02MELDENR',59,59,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.202
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558241,540025,540846,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02RESERV1',60,60,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.264
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558242,540025,540847,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02RESERV2',61,61,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.323
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558243,540025,540848,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02RESERV3',62,62,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.385
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558244,540025,540849,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A11GDAT',63,63,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.459
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558246,540025,540850,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A11VERITES',64,64,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.527
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558247,540025,540851,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A11VERIREA',65,65,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.595
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558248,540025,540852,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A11VERIPFL',66,66,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.667
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558249,540025,540853,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A03GDAT',67,67,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.736
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558250,540025,540854,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VTSTAT',68,68,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.804
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558255,540025,540855,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VKSTAT',69,69,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.870
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558256,540025,540856,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A06GDAT',70,70,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:57.936
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558257,540025,540857,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A06PZNNF',71,71,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.003
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558258,540025,540858,1000000,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A06PZNORIG',72,72,TO_TIMESTAMP('2019-01-07 13:18:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.074
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558259,540025,540859,1000000,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A09GDAT',73,73,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.136
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558261,540025,540860,1000000,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100,'C','.','N','Y','Pharma Product',74,74,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.192
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558273,540025,540861,1000000,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','Erstellt',75,75,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.265
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558275,540025,540862,1000000,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','Aktualisiert',76,76,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.332
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558277,540025,540863,1000000,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100,'C','.','N','Y','Aktiv',77,77,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.399
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558278,540025,540864,1000000,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','Import-Fehlermeldung',78,78,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.470
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558280,540025,540865,1000000,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100,'C','.','N','Y','Verarbeitet',79,79,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.529
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,563684,540025,540866,1000000,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00ANBNR5',80,80,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.596
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,563685,540025,540867,1000000,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00NTIN',81,81,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.669
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,563702,540025,540868,1000000,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02UNNR',82,82,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-07T13:18:58.734
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,563705,540025,540869,1000000,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A11VERIHOC',83,83,TO_TIMESTAMP('2019-01-07 13:18:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:06.519
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540787
;
-- 2019-01-08T15:09:06.549
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540788
;
-- 2019-01-08T15:09:06.633
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540789
;
-- 2019-01-08T15:09:06.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540790
;
-- 2019-01-08T15:09:06.710
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540791
;
-- 2019-01-08T15:09:06.747
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540792
;
-- 2019-01-08T15:09:06.853
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540793
;
-- 2019-01-08T15:09:07.053
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540794
;
-- 2019-01-08T15:09:07.077
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540795
;
-- 2019-01-08T15:09:07.232
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540796
;
-- 2019-01-08T15:09:07.320
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540797
;
-- 2019-01-08T15:09:07.335
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540798
;
-- 2019-01-08T15:09:07.363
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540799
;
-- 2019-01-08T15:09:07.380
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540800
;
-- 2019-01-08T15:09:07.396
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540801
;
-- 2019-01-08T15:09:07.426
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540802
;
-- 2019-01-08T15:09:07.445
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540803
;
-- 2019-01-08T15:09:07.464
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540804
;
-- 2019-01-08T15:09:07.485
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540805
;
-- 2019-01-08T15:09:07.506
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540806
;
-- 2019-01-08T15:09:07.535
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540807
;
-- 2019-01-08T15:09:07.549
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540808
;
-- 2019-01-08T15:09:07.563
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540809
;
-- 2019-01-08T15:09:07.582
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540810
;
-- 2019-01-08T15:09:07.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540811
;
-- 2019-01-08T15:09:07.622
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540812
;
-- 2019-01-08T15:09:07.640
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540813
;
-- 2019-01-08T15:09:07.656
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540814
;
-- 2019-01-08T15:09:07.684
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540815
;
-- 2019-01-08T15:09:07.696
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540816
;
-- 2019-01-08T15:09:07.723
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540817
;
-- 2019-01-08T15:09:07.749
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540818
;
-- 2019-01-08T15:09:07.779
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540819
;
-- 2019-01-08T15:09:07.797
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540820
;
-- 2019-01-08T15:09:07.813
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540821
;
-- 2019-01-08T15:09:07.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540822
;
-- 2019-01-08T15:09:07.856
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540823
;
-- 2019-01-08T15:09:07.899
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540824
;
-- 2019-01-08T15:09:07.916
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540825
;
-- 2019-01-08T15:09:07.941
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540826
;
-- 2019-01-08T15:09:07.966
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540827
;
-- 2019-01-08T15:09:07.986
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540828
;
-- 2019-01-08T15:09:08
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540829
;
-- 2019-01-08T15:09:08.027
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540830
;
-- 2019-01-08T15:09:08.053
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540831
;
-- 2019-01-08T15:09:08.119
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540832
;
-- 2019-01-08T15:09:08.134
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540833
;
-- 2019-01-08T15:09:08.147
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540834
;
-- 2019-01-08T15:09:08.172
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540835
;
-- 2019-01-08T15:09:08.186
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540836
;
-- 2019-01-08T15:09:08.206
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540837
;
-- 2019-01-08T15:09:08.229
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540838
;
-- 2019-01-08T15:09:08.250
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540839
;
-- 2019-01-08T15:09:08.314
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540840
;
-- 2019-01-08T15:09:08.331
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540841
;
-- 2019-01-08T15:09:08.350
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540842
;
-- 2019-01-08T15:09:08.366
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540843
;
-- 2019-01-08T15:09:08.382
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540844
;
-- 2019-01-08T15:09:08.395
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540845
;
-- 2019-01-08T15:09:08.422
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540846
;
-- 2019-01-08T15:09:08.446
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540847
;
-- 2019-01-08T15:09:08.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540848
;
-- 2019-01-08T15:09:08.481
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540849
;
-- 2019-01-08T15:09:08.499
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540850
;
-- 2019-01-08T15:09:08.515
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540851
;
-- 2019-01-08T15:09:08.532
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540852
;
-- 2019-01-08T15:09:08.561
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540853
;
-- 2019-01-08T15:09:08.617
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540854
;
-- 2019-01-08T15:09:08.643
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540855
;
-- 2019-01-08T15:09:08.674
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540856
;
-- 2019-01-08T15:09:08.701
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540857
;
-- 2019-01-08T15:09:08.728
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540858
;
-- 2019-01-08T15:09:08.751
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540859
;
-- 2019-01-08T15:09:08.792
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540860
;
-- 2019-01-08T15:09:08.809
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540861
;
-- 2019-01-08T15:09:08.830
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540862
;
-- 2019-01-08T15:09:08.850
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540863
;
-- 2019-01-08T15:09:08.880
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540864
;
-- 2019-01-08T15:09:08.895
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540865
;
-- 2019-01-08T15:09:08.917
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540866
;
-- 2019-01-08T15:09:08.932
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540867
;
-- 2019-01-08T15:09:08.948
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540868
;
-- 2019-01-08T15:09:08.971
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540869
;
-- 2019-01-08T15:09:37.103
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558138,540025,540870,0,TO_TIMESTAMP('2019-01-08 15:09:36','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00SSATZ',10,2,TO_TIMESTAMP('2019-01-08 15:09:36','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.165
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558139,540025,540871,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'S',' ','N','Y','A00PZN',20,3,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.220
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataFormat,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558140,540025,540872,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'yyyyMMdd','D','.','N','Y','A00GDAT',30,4,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.295
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558141,540025,540873,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PBEZ',40,5,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.356
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558142,540025,540874,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PGMENG',50,6,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.415
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558143,540025,540875,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PGEINH',60,7,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.483
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558144,540025,540876,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00DARFO',70,8,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.543
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558145,540025,540877,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00ANBNR4',80,9,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.608
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558146,540025,540878,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00ATYP',90,10,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.671
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558147,540025,540879,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00LKZ',100,11,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.728
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558148,540025,540880,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00GTIN',110,12,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.792
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558149,540025,540881,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00ARTNR',120,13,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.855
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558150,540025,540882,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00HMNR',130,14,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.917
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558151,540025,540883,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PNAM',140,15,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:37.976
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558152,540025,540884,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00WGA',150,16,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.035
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558153,540025,540885,0,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00PPN',160,17,TO_TIMESTAMP('2019-01-08 15:09:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.115
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataFormat,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558154,540025,540886,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'yyyyMMdd','D','.','N','Y','A05GDAT',170,18,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.179
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558155,540025,540887,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05VFDAT',180,19,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.238
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558156,540025,540888,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A05LZEIT',190,20,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.303
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558157,540025,540889,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05KKETTE',200,21,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.365
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558158,540025,540890,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05TMAX',210,22,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.430
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558159,540025,540891,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05TMIN',220,23,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.495
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558160,540025,540892,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05LICHT',230,24,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.560
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558161,540025,540893,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05FEUCHT',240,25,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.625
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558162,540025,540894,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05LAGE',250,26,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.695
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558163,540025,540895,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05ZERBR',260,27,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.753
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558164,540025,540896,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05EICH',270,28,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.816
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558165,540025,540897,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A05LZEICH',280,29,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.879
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataFormat,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558166,540025,540898,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'yyyyMMdd','D','.','N','Y','A04GDAT',290,30,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.941
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558167,540025,540899,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04LAENGE',300,31,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:38.999
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558168,540025,540900,0,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04HOEHE',310,32,TO_TIMESTAMP('2019-01-08 15:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.056
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558169,540025,540901,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04BREITE',320,33,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.119
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558170,540025,540902,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04GWCHT',330,34,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.181
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558171,540025,540903,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04VPART',340,35,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.241
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558172,540025,540904,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04MBEST',350,36,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.298
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataFormat,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558173,540025,540905,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'yyyyMMdd','D','.','N','Y','A01GDAT',360,37,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.361
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558174,540025,540906,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SKAEP',370,38,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.423
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558175,540025,540907,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAPU',380,39,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.482
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558176,540025,540908,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAEP',390,40,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.542
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558177,540025,540909,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAVP',400,41,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.608
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558178,540025,540910,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SUVP',410,42,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.673
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558179,540025,540911,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SZBV',420,43,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.738
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558180,540025,540912,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAB130A',430,44,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.801
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558181,540025,540913,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'N','.','Y','Y','A01KAEP',440,45,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.865
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558182,540025,540914,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'N','.','Y','Y','A01APU',450,46,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.928
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558183,540025,540915,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01AMPVSGB',460,47,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:39.983
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558184,540025,540916,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01AMPVAMG',470,48,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.042
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558185,540025,540917,0,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100,'N','.','Y','Y','A01AEP',480,49,TO_TIMESTAMP('2019-01-08 15:09:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.107
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558186,540025,540918,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'N','.','Y','Y','A01AVP',490,50,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.167
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558187,540025,540919,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'N','.','Y','Y','A01UVP',500,51,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.228
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558188,540025,540920,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'N','.','Y','Y','A01ZBV',510,52,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.288
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558189,540025,540921,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01MWST',520,53,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.353
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558190,540025,540922,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01PPU',530,54,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.419
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558191,540025,540923,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AB130A2',540,55,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.484
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558192,540025,540924,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01APU783A',550,56,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.558
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558193,540025,540925,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AEPPPU',560,57,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.626
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558194,540025,540926,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AVPPPU',570,58,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.691
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558195,540025,540927,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01DPPUAPU',580,59,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.752
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558196,540025,540928,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01RESERV1',590,60,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.812
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558197,540025,540929,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01RESERV2',600,61,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.876
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558198,540025,540930,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01RESERV3',610,62,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:40.944
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataFormat,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558199,540025,540931,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'yyyyMMdd','D','.','N','Y','A02GDAT',620,63,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.001
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558200,540025,540932,0,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02AM',630,64,TO_TIMESTAMP('2019-01-08 15:09:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.064
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558201,540025,540933,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02MP',640,65,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.137
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558202,540025,540934,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02APPFL',650,66,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.200
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558203,540025,540935,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02VSPFL',660,67,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.261
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558204,540025,540936,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02BTM',670,68,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.320
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558205,540025,540937,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02BOPST',680,69,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.384
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558206,540025,540938,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02TFG',690,70,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.446
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558207,540025,540939,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02DROCH',700,71,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.509
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558208,540025,540940,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02TIERAM',710,72,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.574
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558209,540025,540941,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02NEGLIS',720,73,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.638
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558210,540025,540942,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02HMZV',730,74,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.697
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558211,540025,540943,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02LIFSTYL',740,75,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.753
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558212,540025,540944,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02HOMOEO',750,76,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.811
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558213,540025,540945,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02ANTHRO',760,77,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.874
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558214,540025,540946,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02PHYTO',770,78,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:41.939
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558215,540025,540947,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02AUSNREI',780,79,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.003
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558216,540025,540948,0,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02GENER',790,80,TO_TIMESTAMP('2019-01-08 15:09:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.066
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558217,540025,540949,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02SDB',800,81,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.133
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558218,540025,540950,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02ZULREG',810,82,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.189
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558219,540025,540951,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02LEBENSM',820,83,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.252
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558220,540025,540952,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02NEM',830,84,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.310
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558221,540025,540953,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02DIAET',840,85,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.375
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558222,540025,540954,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02BIOZID',850,86,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.441
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558223,540025,540955,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02PSM',860,87,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.500
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558224,540025,540956,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02TREZEP',870,88,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.559
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558225,540025,540957,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A0247AMG',880,89,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.624
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558226,540025,540958,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02130A18',890,90,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.687
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558227,540025,540959,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02130A1A8',900,91,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.751
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558228,540025,540960,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A0252B',910,92,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.806
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558229,540025,540961,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02BIOSIEG',920,93,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.869
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558230,540025,540962,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02KOSMET',930,94,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.928
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558231,540025,540963,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02STERIL',940,95,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:42.987
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558232,540025,540964,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02EB130B',950,96,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.050
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558233,540025,540965,0,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02WIRKSTO',960,97,TO_TIMESTAMP('2019-01-08 15:09:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.116
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558234,540025,540966,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02ELEKTRO',970,98,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.181
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558235,540025,540967,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02EXPLOS',980,99,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.245
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558236,540025,540968,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02BIOTECH',990,100,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.304
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558237,540025,540969,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02ELEKEAR',1000,101,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.401
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558238,540025,540970,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02WEEEREG',1010,102,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.465
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558239,540025,540971,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02BATTG',1020,103,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.529
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558240,540025,540972,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02MELDENR',1030,104,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.595
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558241,540025,540973,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02RESERV1',1040,105,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.659
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558242,540025,540974,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02RESERV2',1050,106,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.723
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558243,540025,540975,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02RESERV3',1060,107,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.788
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataFormat,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558244,540025,540976,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'yyyyMMdd','D','.','N','Y','A11GDAT',1070,108,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.853
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558245,540025,540977,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A11VERIFIZ',1080,109,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.916
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558246,540025,540978,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A11VERITES',1090,110,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:43.984
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558247,540025,540979,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A11VERIREA',1100,111,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.048
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558248,540025,540980,0,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A11VERIPFL',1110,112,TO_TIMESTAMP('2019-01-08 15:09:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.113
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataFormat,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558249,540025,540981,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'yyyyMMdd','D','.','N','Y','A03GDAT',1120,113,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.177
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558250,540025,540982,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VTSTAT',1130,114,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.240
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558251,540025,540983,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VWGGH',1140,115,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.300
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558252,540025,540984,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VWGAPO',1150,116,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.357
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558253,540025,540985,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VWGKAP',1160,117,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.420
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558254,540025,540986,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VWGSEH',1170,118,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.485
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558255,540025,540987,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VKSTAT',1180,119,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.541
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataFormat,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558256,540025,540988,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'yyyyMMdd','D','.','N','Y','A06GDAT',1190,120,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.596
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558257,540025,540989,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A06PZNNF',1200,121,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.656
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558258,540025,540990,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A06PZNORIG',1210,122,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.718
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataFormat,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558259,540025,540991,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'yyyyMMdd','D','.','N','Y','A09GDAT',1220,123,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:09:44.774
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558260,540025,540992,0,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A09THGP',1230,124,TO_TIMESTAMP('2019-01-08 15:09:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:10:08.774
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=563684,Updated=TO_TIMESTAMP('2019-01-08 15:10:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540877
;
-- 2019-01-08T15:10:55.319
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,563685,540025,540993,0,TO_TIMESTAMP('2019-01-08 15:10:55','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00GTIN',120,13,TO_TIMESTAMP('2019-01-08 15:10:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:12:26.007
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=12,Updated=TO_TIMESTAMP('2019-01-08 15:12:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540993
;
update AD_ImpFormat_Row set startno = startno + 1, seqno = seqno + 10
where AD_ImpFormat_ID=540025 and startno >=13;
-- 2019-01-08T15:13:11.630
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=13,Updated=TO_TIMESTAMP('2019-01-08 15:13:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540993
;
-- 2019-01-08T15:15:21.700
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=563686,Updated=TO_TIMESTAMP('2019-01-08 15:15:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540933
;
-- 2019-01-08T15:15:26.500
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET Name='A02MP31',Updated=TO_TIMESTAMP('2019-01-08 15:15:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540933
;
-- 2019-01-08T15:15:43.608
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,563687,540025,540994,0,TO_TIMESTAMP('2019-01-08 15:15:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02MPKLASS',650,66,TO_TIMESTAMP('2019-01-08 15:15:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:16:28.200
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,563688,540025,540995,0,TO_TIMESTAMP('2019-01-08 15:16:28','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02INVITRO',650,66,TO_TIMESTAMP('2019-01-08 15:16:28','YYYY-MM-DD HH24:MI:SS'),100)
;
update AD_ImpFormat_Row set startno = startno + 3, seqno = seqno + 30
where AD_ImpFormat_ID=540025 and startno >=67;
-- 2019-01-08T15:18:05.347
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=67,Updated=TO_TIMESTAMP('2019-01-08 15:18:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540933
;
-- 2019-01-08T15:18:08.441
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=68,Updated=TO_TIMESTAMP('2019-01-08 15:18:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540995
;
-- 2019-01-08T15:18:22.681
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=69,Updated=TO_TIMESTAMP('2019-01-08 15:18:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540994
;
-- 2019-01-08T15:18:25.479
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=69,Updated=TO_TIMESTAMP('2019-01-08 15:18:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540995
;
-- 2019-01-08T15:18:30.546
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=68,Updated=TO_TIMESTAMP('2019-01-08 15:18:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540994
;
-- 2019-01-08T15:19:11.157
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558201,540025,540996,0,TO_TIMESTAMP('2019-01-08 15:19:11','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02MP',640,66,TO_TIMESTAMP('2019-01-08 15:19:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:19:17.927
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET SeqNo=650,Updated=TO_TIMESTAMP('2019-01-08 15:19:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540996
;
-- 2019-01-08T15:19:20.798
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET SeqNo=660,Updated=TO_TIMESTAMP('2019-01-08 15:19:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540933
;
-- 2019-01-08T15:19:25.702
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET SeqNo=670,Updated=TO_TIMESTAMP('2019-01-08 15:19:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540994
;
-- 2019-01-08T15:19:28.979
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET SeqNo=680,Updated=TO_TIMESTAMP('2019-01-08 15:19:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540995
;
-- 2019-01-08T15:20:47.396
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,563702,540025,540997,0,TO_TIMESTAMP('2019-01-08 15:20:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02SDB',850,85,TO_TIMESTAMP('2019-01-08 15:20:47','YYYY-MM-DD HH24:MI:SS'),100)
;
update AD_ImpFormat_Row set startno = startno + 1, seqno = seqno + 10
where AD_ImpFormat_ID=540025 and startno >=86;
-- 2019-01-08T15:21:42.405
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=86,Updated=TO_TIMESTAMP('2019-01-08 15:21:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540997
;
-- 2019-01-08T15:23:12.940
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,563703,540025,540998,0,TO_TIMESTAMP('2019-01-08 15:23:12','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02VERB31',1080,109,TO_TIMESTAMP('2019-01-08 15:23:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-08T15:24:00.422
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,563704,540025,540999,0,TO_TIMESTAMP('2019-01-08 15:24:00','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02CMR',1080,109,TO_TIMESTAMP('2019-01-08 15:24:00','YYYY-MM-DD HH24:MI:SS'),100)
;
update AD_ImpFormat_Row set startno = startno + 2, seqno = seqno + 20
where AD_ImpFormat_ID=540025 and startno >=110;
-- 2019-01-08T15:25:09.470
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=111,Updated=TO_TIMESTAMP('2019-01-08 15:25:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540999
;
-- 2019-01-08T15:25:16.558
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET SeqNo=1100,Updated=TO_TIMESTAMP('2019-01-08 15:25:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540999
;
-- 2019-01-08T15:25:36.077
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET SeqNo=1009, StartNo=110,Updated=TO_TIMESTAMP('2019-01-08 15:25:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540998
;
-- 2019-01-08T15:28:15.483
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540978
;
-- 2019-01-08T15:28:23.581
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540979
;
-- 2019-01-08T15:28:42.470
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET SeqNo=1106, StartNo=117,Updated=TO_TIMESTAMP('2019-01-08 15:28:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540980
;
update AD_ImpFormat_Row set startno = startno - 2, seqno = seqno - 20
where AD_ImpFormat_ID=540025 and startno >=120;
-- 2019-01-08T15:32:11.746
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET AD_Column_ID=563705, DataType='D', Name='A11VERIHOC', SeqNo=1160,Updated=TO_TIMESTAMP('2019-01-08 15:32:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540980
;
-- 2019-01-08T15:32:18.388
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyyMMdd',Updated=TO_TIMESTAMP('2019-01-08 15:32:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540980
;
-- 2019-01-08T15:32:46.669
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET SeqNo=1170,Updated=TO_TIMESTAMP('2019-01-08 15:32:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540980
;
-- 2019-01-08T15:33:45.122
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (1000000,558248,540025,541000,0,TO_TIMESTAMP('2019-01-08 15:33:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A11VERIPFL',1160,116,TO_TIMESTAMP('2019-01-08 15:33:44','YYYY-MM-DD HH24:MI:SS'),100)
;
update AD_ImpFormat_Row set startno = startno + 1 , seqno = seqno + 10
where AD_ImpFormat_ID=540025 and startno >=180;
-- 2019-01-08T15:35:00.299
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=117,Updated=TO_TIMESTAMP('2019-01-08 15:35:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=541000
;
-- 2019-01-08T15:35:08.074
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=118,Updated=TO_TIMESTAMP('2019-01-08 15:35:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540980
;
-- 2019-01-08T15:36:04.839
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET SeqNo=1180,Updated=TO_TIMESTAMP('2019-01-08 15:36:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540981
;
update AD_ImpFormat_Row set startno = startno + 1 , seqno = seqno + 10
where AD_ImpFormat_ID=540025 and seqno >=1180;
-- 2019-01-08T15:37:00.540
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET SeqNo=1180,Updated=TO_TIMESTAMP('2019-01-08 15:37:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540981
;
-- 2019-01-08T15:37:48.649
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataType='S',Updated=TO_TIMESTAMP('2019-01-08 15:37:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540989
;
-- 2019-01-08T15:37:55.237
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataType='S',Updated=TO_TIMESTAMP('2019-01-08 15:37:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540990
;
-- 2019-01-08T15:49:06.951
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET Name='A00NTIN',Updated=TO_TIMESTAMP('2019-01-08 15:49:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540993
;
-- 2019-01-08T15:50:18.349
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataType='S',Updated=TO_TIMESTAMP('2019-01-08 15:50:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540999
;
-- 2019-01-08T15:51:00.341
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataType='S',Updated=TO_TIMESTAMP('2019-01-08 15:51:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540998
; | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.