1.1.basic_renew.mql 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. delete from /oktest/basic/mxfield with version
  2. -- { onerror(continue) noerrinfo() }
  3. ;
  4. delete from /oktest/basic with version
  5. -- { onerror(continue) noerrinfo() }
  6. ;
  7. delete from /oktest/basic2 with version
  8. -- { onerror(continue) noerrinfo() }
  9. ;
  10. delete from /oktest/alert_status_0000 with version
  11. -- { onerror(continue) noerrinfo() }
  12. ;
  13. delete from /oktest with version
  14. -- { onerror(continue) noerrinfo() }
  15. ;
  16. select class from /oktest/
  17. -- { output() onerror(continue) noerrinfo() }
  18. ;
  19. drop class if exists /oktest/basic/mxfield
  20. ;
  21. drop class if exists /oktest/basic
  22. ;
  23. drop class if exists /oktest/basic2
  24. ;
  25. drop class if exists /oktest/alert_status_0000
  26. ;
  27. drop class if exists /oktest
  28. ;
  29. create class if not exists /oktest() with namespace="oktest"
  30. ;
  31. create edge type if not exists oktest.connect
  32. ;
  33. create class if not exists /oktest()
  34. ;
  35. typedef if not exists STRSTR = varchar ;
  36. typedef if not exists DOUDOU = double ;
  37. create class if not exists /oktest/basic (
  38. v_varchar STRSTR,
  39. v_text text,
  40. v_int int,
  41. v_bigint bigint,
  42. v_smalldouble double,
  43. v_double DOUDOU,
  44. v_float float,
  45. v_bool bool,
  46. v_blob blob,
  47. indexes(v_varchar, v_text, v_int, v_bigint, v_double, v_float, v_smalldouble, v_bool),
  48. keys(v_varchar, v_text)
  49. );
  50. create class if not exists /oktest/basic/mxfield () with autosearch=true , version=false , key=manu, nickname = 'oktest_mxfield' ;
  51. alter class /oktest/basic with nickname='oktest_basic'
  52. ;
  53. --taget define in tools, its string
  54. alter class /oktest/basic add column target int ;
  55. --oktest hello:version, hello:policy field
  56. create class if not exists /matrix/system/oktest (
  57. version int,
  58. policy int,
  59. keys(name)
  60. )with nickname='oktest_hello';
  61. create class if not exists /oktest/basic2 (
  62. name text,
  63. keys(name)
  64. ) with nickname='oktest_basic2';
  65. alter class /oktest/basic with ttl=366 day , autosearch=true , version=true
  66. ;