-
Notifications
You must be signed in to change notification settings - Fork 355
Expand file tree
/
Copy pathstructure.sql
More file actions
3999 lines (2853 loc) · 98.1 KB
/
Copy pathstructure.sql
File metadata and controls
3999 lines (2853 loc) · 98.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_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: 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: special_action; Type: TYPE; Schema: public; Owner: -
--
CREATE TYPE public.special_action AS ENUM (
'dump_info',
'emergency_lock',
'emergency_unlock',
'power_off',
'read_status',
'reboot',
'sync',
'take_photo'
);
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: active_storage_attachments; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.active_storage_attachments (
id bigint NOT NULL,
name character varying NOT NULL,
record_type character varying NOT NULL,
record_id bigint NOT NULL,
blob_id bigint NOT NULL,
created_at timestamp without time zone NOT NULL
);
--
-- Name: active_storage_attachments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.active_storage_attachments_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: active_storage_attachments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.active_storage_attachments_id_seq OWNED BY public.active_storage_attachments.id;
--
-- Name: active_storage_blobs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.active_storage_blobs (
id bigint NOT NULL,
key character varying NOT NULL,
filename character varying NOT NULL,
content_type character varying,
metadata text,
byte_size bigint NOT NULL,
checksum character varying,
created_at timestamp without time zone NOT NULL,
service_name character varying NOT NULL
);
--
-- Name: active_storage_blobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.active_storage_blobs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: active_storage_blobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.active_storage_blobs_id_seq OWNED BY public.active_storage_blobs.id;
--
-- Name: active_storage_variant_records; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.active_storage_variant_records (
id bigint NOT NULL,
blob_id bigint NOT NULL,
variation_digest character varying NOT NULL
);
--
-- Name: active_storage_variant_records_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.active_storage_variant_records_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: active_storage_variant_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.active_storage_variant_records_id_seq OWNED BY public.active_storage_variant_records.id;
--
-- Name: ai_feedbacks; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.ai_feedbacks (
id bigint NOT NULL,
device_id bigint,
prompt character varying(500),
reaction character varying(25),
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
model character varying(30),
temperature character varying(5)
);
--
-- Name: ai_feedbacks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.ai_feedbacks_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: ai_feedbacks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.ai_feedbacks_id_seq OWNED BY public.ai_feedbacks.id;
--
-- Name: alerts; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.alerts (
id bigint NOT NULL,
problem_tag character varying NOT NULL,
priority integer DEFAULT 100 NOT NULL,
slug character varying NOT NULL,
device_id bigint NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: alerts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.alerts_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: alerts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.alerts_id_seq OWNED BY public.alerts.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(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
--
-- Name: arg_names; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.arg_names (
id bigint NOT NULL,
value character varying NOT NULL
);
--
-- Name: arg_names_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.arg_names_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: arg_names_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.arg_names_id_seq OWNED BY public.arg_names.id;
--
-- Name: arg_sets; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.arg_sets (
id bigint NOT NULL,
fragment_id bigint NOT NULL,
node_id bigint NOT NULL
);
--
-- Name: arg_sets_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.arg_sets_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: arg_sets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.arg_sets_id_seq OWNED BY public.arg_sets.id;
--
-- Name: curves; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.curves (
id bigint NOT NULL,
device_id bigint NOT NULL,
name character varying(80) NOT NULL,
type character varying(10) NOT NULL,
data character varying(500) NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
--
-- Name: curves_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.curves_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: curves_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.curves_id_seq OWNED BY public.curves.id;
--
-- Name: delayed_jobs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.delayed_jobs (
id integer NOT NULL,
priority integer DEFAULT 0 NOT NULL,
attempts integer DEFAULT 0 NOT NULL,
handler text NOT NULL,
last_error text,
run_at timestamp without time zone,
locked_at timestamp without time zone,
failed_at timestamp without time zone,
locked_by character varying,
queue character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: delayed_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.delayed_jobs_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: delayed_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.delayed_jobs_id_seq OWNED BY public.delayed_jobs.id;
--
-- Name: devices; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.devices (
id integer NOT NULL,
name character varying DEFAULT 'FarmBot'::character varying,
max_log_count integer DEFAULT 1000,
max_images_count integer DEFAULT 450,
timezone character varying(280),
last_saw_api timestamp without time zone,
fbos_version character varying(17),
throttled_until timestamp without time zone,
throttled_at timestamp without time zone,
mounted_tool_id bigint,
created_at timestamp without time zone,
updated_at timestamp without time zone,
serial_number character varying(32),
mqtt_rate_limit_email_sent_at timestamp without time zone,
ota_hour integer DEFAULT 3,
first_saw_api timestamp without time zone,
ota_hour_utc integer,
last_watchdog timestamp without time zone,
last_ota_attempt_at timestamp without time zone,
fb_order_number character varying,
setup_completed_at timestamp without time zone,
lat numeric,
lng numeric,
indoor boolean DEFAULT false,
rpi character varying(3),
max_log_age_in_days integer DEFAULT 0,
max_sequence_count integer DEFAULT 0,
max_sequence_length integer DEFAULT 0,
account_seeded_at timestamp without time zone
);
--
-- Name: devices_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.devices_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: devices_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.devices_id_seq OWNED BY public.devices.id;
--
-- Name: edge_nodes; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.edge_nodes (
id bigint NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
sequence_id bigint NOT NULL,
primary_node_id bigint NOT NULL,
kind character varying(50),
value character varying(3000)
);
--
-- Name: edge_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.edge_nodes_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: edge_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.edge_nodes_id_seq OWNED BY public.edge_nodes.id;
--
-- Name: farm_events; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.farm_events (
id integer NOT NULL,
device_id integer,
start_time timestamp without time zone,
end_time timestamp without time zone,
repeat integer,
time_unit character varying,
executable_type character varying(280),
executable_id integer,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: farm_events_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.farm_events_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: farm_events_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.farm_events_id_seq OWNED BY public.farm_events.id;
--
-- Name: farmware_envs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.farmware_envs (
id bigint NOT NULL,
device_id bigint,
key character varying(100),
value character varying(1000),
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: farmware_envs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.farmware_envs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: farmware_envs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.farmware_envs_id_seq OWNED BY public.farmware_envs.id;
--
-- Name: farmware_installations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.farmware_installations (
id bigint NOT NULL,
device_id bigint,
url character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
package character varying(80),
package_error character varying
);
--
-- Name: farmware_installations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.farmware_installations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: farmware_installations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.farmware_installations_id_seq OWNED BY public.farmware_installations.id;
--
-- Name: fbos_configs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.fbos_configs (
id bigint NOT NULL,
device_id bigint,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
disable_factory_reset boolean DEFAULT true,
firmware_input_log boolean DEFAULT false,
firmware_output_log boolean DEFAULT false,
sequence_body_log boolean DEFAULT false,
sequence_complete_log boolean DEFAULT false,
sequence_init_log boolean DEFAULT false,
network_not_found_timer integer,
firmware_hardware character varying,
os_auto_update boolean DEFAULT true,
arduino_debug_messages boolean DEFAULT false,
firmware_path character varying,
firmware_debug_log boolean DEFAULT false,
update_channel character varying(7) DEFAULT 'stable'::character varying,
boot_sequence_id integer,
safe_height integer DEFAULT 0,
soil_height integer DEFAULT '-500'::integer,
gantry_height integer DEFAULT 0,
default_axis_order character varying(10) DEFAULT 'xy,z;high'::character varying
);
--
-- Name: fbos_configs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.fbos_configs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: fbos_configs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.fbos_configs_id_seq OWNED BY public.fbos_configs.id;
--
-- Name: firmware_configs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.firmware_configs (
id bigint NOT NULL,
device_id bigint,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
encoder_enabled_x integer DEFAULT 1,
encoder_enabled_y integer DEFAULT 1,
encoder_enabled_z integer DEFAULT 1,
encoder_invert_x integer DEFAULT 0,
encoder_invert_y integer DEFAULT 0,
encoder_invert_z integer DEFAULT 0,
encoder_missed_steps_decay_x integer DEFAULT 5,
encoder_missed_steps_decay_y integer DEFAULT 5,
encoder_missed_steps_decay_z integer DEFAULT 5,
encoder_missed_steps_max_x integer DEFAULT 5,
encoder_missed_steps_max_y integer DEFAULT 5,
encoder_missed_steps_max_z integer DEFAULT 5,
encoder_scaling_x integer DEFAULT 5556,
encoder_scaling_y integer DEFAULT 5556,
encoder_scaling_z integer DEFAULT 5556,
encoder_type_x integer DEFAULT 0,
encoder_type_y integer DEFAULT 0,
encoder_type_z integer DEFAULT 0,
encoder_use_for_pos_x integer DEFAULT 0,
encoder_use_for_pos_y integer DEFAULT 0,
encoder_use_for_pos_z integer DEFAULT 0,
movement_axis_nr_steps_x integer DEFAULT 0,
movement_axis_nr_steps_y integer DEFAULT 0,
movement_axis_nr_steps_z integer DEFAULT 0,
movement_enable_endpoints_x integer DEFAULT 0,
movement_enable_endpoints_y integer DEFAULT 0,
movement_enable_endpoints_z integer DEFAULT 0,
movement_home_at_boot_x integer DEFAULT 0,
movement_home_at_boot_y integer DEFAULT 0,
movement_home_at_boot_z integer DEFAULT 0,
movement_home_spd_x integer DEFAULT 400,
movement_home_spd_y integer DEFAULT 400,
movement_home_spd_z integer DEFAULT 400,
movement_home_up_x integer DEFAULT 0,
movement_home_up_y integer DEFAULT 0,
movement_home_up_z integer DEFAULT 1,
movement_invert_endpoints_x integer DEFAULT 0,
movement_invert_endpoints_y integer DEFAULT 0,
movement_invert_endpoints_z integer DEFAULT 0,
movement_invert_motor_x integer DEFAULT 0,
movement_invert_motor_y integer DEFAULT 0,
movement_invert_motor_z integer DEFAULT 0,
movement_keep_active_x integer DEFAULT 0,
movement_keep_active_y integer DEFAULT 0,
movement_keep_active_z integer DEFAULT 1,
movement_max_spd_x integer DEFAULT 400,
movement_max_spd_y integer DEFAULT 400,
movement_max_spd_z integer DEFAULT 400,
movement_min_spd_x integer DEFAULT 50,
movement_min_spd_y integer DEFAULT 50,
movement_min_spd_z integer DEFAULT 50,
movement_secondary_motor_invert_x integer DEFAULT 1,
movement_secondary_motor_x integer DEFAULT 1,
movement_step_per_mm_x double precision DEFAULT 5,
movement_step_per_mm_y double precision DEFAULT 5,
movement_step_per_mm_z double precision DEFAULT 25,
movement_steps_acc_dec_x integer DEFAULT 300,
movement_steps_acc_dec_y integer DEFAULT 300,
movement_steps_acc_dec_z integer DEFAULT 300,
movement_stop_at_home_x integer DEFAULT 1,
movement_stop_at_home_y integer DEFAULT 1,
movement_stop_at_home_z integer DEFAULT 1,
movement_stop_at_max_x integer DEFAULT 1,
movement_stop_at_max_y integer DEFAULT 1,
movement_stop_at_max_z integer DEFAULT 1,
movement_timeout_x integer DEFAULT 180,
movement_timeout_y integer DEFAULT 180,
movement_timeout_z integer DEFAULT 180,
param_config_ok integer DEFAULT 0,
param_e_stop_on_mov_err integer DEFAULT 0,
param_mov_nr_retry integer DEFAULT 3,
param_test integer DEFAULT 0,
param_use_eeprom integer DEFAULT 1,
param_version integer DEFAULT 1,
pin_guard_1_active_state integer DEFAULT 1,
pin_guard_1_pin_nr integer DEFAULT 0,
pin_guard_1_time_out integer DEFAULT 60,
pin_guard_2_active_state integer DEFAULT 1,
pin_guard_2_pin_nr integer DEFAULT 0,
pin_guard_2_time_out integer DEFAULT 60,
pin_guard_3_active_state integer DEFAULT 1,
pin_guard_3_pin_nr integer DEFAULT 0,
pin_guard_3_time_out integer DEFAULT 60,
pin_guard_4_active_state integer DEFAULT 1,
pin_guard_4_pin_nr integer DEFAULT 0,
pin_guard_4_time_out integer DEFAULT 60,
pin_guard_5_active_state integer DEFAULT 1,
pin_guard_5_pin_nr integer DEFAULT 0,
pin_guard_5_time_out integer DEFAULT 60,
movement_invert_2_endpoints_x integer DEFAULT 0,
movement_invert_2_endpoints_y integer DEFAULT 0,
movement_invert_2_endpoints_z integer DEFAULT 0,
movement_microsteps_x integer DEFAULT 1,
movement_microsteps_y integer DEFAULT 1,
movement_microsteps_z integer DEFAULT 1,
movement_motor_current_x integer DEFAULT 1823,
movement_motor_current_y integer DEFAULT 1823,
movement_motor_current_z integer DEFAULT 1823,
movement_stall_sensitivity_x integer DEFAULT 63,
movement_stall_sensitivity_y integer DEFAULT 63,
movement_stall_sensitivity_z integer DEFAULT 63,
movement_min_spd_z2 integer DEFAULT 50,
movement_max_spd_z2 integer DEFAULT 400,
movement_steps_acc_dec_z2 integer DEFAULT 300,
movement_calibration_retry_x integer DEFAULT 1,
movement_calibration_retry_y integer DEFAULT 1,
movement_calibration_retry_z integer DEFAULT 1,
movement_calibration_deadzone_x integer DEFAULT 250,
movement_calibration_deadzone_y integer DEFAULT 250,
movement_calibration_deadzone_z integer DEFAULT 250,
movement_axis_stealth_x integer DEFAULT 1,
movement_axis_stealth_y integer DEFAULT 1,
movement_axis_stealth_z integer DEFAULT 1,
movement_calibration_retry_total_x integer DEFAULT 10,
movement_calibration_retry_total_y integer DEFAULT 10,
movement_calibration_retry_total_z integer DEFAULT 10,
pin_report_1_pin_nr integer DEFAULT 0,
pin_report_2_pin_nr integer DEFAULT 0
);
--
-- Name: firmware_configs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.firmware_configs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: firmware_configs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.firmware_configs_id_seq OWNED BY public.firmware_configs.id;
--
-- Name: folders; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.folders (
id bigint NOT NULL,
device_id bigint NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
color character varying(20) NOT NULL,
name character varying(40) NOT NULL,
parent_id integer
);
--
-- Name: folders_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.folders_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: folders_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.folders_id_seq OWNED BY public.folders.id;
--
-- Name: fragments; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.fragments (
id bigint NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
device_id bigint,
owner_type character varying NOT NULL,
owner_id bigint NOT NULL
);
--
-- Name: fragments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.fragments_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: fragments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.fragments_id_seq OWNED BY public.fragments.id;
--
-- Name: global_bulletins; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.global_bulletins (
id bigint NOT NULL,
href character varying,
href_label character varying,
slug character varying,
title character varying,
type character varying,
content text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: global_bulletins_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.global_bulletins_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: global_bulletins_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.global_bulletins_id_seq OWNED BY public.global_bulletins.id;
--
-- Name: global_configs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.global_configs (
id bigint NOT NULL,
key character varying,
value text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: global_configs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.global_configs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: global_configs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.global_configs_id_seq OWNED BY public.global_configs.id;
--
-- Name: images; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.images (
id integer NOT NULL,
device_id integer,
meta text,
attachment_processed_at timestamp without time zone,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
attachment_file_name character varying,
attachment_content_type character varying,
attachment_file_size integer,
attachment_updated_at timestamp without time zone
);
--
-- Name: images_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.images_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: images_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.images_id_seq OWNED BY public.images.id;
--
-- Name: points; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.points (
id integer NOT NULL,
radius double precision DEFAULT 25.0 NOT NULL,
x double precision NOT NULL,
y double precision NOT NULL,
z double precision DEFAULT 0.0 NOT NULL,
device_id integer NOT NULL,
meta public.hstore,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
name character varying DEFAULT 'untitled'::character varying NOT NULL,
pointer_type character varying(280) NOT NULL,
planted_at timestamp without time zone,
openfarm_slug character varying(280) DEFAULT '50'::character varying NOT NULL,
plant_stage character varying(10) DEFAULT 'planned'::character varying,
tool_id integer,
pullout_direction integer DEFAULT 0,
discarded_at timestamp without time zone,
gantry_mounted boolean DEFAULT false,
depth integer DEFAULT 0,
water_curve_id integer,
spread_curve_id integer,
height_curve_id integer
);
--
-- Name: sequences; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.sequences (
id integer NOT NULL,
device_id integer,
name character varying NOT NULL,
color character varying,
updated_at timestamp without time zone,
created_at timestamp without time zone,
folder_id bigint,
pinned boolean DEFAULT false,
description text,
forked boolean DEFAULT false,
sequence_version_id bigint,
copyright character varying(1500)
);
--
-- Name: in_use_points; Type: VIEW; Schema: public; Owner: -
--
CREATE VIEW public.in_use_points AS
SELECT points.x,
points.y,
points.z,
sequences.id AS sequence_id,
edge_nodes.id AS edge_node_id,
points.device_id,
(edge_nodes.value)::integer AS point_id,
points.pointer_type,
points.name AS pointer_name,
sequences.name AS sequence_name
FROM ((public.edge_nodes
JOIN public.sequences ON ((edge_nodes.sequence_id = sequences.id)))
JOIN public.points ON (((edge_nodes.value)::integer = points.id)))
WHERE ((edge_nodes.kind)::text = 'pointer_id'::text);
--
-- Name: tools; Type: TABLE; Schema: public; Owner: -
--