github.com/voedger/voedger@v0.0.0-20240520144910-273e84102129/design/schemas/untill-tables.vsql (about) 1 -- Copyright (c) 2020-present unTill Pro, Ltd. 2 3 SCHEMA untill 4 5 TABLE bill OF WDOC ( 6 tableno int32 not null, 7 id_untill_users id references untill_users, 8 table_part text, 9 id_courses id references courses, 10 id_clients id references clients, 11 name text 12 -- ... 13 ); 14 15 16 PROCEDURE MyOrdersValidator2(sys.TableRow) ENGINE WASM; 17 TABLE orders OF ODOC ( 18 working_day text not null check('^[0-9]{8}$'), 19 ord_datetime int64, 20 id_bill id references bill, 21 -- ... 22 TABLE order_item { 23 id_orders id references orders, 24 quantity int32, 25 id_prices id references prices, 26 price int64, 27 28 id_articles id references articles, 29 -- ... 30 } 31 CHECK MyOrdersCheck AS PROCEDURE MyOrdersValidator(sys.TableRow) ENGINE WASM, 32 CHECK MyOrdersCheck2 IS MyOrdersValidator2 33 ) WITH Tag IS PosTag; 34 35 36 TABLE articles OF CDOC { 37 name text, 38 number int32, 39 id_department id references departments, 40 -- ... 41 } 42 43 TABLE currency OF CDOC ( 44 code text NOT NULL, 45 name text NOT NULL, 46 round int32 NOT NULL CHECK(round>=0 && round<=4), 47 round int32 NOT NULL CHECK MyValidator, 48 eurozone boolean NOT NULL, 49 rate float32 NOT NULL, 50 symbol text, 51 sym_alignment int32, 52 digcode int32, 53 round_down int64, 54 CHECK MyValidator(round, rate) 55 56 )