| 1 | -- |
|---|
| 2 | -- PostgreSQL database dump |
|---|
| 3 | -- |
|---|
| 4 | |
|---|
| 5 | SET client_encoding = 'UTF8'; |
|---|
| 6 | SET check_function_bodies = false; |
|---|
| 7 | SET client_min_messages = warning; |
|---|
| 8 | |
|---|
| 9 | -- |
|---|
| 10 | -- Name: wifidog; Type: DATABASE; Schema: -; Owner: wifidog |
|---|
| 11 | -- |
|---|
| 12 | |
|---|
| 13 | CREATE DATABASE wifidog WITH TEMPLATE = template0 ENCODING = 'UTF8'; |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | \connect wifidog |
|---|
| 17 | |
|---|
| 18 | SET client_encoding = 'UTF8'; |
|---|
| 19 | SET check_function_bodies = false; |
|---|
| 20 | SET client_min_messages = warning; |
|---|
| 21 | |
|---|
| 22 | -- |
|---|
| 23 | -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres |
|---|
| 24 | -- |
|---|
| 25 | |
|---|
| 26 | COMMENT ON SCHEMA public IS 'Standard public schema'; |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | SET search_path = public, pg_catalog; |
|---|
| 30 | |
|---|
| 31 | SET default_tablespace = ''; |
|---|
| 32 | |
|---|
| 33 | SET default_with_oids = true; |
|---|
| 34 | |
|---|
| 35 | -- |
|---|
| 36 | -- Name: administrators; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 37 | -- |
|---|
| 38 | |
|---|
| 39 | CREATE TABLE administrators ( |
|---|
| 40 | user_id character varying(45) DEFAULT ''::character varying NOT NULL |
|---|
| 41 | ); |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | -- |
|---|
| 45 | -- Name: connections; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 46 | -- |
|---|
| 47 | |
|---|
| 48 | CREATE TABLE connections ( |
|---|
| 49 | conn_id serial NOT NULL, |
|---|
| 50 | token character varying(32) DEFAULT ''::character varying NOT NULL, |
|---|
| 51 | token_status character varying(10) DEFAULT 'UNUSED'::character varying NOT NULL, |
|---|
| 52 | timestamp_in timestamp without time zone, |
|---|
| 53 | node_id character varying(32), |
|---|
| 54 | node_ip character varying(15), |
|---|
| 55 | timestamp_out timestamp without time zone, |
|---|
| 56 | user_id character varying(45) DEFAULT ''::character varying NOT NULL, |
|---|
| 57 | user_mac character varying(18), |
|---|
| 58 | user_ip character varying(16), |
|---|
| 59 | last_updated timestamp without time zone NOT NULL, |
|---|
| 60 | incoming bigint, |
|---|
| 61 | outgoing bigint |
|---|
| 62 | ); |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | -- |
|---|
| 66 | -- Name: content; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 67 | -- |
|---|
| 68 | |
|---|
| 69 | CREATE TABLE content ( |
|---|
| 70 | content_id text NOT NULL, |
|---|
| 71 | content_type text NOT NULL, |
|---|
| 72 | title text, |
|---|
| 73 | description text, |
|---|
| 74 | project_info text, |
|---|
| 75 | creation_timestamp timestamp without time zone DEFAULT now(), |
|---|
| 76 | is_persistent boolean DEFAULT false, |
|---|
| 77 | long_description text, |
|---|
| 78 | title_is_displayed boolean DEFAULT true NOT NULL, |
|---|
| 79 | CONSTRAINT content_type_not_empty_string CHECK ((content_type <> ''::text)) |
|---|
| 80 | ); |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | -- |
|---|
| 84 | -- Name: content_available_display_areas; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 85 | -- |
|---|
| 86 | |
|---|
| 87 | CREATE TABLE content_available_display_areas ( |
|---|
| 88 | display_area text NOT NULL |
|---|
| 89 | ); |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | -- |
|---|
| 93 | -- Name: content_available_display_pages; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 94 | -- |
|---|
| 95 | |
|---|
| 96 | CREATE TABLE content_available_display_pages ( |
|---|
| 97 | display_page text NOT NULL |
|---|
| 98 | ); |
|---|
| 99 | |
|---|
| 100 | |
|---|
| 101 | SET default_with_oids = false; |
|---|
| 102 | |
|---|
| 103 | -- |
|---|
| 104 | -- Name: content_clickthrough_log; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 105 | -- |
|---|
| 106 | |
|---|
| 107 | CREATE TABLE content_clickthrough_log ( |
|---|
| 108 | user_id text, |
|---|
| 109 | content_id text NOT NULL, |
|---|
| 110 | clickthrough_timestamp timestamp without time zone DEFAULT now() NOT NULL, |
|---|
| 111 | node_id text NOT NULL, |
|---|
| 112 | destination_url text NOT NULL, |
|---|
| 113 | CONSTRAINT content_clickthrough_log_destination_url_check CHECK ((destination_url <> ''::text)) |
|---|
| 114 | ); |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | SET default_with_oids = true; |
|---|
| 118 | |
|---|
| 119 | -- |
|---|
| 120 | -- Name: content_display_log; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 121 | -- |
|---|
| 122 | |
|---|
| 123 | CREATE TABLE content_display_log ( |
|---|
| 124 | user_id text NOT NULL, |
|---|
| 125 | content_id text NOT NULL, |
|---|
| 126 | first_display_timestamp timestamp without time zone DEFAULT now() NOT NULL, |
|---|
| 127 | node_id text NOT NULL, |
|---|
| 128 | last_display_timestamp timestamp without time zone DEFAULT now() NOT NULL |
|---|
| 129 | ); |
|---|
| 130 | |
|---|
| 131 | |
|---|
| 132 | -- |
|---|
| 133 | -- Name: content_embedded_content; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 134 | -- |
|---|
| 135 | |
|---|
| 136 | CREATE TABLE content_embedded_content ( |
|---|
| 137 | embedded_content_id text NOT NULL, |
|---|
| 138 | embedded_file_id text, |
|---|
| 139 | fallback_content_id text, |
|---|
| 140 | parameters text, |
|---|
| 141 | attributes text |
|---|
| 142 | ); |
|---|
| 143 | |
|---|
| 144 | |
|---|
| 145 | -- |
|---|
| 146 | -- Name: content_file; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 147 | -- |
|---|
| 148 | |
|---|
| 149 | CREATE TABLE content_file ( |
|---|
| 150 | files_id text NOT NULL, |
|---|
| 151 | filename text, |
|---|
| 152 | mime_type text, |
|---|
| 153 | remote_size bigint, |
|---|
| 154 | url text, |
|---|
| 155 | data_blob oid, |
|---|
| 156 | local_binary_size bigint, |
|---|
| 157 | creation_date timestamp without time zone DEFAULT now(), |
|---|
| 158 | last_update_date timestamp without time zone DEFAULT now() |
|---|
| 159 | ); |
|---|
| 160 | |
|---|
| 161 | |
|---|
| 162 | -- |
|---|
| 163 | -- Name: content_file_image; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 164 | -- |
|---|
| 165 | |
|---|
| 166 | CREATE TABLE content_file_image ( |
|---|
| 167 | pictures_id text NOT NULL, |
|---|
| 168 | width integer, |
|---|
| 169 | height integer, |
|---|
| 170 | hyperlink_url text |
|---|
| 171 | ); |
|---|
| 172 | |
|---|
| 173 | |
|---|
| 174 | -- |
|---|
| 175 | -- Name: content_flickr_photostream; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 176 | -- |
|---|
| 177 | |
|---|
| 178 | CREATE TABLE content_flickr_photostream ( |
|---|
| 179 | flickr_photostream_id text NOT NULL, |
|---|
| 180 | api_key text, |
|---|
| 181 | photo_selection_mode text DEFAULT 'PSM_GROUP'::text NOT NULL, |
|---|
| 182 | user_id text, |
|---|
| 183 | user_name text, |
|---|
| 184 | tags text, |
|---|
| 185 | tag_mode character varying(10) DEFAULT 'any'::character varying, |
|---|
| 186 | group_id text, |
|---|
| 187 | random boolean DEFAULT true NOT NULL, |
|---|
| 188 | min_taken_date timestamp without time zone, |
|---|
| 189 | max_taken_date timestamp without time zone, |
|---|
| 190 | photo_batch_size integer DEFAULT 10, |
|---|
| 191 | photo_count integer DEFAULT 1, |
|---|
| 192 | display_title boolean DEFAULT true NOT NULL, |
|---|
| 193 | display_description boolean DEFAULT false NOT NULL, |
|---|
| 194 | display_tags boolean DEFAULT false NOT NULL, |
|---|
| 195 | preferred_size text, |
|---|
| 196 | requests_cache text, |
|---|
| 197 | cache_update_timestamp timestamp without time zone, |
|---|
| 198 | api_shared_secret text, |
|---|
| 199 | photo_display_mode text DEFAULT 'PDM_GRID'::text NOT NULL |
|---|
| 200 | ); |
|---|
| 201 | |
|---|
| 202 | |
|---|
| 203 | -- |
|---|
| 204 | -- Name: content_group; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 205 | -- |
|---|
| 206 | |
|---|
| 207 | CREATE TABLE content_group ( |
|---|
| 208 | content_group_id text NOT NULL, |
|---|
| 209 | is_artistic_content boolean DEFAULT false NOT NULL, |
|---|
| 210 | is_locative_content boolean DEFAULT false NOT NULL, |
|---|
| 211 | content_changes_on_mode text DEFAULT 'ALWAYS'::text NOT NULL, |
|---|
| 212 | content_ordering_mode text DEFAULT 'RANDOM'::text NOT NULL, |
|---|
| 213 | display_num_elements integer DEFAULT 1 NOT NULL, |
|---|
| 214 | allow_repeat text DEFAULT 'YES'::text NOT NULL, |
|---|
| 215 | CONSTRAINT display_at_least_one_element CHECK ((display_num_elements > 0)) |
|---|
| 216 | ); |
|---|
| 217 | |
|---|
| 218 | |
|---|
| 219 | -- |
|---|
| 220 | -- Name: content_group_element; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 221 | -- |
|---|
| 222 | |
|---|
| 223 | CREATE TABLE content_group_element ( |
|---|
| 224 | content_group_element_id text NOT NULL, |
|---|
| 225 | content_group_id text NOT NULL, |
|---|
| 226 | display_order integer DEFAULT 1, |
|---|
| 227 | displayed_content_id text, |
|---|
| 228 | force_only_allowed_node boolean, |
|---|
| 229 | valid_from_timestamp timestamp without time zone, |
|---|
| 230 | valid_until_timestamp timestamp without time zone |
|---|
| 231 | ); |
|---|
| 232 | |
|---|
| 233 | |
|---|
| 234 | -- |
|---|
| 235 | -- Name: content_group_element_has_allowed_nodes; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 236 | -- |
|---|
| 237 | |
|---|
| 238 | CREATE TABLE content_group_element_has_allowed_nodes ( |
|---|
| 239 | content_group_element_id text NOT NULL, |
|---|
| 240 | node_id text NOT NULL, |
|---|
| 241 | allowed_since timestamp without time zone DEFAULT now() |
|---|
| 242 | ); |
|---|
| 243 | |
|---|
| 244 | |
|---|
| 245 | -- |
|---|
| 246 | -- Name: content_has_owners; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 247 | -- |
|---|
| 248 | |
|---|
| 249 | CREATE TABLE content_has_owners ( |
|---|
| 250 | content_id text NOT NULL, |
|---|
| 251 | user_id text NOT NULL, |
|---|
| 252 | is_author boolean DEFAULT false NOT NULL, |
|---|
| 253 | owner_since timestamp without time zone DEFAULT now() |
|---|
| 254 | ); |
|---|
| 255 | |
|---|
| 256 | |
|---|
| 257 | -- |
|---|
| 258 | -- Name: content_iframe; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 259 | -- |
|---|
| 260 | |
|---|
| 261 | CREATE TABLE content_iframe ( |
|---|
| 262 | iframes_id text NOT NULL, |
|---|
| 263 | url text, |
|---|
| 264 | width integer, |
|---|
| 265 | height integer |
|---|
| 266 | ); |
|---|
| 267 | |
|---|
| 268 | |
|---|
| 269 | -- |
|---|
| 270 | -- Name: content_langstring_entries; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 271 | -- |
|---|
| 272 | |
|---|
| 273 | CREATE TABLE content_langstring_entries ( |
|---|
| 274 | langstring_entries_id text NOT NULL, |
|---|
| 275 | langstrings_id text, |
|---|
| 276 | locales_id text, |
|---|
| 277 | value text DEFAULT ''::text |
|---|
| 278 | ); |
|---|
| 279 | |
|---|
| 280 | |
|---|
| 281 | -- |
|---|
| 282 | -- Name: content_rss_aggregator; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 283 | -- |
|---|
| 284 | |
|---|
| 285 | CREATE TABLE content_rss_aggregator ( |
|---|
| 286 | content_id text NOT NULL, |
|---|
| 287 | number_of_display_items integer DEFAULT 10 NOT NULL, |
|---|
| 288 | algorithm_strength real DEFAULT 0.75 NOT NULL, |
|---|
| 289 | max_item_age interval |
|---|
| 290 | ); |
|---|
| 291 | |
|---|
| 292 | |
|---|
| 293 | -- |
|---|
| 294 | -- Name: content_rss_aggregator_feeds; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 295 | -- |
|---|
| 296 | |
|---|
| 297 | CREATE TABLE content_rss_aggregator_feeds ( |
|---|
| 298 | content_id text NOT NULL, |
|---|
| 299 | url text NOT NULL, |
|---|
| 300 | bias real DEFAULT 1 NOT NULL, |
|---|
| 301 | default_publication_interval integer, |
|---|
| 302 | title text |
|---|
| 303 | ); |
|---|
| 304 | |
|---|
| 305 | |
|---|
| 306 | -- |
|---|
| 307 | -- Name: locales; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 308 | -- |
|---|
| 309 | |
|---|
| 310 | CREATE TABLE locales ( |
|---|
| 311 | locales_id text NOT NULL |
|---|
| 312 | ); |
|---|
| 313 | |
|---|
| 314 | |
|---|
| 315 | -- |
|---|
| 316 | -- Name: network_has_content; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 317 | -- |
|---|
| 318 | |
|---|
| 319 | CREATE TABLE network_has_content ( |
|---|
| 320 | network_id text NOT NULL, |
|---|
| 321 | content_id text NOT NULL, |
|---|
| 322 | subscribe_timestamp timestamp without time zone DEFAULT now() NOT NULL, |
|---|
| 323 | display_page text DEFAULT 'portal'::text NOT NULL, |
|---|
| 324 | display_area text DEFAULT 'main_area_middle'::text NOT NULL, |
|---|
| 325 | display_order integer DEFAULT 1 NOT NULL |
|---|
| 326 | ); |
|---|
| 327 | |
|---|
| 328 | |
|---|
| 329 | -- |
|---|
| 330 | -- Name: network_stakeholders; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 331 | -- |
|---|
| 332 | |
|---|
| 333 | CREATE TABLE network_stakeholders ( |
|---|
| 334 | network_id text NOT NULL, |
|---|
| 335 | user_id character varying(45) NOT NULL, |
|---|
| 336 | is_admin boolean DEFAULT false NOT NULL, |
|---|
| 337 | is_stat_viewer boolean DEFAULT false NOT NULL |
|---|
| 338 | ); |
|---|
| 339 | |
|---|
| 340 | |
|---|
| 341 | -- |
|---|
| 342 | -- Name: networks; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 343 | -- |
|---|
| 344 | |
|---|
| 345 | CREATE TABLE networks ( |
|---|
| 346 | network_id text NOT NULL, |
|---|
| 347 | network_authenticator_class text NOT NULL, |
|---|
| 348 | network_authenticator_params text, |
|---|
| 349 | is_default_network boolean DEFAULT false NOT NULL, |
|---|
| 350 | name text DEFAULT 'Unnamed network'::text NOT NULL, |
|---|
| 351 | creation_date date DEFAULT now() NOT NULL, |
|---|
| 352 | homepage_url text, |
|---|
| 353 | tech_support_email text, |
|---|
| 354 | validation_grace_time interval DEFAULT '00:20:00'::interval NOT NULL, |
|---|
| 355 | validation_email_from_address text DEFAULT 'validation@wifidognetwork'::text NOT NULL, |
|---|
| 356 | allow_multiple_login boolean DEFAULT false NOT NULL, |
|---|
| 357 | allow_splash_only_nodes boolean DEFAULT false NOT NULL, |
|---|
| 358 | allow_custom_portal_redirect boolean DEFAULT false NOT NULL, |
|---|
| 359 | gmaps_initial_latitude numeric(16,6), |
|---|
| 360 | gmaps_initial_longitude numeric(16,6), |
|---|
| 361 | gmaps_initial_zoom_level integer, |
|---|
| 362 | gmaps_map_type text DEFAULT 'G_NORMAL_MAP'::text NOT NULL, |
|---|
| 363 | theme_pack text, |
|---|
| 364 | CONSTRAINT networks_gmaps_map_type CHECK ((gmaps_map_type <> ''::text)), |
|---|
| 365 | CONSTRAINT networks_name CHECK ((name <> ''::text)), |
|---|
| 366 | CONSTRAINT networks_network_authenticator_class CHECK ((network_authenticator_class <> ''::text)), |
|---|
| 367 | CONSTRAINT networks_validation_email_from_address CHECK ((validation_email_from_address <> ''::text)) |
|---|
| 368 | ); |
|---|
| 369 | |
|---|
| 370 | |
|---|
| 371 | SET default_with_oids = false; |
|---|
| 372 | |
|---|
| 373 | -- |
|---|
| 374 | -- Name: node_deployment_status; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 375 | -- |
|---|
| 376 | |
|---|
| 377 | CREATE TABLE node_deployment_status ( |
|---|
| 378 | node_deployment_status character varying(32) NOT NULL |
|---|
| 379 | ); |
|---|
| 380 | |
|---|
| 381 | |
|---|
| 382 | SET default_with_oids = true; |
|---|
| 383 | |
|---|
| 384 | -- |
|---|
| 385 | -- Name: node_has_content; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 386 | -- |
|---|
| 387 | |
|---|
| 388 | CREATE TABLE node_has_content ( |
|---|
| 389 | node_id text NOT NULL, |
|---|
| 390 | content_id text NOT NULL, |
|---|
| 391 | subscribe_timestamp timestamp without time zone DEFAULT now() NOT NULL, |
|---|
| 392 | display_page text DEFAULT 'portal'::text NOT NULL, |
|---|
| 393 | display_area text DEFAULT 'main_area_middle'::text NOT NULL, |
|---|
| 394 | display_order integer DEFAULT 1 NOT NULL |
|---|
| 395 | ); |
|---|
| 396 | |
|---|
| 397 | |
|---|
| 398 | -- |
|---|
| 399 | -- Name: node_stakeholders; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 400 | -- |
|---|
| 401 | |
|---|
| 402 | CREATE TABLE node_stakeholders ( |
|---|
| 403 | node_id character varying(32) NOT NULL, |
|---|
| 404 | user_id character varying(45) NOT NULL, |
|---|
| 405 | is_owner boolean DEFAULT false NOT NULL, |
|---|
| 406 | is_tech_officer boolean DEFAULT false NOT NULL |
|---|
| 407 | ); |
|---|
| 408 | |
|---|
| 409 | |
|---|
| 410 | -- |
|---|
| 411 | -- Name: nodes; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 412 | -- |
|---|
| 413 | |
|---|
| 414 | CREATE TABLE nodes ( |
|---|
| 415 | node_id character varying(32) DEFAULT ''::character varying NOT NULL, |
|---|
| 416 | name text, |
|---|
| 417 | last_heartbeat_ip character varying(16), |
|---|
| 418 | last_heartbeat_timestamp timestamp without time zone DEFAULT now(), |
|---|
| 419 | creation_date date DEFAULT now(), |
|---|
| 420 | home_page_url text, |
|---|
| 421 | last_heartbeat_user_agent text, |
|---|
| 422 | description text, |
|---|
| 423 | map_url text, |
|---|
| 424 | public_phone_number text, |
|---|
| 425 | public_email text, |
|---|
| 426 | mass_transit_info text, |
|---|
| 427 | node_deployment_status character varying(32) DEFAULT 'IN_PLANNING'::character varying NOT NULL, |
|---|
| 428 | venue_type text DEFAULT 'Other'::text, |
|---|
| 429 | max_monthly_incoming bigint, |
|---|
| 430 | max_monthly_outgoing bigint, |
|---|
| 431 | quota_reset_day_of_month integer, |
|---|
| 432 | latitude numeric(16,6), |
|---|
| 433 | longitude numeric(16,6), |
|---|
| 434 | civic_number text, |
|---|
| 435 | street_name text, |
|---|
| 436 | city text, |
|---|
| 437 | province text, |
|---|
| 438 | country text, |
|---|
| 439 | postal_code text, |
|---|
| 440 | network_id text NOT NULL, |
|---|
| 441 | last_paged timestamp without time zone, |
|---|
| 442 | is_splash_only_node boolean DEFAULT false, |
|---|
| 443 | custom_portal_redirect_url text |
|---|
| 444 | ); |
|---|
| 445 | |
|---|
| 446 | |
|---|
| 447 | -- |
|---|
| 448 | -- Name: schema_info; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 449 | -- |
|---|
| 450 | |
|---|
| 451 | CREATE TABLE schema_info ( |
|---|
| 452 | tag text NOT NULL, |
|---|
| 453 | value text |
|---|
| 454 | ); |
|---|
| 455 | |
|---|
| 456 | |
|---|
| 457 | -- |
|---|
| 458 | -- Name: servers; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 459 | -- |
|---|
| 460 | |
|---|
| 461 | CREATE TABLE servers ( |
|---|
| 462 | server_id text NOT NULL, |
|---|
| 463 | is_default_server boolean DEFAULT false NOT NULL, |
|---|
| 464 | name text DEFAULT 'Unnamed server'::text NOT NULL, |
|---|
| 465 | creation_date date DEFAULT now() NOT NULL, |
|---|
| 466 | hostname text DEFAULT 'localhost'::text NOT NULL, |
|---|
| 467 | ssl_available boolean DEFAULT false NOT NULL, |
|---|
| 468 | gmaps_api_key text, |
|---|
| 469 | CONSTRAINT servers_hostname CHECK ((name <> ''::text)), |
|---|
| 470 | CONSTRAINT servers_name CHECK ((name <> ''::text)) |
|---|
| 471 | ); |
|---|
| 472 | |
|---|
| 473 | |
|---|
| 474 | -- |
|---|
| 475 | -- Name: token_status; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 476 | -- |
|---|
| 477 | |
|---|
| 478 | CREATE TABLE token_status ( |
|---|
| 479 | token_status character varying(10) NOT NULL |
|---|
| 480 | ); |
|---|
| 481 | |
|---|
| 482 | |
|---|
| 483 | -- |
|---|
| 484 | -- Name: user_has_content; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 485 | -- |
|---|
| 486 | |
|---|
| 487 | CREATE TABLE user_has_content ( |
|---|
| 488 | user_id text NOT NULL, |
|---|
| 489 | content_id text NOT NULL, |
|---|
| 490 | subscribe_timestamp timestamp without time zone DEFAULT now() NOT NULL |
|---|
| 491 | ); |
|---|
| 492 | |
|---|
| 493 | |
|---|
| 494 | -- |
|---|
| 495 | -- Name: users; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 496 | -- |
|---|
| 497 | |
|---|
| 498 | CREATE TABLE users ( |
|---|
| 499 | user_id character varying(45) NOT NULL, |
|---|
| 500 | pass character varying(32) DEFAULT ''::character varying NOT NULL, |
|---|
| 501 | email character varying(255) DEFAULT ''::character varying NOT NULL, |
|---|
| 502 | account_status integer, |
|---|
| 503 | validation_token character varying(64) DEFAULT ''::character varying NOT NULL, |
|---|
| 504 | reg_date timestamp without time zone DEFAULT now() NOT NULL, |
|---|
| 505 | username text, |
|---|
| 506 | account_origin text NOT NULL, |
|---|
| 507 | never_show_username boolean DEFAULT false, |
|---|
| 508 | real_name text, |
|---|
| 509 | website text, |
|---|
| 510 | prefered_locale text, |
|---|
| 511 | CONSTRAINT check_user_not_empty CHECK (((user_id)::text <> ''::text)) |
|---|
| 512 | ); |
|---|
| 513 | |
|---|
| 514 | |
|---|
| 515 | SET default_with_oids = false; |
|---|
| 516 | |
|---|
| 517 | -- |
|---|
| 518 | -- Name: venue_types; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 519 | -- |
|---|
| 520 | |
|---|
| 521 | CREATE TABLE venue_types ( |
|---|
| 522 | venue_type text NOT NULL |
|---|
| 523 | ); |
|---|
| 524 | |
|---|
| 525 | |
|---|
| 526 | -- |
|---|
| 527 | -- Name: venues; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 528 | -- |
|---|
| 529 | |
|---|
| 530 | CREATE TABLE venues ( |
|---|
| 531 | name text NOT NULL, |
|---|
| 532 | description text |
|---|
| 533 | ); |
|---|
| 534 | |
|---|
| 535 | |
|---|
| 536 | -- |
|---|
| 537 | -- Name: administrators_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 538 | -- |
|---|
| 539 | |
|---|
| 540 | ALTER TABLE ONLY administrators |
|---|
| 541 | ADD CONSTRAINT administrators_pkey PRIMARY KEY (user_id); |
|---|
| 542 | |
|---|
| 543 | |
|---|
| 544 | -- |
|---|
| 545 | -- Name: connections_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 546 | -- |
|---|
| 547 | |
|---|
| 548 | ALTER TABLE ONLY connections |
|---|
| 549 | ADD CONSTRAINT connections_pkey PRIMARY KEY (conn_id); |
|---|
| 550 | |
|---|
| 551 | |
|---|
| 552 | -- |
|---|
| 553 | -- Name: content_available_display_areas_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 554 | -- |
|---|
| 555 | |
|---|
| 556 | ALTER TABLE ONLY content_available_display_areas |
|---|
| 557 | ADD CONSTRAINT content_available_display_areas_pkey PRIMARY KEY (display_area); |
|---|
| 558 | |
|---|
| 559 | |
|---|
| 560 | -- |
|---|
| 561 | -- Name: content_display_location_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 562 | -- |
|---|
| 563 | |
|---|
| 564 | ALTER TABLE ONLY content_available_display_pages |
|---|
| 565 | ADD CONSTRAINT content_display_location_pkey PRIMARY KEY (display_page); |
|---|
| 566 | |
|---|
| 567 | |
|---|
| 568 | -- |
|---|
| 569 | -- Name: content_group_element_has_allowed_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 570 | -- |
|---|
| 571 | |
|---|
| 572 | ALTER TABLE ONLY content_group_element_has_allowed_nodes |
|---|
| 573 | ADD CONSTRAINT content_group_element_has_allowed_nodes_pkey PRIMARY KEY (content_group_element_id, node_id); |
|---|
| 574 | |
|---|
| 575 | |
|---|
| 576 | -- |
|---|
| 577 | -- Name: content_group_element_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 578 | -- |
|---|
| 579 | |
|---|
| 580 | ALTER TABLE ONLY content_group_element |
|---|
| 581 | ADD CONSTRAINT content_group_element_pkey PRIMARY KEY (content_group_element_id); |
|---|
| 582 | |
|---|
| 583 | |
|---|
| 584 | -- |
|---|
| 585 | -- Name: content_group_element_portal_display_log_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 586 | -- |
|---|
| 587 | |
|---|
| 588 | ALTER TABLE ONLY content_display_log |
|---|
| 589 | ADD CONSTRAINT content_group_element_portal_display_log_pkey PRIMARY KEY (user_id, content_id, node_id); |
|---|
| 590 | |
|---|
| 591 | |
|---|
| 592 | -- |
|---|
| 593 | -- Name: content_group_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 594 | -- |
|---|
| 595 | |
|---|
| 596 | ALTER TABLE ONLY content_group |
|---|
| 597 | ADD CONSTRAINT content_group_pkey PRIMARY KEY (content_group_id); |
|---|
| 598 | |
|---|
| 599 | |
|---|
| 600 | -- |
|---|
| 601 | -- Name: content_has_owners_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 602 | -- |
|---|
| 603 | |
|---|
| 604 | ALTER TABLE ONLY content_has_owners |
|---|
| 605 | ADD CONSTRAINT content_has_owners_pkey PRIMARY KEY (content_id, user_id); |
|---|
| 606 | |
|---|
| 607 | |
|---|
| 608 | -- |
|---|
| 609 | -- Name: content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 610 | -- |
|---|
| 611 | |
|---|
| 612 | ALTER TABLE ONLY content |
|---|
| 613 | ADD CONSTRAINT content_pkey PRIMARY KEY (content_id); |
|---|
| 614 | |
|---|
| 615 | |
|---|
| 616 | -- |
|---|
| 617 | -- Name: content_rss_aggregator_feeds_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 618 | -- |
|---|
| 619 | |
|---|
| 620 | ALTER TABLE ONLY content_rss_aggregator_feeds |
|---|
| 621 | ADD CONSTRAINT content_rss_aggregator_feeds_pkey PRIMARY KEY (content_id, url); |
|---|
| 622 | |
|---|
| 623 | |
|---|
| 624 | -- |
|---|
| 625 | -- Name: content_rss_aggregator_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 626 | -- |
|---|
| 627 | |
|---|
| 628 | ALTER TABLE ONLY content_rss_aggregator |
|---|
| 629 | ADD CONSTRAINT content_rss_aggregator_pkey PRIMARY KEY (content_id); |
|---|
| 630 | |
|---|
| 631 | |
|---|
| 632 | -- |
|---|
| 633 | -- Name: files_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 634 | -- |
|---|
| 635 | |
|---|
| 636 | ALTER TABLE ONLY content_file |
|---|
| 637 | ADD CONSTRAINT files_pkey PRIMARY KEY (files_id); |
|---|
| 638 | |
|---|
| 639 | |
|---|
| 640 | -- |
|---|
| 641 | -- Name: flickr_photostream_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 642 | -- |
|---|
| 643 | |
|---|
| 644 | ALTER TABLE ONLY content_flickr_photostream |
|---|
| 645 | ADD CONSTRAINT flickr_photostream_pkey PRIMARY KEY (flickr_photostream_id); |
|---|
| 646 | |
|---|
| 647 | |
|---|
| 648 | -- |
|---|
| 649 | -- Name: iframes_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 650 | -- |
|---|
| 651 | |
|---|
| 652 | ALTER TABLE ONLY content_iframe |
|---|
| 653 | ADD CONSTRAINT iframes_pkey PRIMARY KEY (iframes_id); |
|---|
| 654 | |
|---|
| 655 | |
|---|
| 656 | -- |
|---|
| 657 | -- Name: langstring_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 658 | -- |
|---|
| 659 | |
|---|
| 660 | ALTER TABLE ONLY content_langstring_entries |
|---|
| 661 | ADD CONSTRAINT langstring_entries_pkey PRIMARY KEY (langstring_entries_id); |
|---|
| 662 | |
|---|
| 663 | |
|---|
| 664 | -- |
|---|
| 665 | -- Name: locales_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 666 | -- |
|---|
| 667 | |
|---|
| 668 | ALTER TABLE ONLY locales |
|---|
| 669 | ADD CONSTRAINT locales_pkey PRIMARY KEY (locales_id); |
|---|
| 670 | |
|---|
| 671 | |
|---|
| 672 | -- |
|---|
| 673 | -- Name: network_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 674 | -- |
|---|
| 675 | |
|---|
| 676 | ALTER TABLE ONLY network_has_content |
|---|
| 677 | ADD CONSTRAINT network_has_content_pkey PRIMARY KEY (network_id, content_id); |
|---|
| 678 | |
|---|
| 679 | |
|---|
| 680 | -- |
|---|
| 681 | -- Name: network_stakeholders_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 682 | -- |
|---|
| 683 | |
|---|
| 684 | ALTER TABLE ONLY network_stakeholders |
|---|
| 685 | ADD CONSTRAINT network_stakeholders_pkey PRIMARY KEY (network_id, user_id); |
|---|
| 686 | |
|---|
| 687 | |
|---|
| 688 | -- |
|---|
| 689 | -- Name: networks_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 690 | -- |
|---|
| 691 | |
|---|
| 692 | ALTER TABLE ONLY networks |
|---|
| 693 | ADD CONSTRAINT networks_pkey PRIMARY KEY (network_id); |
|---|
| 694 | |
|---|
| 695 | |
|---|
| 696 | -- |
|---|
| 697 | -- Name: node_deployment_status_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 698 | -- |
|---|
| 699 | |
|---|
| 700 | ALTER TABLE ONLY node_deployment_status |
|---|
| 701 | ADD CONSTRAINT node_deployment_status_pkey PRIMARY KEY (node_deployment_status); |
|---|
| 702 | |
|---|
| 703 | |
|---|
| 704 | -- |
|---|
| 705 | -- Name: node_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 706 | -- |
|---|
| 707 | |
|---|
| 708 | ALTER TABLE ONLY node_has_content |
|---|
| 709 | ADD CONSTRAINT node_has_content_pkey PRIMARY KEY (node_id, content_id); |
|---|
| 710 | |
|---|
| 711 | |
|---|
| 712 | -- |
|---|
| 713 | -- Name: node_stakeholders_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 714 | -- |
|---|
| 715 | |
|---|
| 716 | ALTER TABLE ONLY node_stakeholders |
|---|
| 717 | ADD CONSTRAINT node_stakeholders_pkey PRIMARY KEY (node_id, user_id); |
|---|
| 718 | |
|---|
| 719 | |
|---|
| 720 | -- |
|---|
| 721 | -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 722 | -- |
|---|
| 723 | |
|---|
| 724 | ALTER TABLE ONLY nodes |
|---|
| 725 | ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id); |
|---|
| 726 | |
|---|
| 727 | |
|---|
| 728 | -- |
|---|
| 729 | -- Name: pictures_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 730 | -- |
|---|
| 731 | |
|---|
| 732 | ALTER TABLE ONLY content_file_image |
|---|
| 733 | ADD CONSTRAINT pictures_pkey PRIMARY KEY (pictures_id); |
|---|
| 734 | |
|---|
| 735 | |
|---|
| 736 | -- |
|---|
| 737 | -- Name: schema_info_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 738 | -- |
|---|
| 739 | |
|---|
| 740 | ALTER TABLE ONLY schema_info |
|---|
| 741 | ADD CONSTRAINT schema_info_pkey PRIMARY KEY (tag); |
|---|
| 742 | |
|---|
| 743 | |
|---|
| 744 | -- |
|---|
| 745 | -- Name: servers_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 746 | -- |
|---|
| 747 | |
|---|
| 748 | ALTER TABLE ONLY servers |
|---|
| 749 | ADD CONSTRAINT servers_pkey PRIMARY KEY (server_id); |
|---|
| 750 | |
|---|
| 751 | |
|---|
| 752 | -- |
|---|
| 753 | -- Name: token_status_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 754 | -- |
|---|
| 755 | |
|---|
| 756 | ALTER TABLE ONLY token_status |
|---|
| 757 | ADD CONSTRAINT token_status_pkey PRIMARY KEY (token_status); |
|---|
| 758 | |
|---|
| 759 | |
|---|
| 760 | -- |
|---|
| 761 | -- Name: user_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 762 | -- |
|---|
| 763 | |
|---|
| 764 | ALTER TABLE ONLY user_has_content |
|---|
| 765 | ADD CONSTRAINT user_has_content_pkey PRIMARY KEY (user_id, content_id); |
|---|
| 766 | |
|---|
| 767 | |
|---|
| 768 | -- |
|---|
| 769 | -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 770 | -- |
|---|
| 771 | |
|---|
| 772 | ALTER TABLE ONLY users |
|---|
| 773 | ADD CONSTRAINT users_pkey PRIMARY KEY (user_id); |
|---|
| 774 | |
|---|
| 775 | |
|---|
| 776 | -- |
|---|
| 777 | -- Name: venue_types_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 778 | -- |
|---|
| 779 | |
|---|
| 780 | ALTER TABLE ONLY venue_types |
|---|
| 781 | ADD CONSTRAINT venue_types_pkey PRIMARY KEY (venue_type); |
|---|
| 782 | |
|---|
| 783 | |
|---|
| 784 | -- |
|---|
| 785 | -- Name: idx_connections_node_id; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 786 | -- |
|---|
| 787 | |
|---|
| 788 | CREATE INDEX idx_connections_node_id ON connections USING btree (node_id); |
|---|
| 789 | |
|---|
| 790 | |
|---|
| 791 | -- |
|---|
| 792 | -- Name: idx_connections_user_id; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 793 | -- |
|---|
| 794 | |
|---|
| 795 | CREATE INDEX idx_connections_user_id ON connections USING btree (user_id); |
|---|
| 796 | |
|---|
| 797 | |
|---|
| 798 | -- |
|---|
| 799 | -- Name: idx_connections_user_mac; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 800 | -- |
|---|
| 801 | |
|---|
| 802 | CREATE INDEX idx_connections_user_mac ON connections USING btree (user_mac); |
|---|
| 803 | |
|---|
| 804 | |
|---|
| 805 | -- |
|---|
| 806 | -- Name: idx_content_group_element_content_group_id; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 807 | -- |
|---|
| 808 | |
|---|
| 809 | CREATE INDEX idx_content_group_element_content_group_id ON content_group_element USING btree (content_group_id); |
|---|
| 810 | |
|---|
| 811 | |
|---|
| 812 | -- |
|---|
| 813 | -- Name: idx_content_group_element_valid_from_timestamp; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 814 | -- |
|---|
| 815 | |
|---|
| 816 | CREATE INDEX idx_content_group_element_valid_from_timestamp ON content_group_element USING btree (valid_from_timestamp); |
|---|
| 817 | |
|---|
| 818 | |
|---|
| 819 | -- |
|---|
| 820 | -- Name: idx_content_group_element_valid_until_timestamp; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 821 | -- |
|---|
| 822 | |
|---|
| 823 | CREATE INDEX idx_content_group_element_valid_until_timestamp ON content_group_element USING btree (valid_until_timestamp); |
|---|
| 824 | |
|---|
| 825 | |
|---|
| 826 | -- |
|---|
| 827 | -- Name: idx_token; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 828 | -- |
|---|
| 829 | |
|---|
| 830 | CREATE INDEX idx_token ON connections USING btree (token); |
|---|
| 831 | |
|---|
| 832 | |
|---|
| 833 | -- |
|---|
| 834 | -- Name: idx_token_status_and_user_id; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 835 | -- |
|---|
| 836 | |
|---|
| 837 | CREATE INDEX idx_token_status_and_user_id ON connections USING btree (token_status, user_id); |
|---|
| 838 | |
|---|
| 839 | |
|---|
| 840 | -- |
|---|
| 841 | -- Name: idx_unique_username_and_account_origin; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: |
|---|
| 842 | -- |
|---|
| 843 | |
|---|
| 844 | CREATE UNIQUE INDEX idx_unique_username_and_account_origin ON users USING btree (username, account_origin); |
|---|
| 845 | |
|---|
| 846 | |
|---|
| 847 | -- |
|---|
| 848 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 849 | -- |
|---|
| 850 | |
|---|
| 851 | ALTER TABLE ONLY connections |
|---|
| 852 | ADD CONSTRAINT "$1" FOREIGN KEY (token_status) REFERENCES token_status(token_status); |
|---|
| 853 | |
|---|
| 854 | |
|---|
| 855 | -- |
|---|
| 856 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 857 | -- |
|---|
| 858 | |
|---|
| 859 | ALTER TABLE ONLY users |
|---|
| 860 | ADD CONSTRAINT "$1" FOREIGN KEY (prefered_locale) REFERENCES locales(locales_id) ON UPDATE CASCADE ON DELETE SET NULL; |
|---|
| 861 | |
|---|
| 862 | |
|---|
| 863 | -- |
|---|
| 864 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 865 | -- |
|---|
| 866 | |
|---|
| 867 | ALTER TABLE ONLY content |
|---|
| 868 | ADD CONSTRAINT "$1" FOREIGN KEY (title) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; |
|---|
| 869 | |
|---|
| 870 | |
|---|
| 871 | -- |
|---|
| 872 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 873 | -- |
|---|
| 874 | |
|---|
| 875 | ALTER TABLE ONLY content_has_owners |
|---|
| 876 | ADD CONSTRAINT "$1" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 877 | |
|---|
| 878 | |
|---|
| 879 | -- |
|---|
| 880 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 881 | -- |
|---|
| 882 | |
|---|
| 883 | ALTER TABLE ONLY content_langstring_entries |
|---|
| 884 | ADD CONSTRAINT "$1" FOREIGN KEY (langstrings_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 885 | |
|---|
| 886 | |
|---|
| 887 | -- |
|---|
| 888 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 889 | -- |
|---|
| 890 | |
|---|
| 891 | ALTER TABLE ONLY content_group |
|---|
| 892 | ADD CONSTRAINT "$1" FOREIGN KEY (content_group_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 893 | |
|---|
| 894 | |
|---|
| 895 | -- |
|---|
| 896 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 897 | -- |
|---|
| 898 | |
|---|
| 899 | ALTER TABLE ONLY content_group_element |
|---|
| 900 | ADD CONSTRAINT "$1" FOREIGN KEY (content_group_element_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 901 | |
|---|
| 902 | |
|---|
| 903 | -- |
|---|
| 904 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 905 | -- |
|---|
| 906 | |
|---|
| 907 | ALTER TABLE ONLY content_group_element_has_allowed_nodes |
|---|
| 908 | ADD CONSTRAINT "$1" FOREIGN KEY (content_group_element_id) REFERENCES content_group_element(content_group_element_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 909 | |
|---|
| 910 | |
|---|
| 911 | -- |
|---|
| 912 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 913 | -- |
|---|
| 914 | |
|---|
| 915 | ALTER TABLE ONLY user_has_content |
|---|
| 916 | ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 917 | |
|---|
| 918 | |
|---|
| 919 | -- |
|---|
| 920 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 921 | -- |
|---|
| 922 | |
|---|
| 923 | ALTER TABLE ONLY node_has_content |
|---|
| 924 | ADD CONSTRAINT "$1" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 925 | |
|---|
| 926 | |
|---|
| 927 | -- |
|---|
| 928 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 929 | -- |
|---|
| 930 | |
|---|
| 931 | ALTER TABLE ONLY network_has_content |
|---|
| 932 | ADD CONSTRAINT "$1" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 933 | |
|---|
| 934 | |
|---|
| 935 | -- |
|---|
| 936 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 937 | -- |
|---|
| 938 | |
|---|
| 939 | ALTER TABLE ONLY content_display_log |
|---|
| 940 | ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 941 | |
|---|
| 942 | |
|---|
| 943 | -- |
|---|
| 944 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 945 | -- |
|---|
| 946 | |
|---|
| 947 | ALTER TABLE ONLY content_file_image |
|---|
| 948 | ADD CONSTRAINT "$1" FOREIGN KEY (pictures_id) REFERENCES content_file(files_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 949 | |
|---|
| 950 | |
|---|
| 951 | -- |
|---|
| 952 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 953 | -- |
|---|
| 954 | |
|---|
| 955 | ALTER TABLE ONLY content_iframe |
|---|
| 956 | ADD CONSTRAINT "$1" FOREIGN KEY (iframes_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 957 | |
|---|
| 958 | |
|---|
| 959 | -- |
|---|
| 960 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 961 | -- |
|---|
| 962 | |
|---|
| 963 | ALTER TABLE ONLY content_rss_aggregator |
|---|
| 964 | ADD CONSTRAINT "$1" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 965 | |
|---|
| 966 | |
|---|
| 967 | -- |
|---|
| 968 | -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 969 | -- |
|---|
| 970 | |
|---|
| 971 | ALTER TABLE ONLY content_rss_aggregator_feeds |
|---|
| 972 | ADD CONSTRAINT "$1" FOREIGN KEY (content_id) REFERENCES content_rss_aggregator(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 973 | |
|---|
| 974 | |
|---|
| 975 | -- |
|---|
| 976 | -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 977 | -- |
|---|
| 978 | |
|---|
| 979 | ALTER TABLE ONLY content |
|---|
| 980 | ADD CONSTRAINT "$2" FOREIGN KEY (description) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; |
|---|
| 981 | |
|---|
| 982 | |
|---|
| 983 | -- |
|---|
| 984 | -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 985 | -- |
|---|
| 986 | |
|---|
| 987 | ALTER TABLE ONLY content_has_owners |
|---|
| 988 | ADD CONSTRAINT "$2" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 989 | |
|---|
| 990 | |
|---|
| 991 | -- |
|---|
| 992 | -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 993 | -- |
|---|
| 994 | |
|---|
| 995 | ALTER TABLE ONLY content_langstring_entries |
|---|
| 996 | ADD CONSTRAINT "$2" FOREIGN KEY (locales_id) REFERENCES locales(locales_id) ON UPDATE CASCADE ON DELETE RESTRICT; |
|---|
| 997 | |
|---|
| 998 | |
|---|
| 999 | -- |
|---|
| 1000 | -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1001 | -- |
|---|
| 1002 | |
|---|
| 1003 | ALTER TABLE ONLY content_group_element |
|---|
| 1004 | ADD CONSTRAINT "$2" FOREIGN KEY (content_group_id) REFERENCES content_group(content_group_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1005 | |
|---|
| 1006 | |
|---|
| 1007 | -- |
|---|
| 1008 | -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1009 | -- |
|---|
| 1010 | |
|---|
| 1011 | ALTER TABLE ONLY content_group_element_has_allowed_nodes |
|---|
| 1012 | ADD CONSTRAINT "$2" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1013 | |
|---|
| 1014 | |
|---|
| 1015 | -- |
|---|
| 1016 | -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1017 | -- |
|---|
| 1018 | |
|---|
| 1019 | ALTER TABLE ONLY user_has_content |
|---|
| 1020 | ADD CONSTRAINT "$2" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1021 | |
|---|
| 1022 | |
|---|
| 1023 | -- |
|---|
| 1024 | -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1025 | -- |
|---|
| 1026 | |
|---|
| 1027 | ALTER TABLE ONLY node_has_content |
|---|
| 1028 | ADD CONSTRAINT "$2" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1029 | |
|---|
| 1030 | |
|---|
| 1031 | -- |
|---|
| 1032 | -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1033 | -- |
|---|
| 1034 | |
|---|
| 1035 | ALTER TABLE ONLY content_display_log |
|---|
| 1036 | ADD CONSTRAINT "$2" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1037 | |
|---|
| 1038 | |
|---|
| 1039 | -- |
|---|
| 1040 | -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1041 | -- |
|---|
| 1042 | |
|---|
| 1043 | ALTER TABLE ONLY network_has_content |
|---|
| 1044 | ADD CONSTRAINT "$2" FOREIGN KEY (display_area) REFERENCES content_available_display_areas(display_area) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1045 | |
|---|
| 1046 | |
|---|
| 1047 | -- |
|---|
| 1048 | -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1049 | -- |
|---|
| 1050 | |
|---|
| 1051 | ALTER TABLE ONLY content |
|---|
| 1052 | ADD CONSTRAINT "$3" FOREIGN KEY (project_info) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; |
|---|
| 1053 | |
|---|
| 1054 | |
|---|
| 1055 | -- |
|---|
| 1056 | -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1057 | -- |
|---|
| 1058 | |
|---|
| 1059 | ALTER TABLE ONLY content_group_element |
|---|
| 1060 | ADD CONSTRAINT "$3" FOREIGN KEY (displayed_content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1061 | |
|---|
| 1062 | |
|---|
| 1063 | -- |
|---|
| 1064 | -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1065 | -- |
|---|
| 1066 | |
|---|
| 1067 | ALTER TABLE ONLY content_display_log |
|---|
| 1068 | ADD CONSTRAINT "$3" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1069 | |
|---|
| 1070 | |
|---|
| 1071 | -- |
|---|
| 1072 | -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1073 | -- |
|---|
| 1074 | |
|---|
| 1075 | ALTER TABLE ONLY node_has_content |
|---|
| 1076 | ADD CONSTRAINT "$3" FOREIGN KEY (display_area) REFERENCES content_available_display_areas(display_area) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1077 | |
|---|
| 1078 | |
|---|
| 1079 | -- |
|---|
| 1080 | -- Name: $5; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1081 | -- |
|---|
| 1082 | |
|---|
| 1083 | ALTER TABLE ONLY content |
|---|
| 1084 | ADD CONSTRAINT "$5" FOREIGN KEY (long_description) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; |
|---|
| 1085 | |
|---|
| 1086 | |
|---|
| 1087 | -- |
|---|
| 1088 | -- Name: account_origin_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1089 | -- |
|---|
| 1090 | |
|---|
| 1091 | ALTER TABLE ONLY users |
|---|
| 1092 | ADD CONSTRAINT account_origin_fkey FOREIGN KEY (account_origin) REFERENCES networks(network_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1093 | |
|---|
| 1094 | |
|---|
| 1095 | -- |
|---|
| 1096 | -- Name: administrators_ibfk_1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1097 | -- |
|---|
| 1098 | |
|---|
| 1099 | ALTER TABLE ONLY administrators |
|---|
| 1100 | ADD CONSTRAINT administrators_ibfk_1 FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1101 | |
|---|
| 1102 | |
|---|
| 1103 | -- |
|---|
| 1104 | -- Name: content_clickthrough_log_content_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1105 | -- |
|---|
| 1106 | |
|---|
| 1107 | ALTER TABLE ONLY content_clickthrough_log |
|---|
| 1108 | ADD CONSTRAINT content_clickthrough_log_content_id_fkey FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1109 | |
|---|
| 1110 | |
|---|
| 1111 | -- |
|---|
| 1112 | -- Name: content_clickthrough_log_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1113 | -- |
|---|
| 1114 | |
|---|
| 1115 | ALTER TABLE ONLY content_clickthrough_log |
|---|
| 1116 | ADD CONSTRAINT content_clickthrough_log_node_id_fkey FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1117 | |
|---|
| 1118 | |
|---|
| 1119 | -- |
|---|
| 1120 | -- Name: content_clickthrough_log_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1121 | -- |
|---|
| 1122 | |
|---|
| 1123 | ALTER TABLE ONLY content_clickthrough_log |
|---|
| 1124 | ADD CONSTRAINT content_clickthrough_log_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1125 | |
|---|
| 1126 | |
|---|
| 1127 | -- |
|---|
| 1128 | -- Name: display_location_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1129 | -- |
|---|
| 1130 | |
|---|
| 1131 | ALTER TABLE ONLY network_has_content |
|---|
| 1132 | ADD CONSTRAINT display_location_fkey FOREIGN KEY (display_page) REFERENCES content_available_display_pages(display_page) ON UPDATE CASCADE ON DELETE RESTRICT; |
|---|
| 1133 | |
|---|
| 1134 | |
|---|
| 1135 | -- |
|---|
| 1136 | -- Name: display_location_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1137 | -- |
|---|
| 1138 | |
|---|
| 1139 | ALTER TABLE ONLY node_has_content |
|---|
| 1140 | ADD CONSTRAINT display_location_fkey FOREIGN KEY (display_page) REFERENCES content_available_display_pages(display_page) ON UPDATE CASCADE ON DELETE RESTRICT; |
|---|
| 1141 | |
|---|
| 1142 | |
|---|
| 1143 | -- |
|---|
| 1144 | -- Name: fk_network; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1145 | -- |
|---|
| 1146 | |
|---|
| 1147 | ALTER TABLE ONLY network_stakeholders |
|---|
| 1148 | ADD CONSTRAINT fk_network FOREIGN KEY (network_id) REFERENCES networks(network_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1149 | |
|---|
| 1150 | |
|---|
| 1151 | -- |
|---|
| 1152 | -- Name: fk_node_deployment_status; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1153 | -- |
|---|
| 1154 | |
|---|
| 1155 | ALTER TABLE ONLY nodes |
|---|
| 1156 | ADD CONSTRAINT fk_node_deployment_status FOREIGN KEY (node_deployment_status) REFERENCES node_deployment_status(node_deployment_status) ON UPDATE CASCADE ON DELETE RESTRICT; |
|---|
| 1157 | |
|---|
| 1158 | |
|---|
| 1159 | -- |
|---|
| 1160 | -- Name: fk_nodes; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1161 | -- |
|---|
| 1162 | |
|---|
| 1163 | ALTER TABLE ONLY connections |
|---|
| 1164 | ADD CONSTRAINT fk_nodes FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1165 | |
|---|
| 1166 | |
|---|
| 1167 | -- |
|---|
| 1168 | -- Name: fk_users; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1169 | -- |
|---|
| 1170 | |
|---|
| 1171 | ALTER TABLE ONLY connections |
|---|
| 1172 | ADD CONSTRAINT fk_users FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1173 | |
|---|
| 1174 | |
|---|
| 1175 | -- |
|---|
| 1176 | -- Name: fk_users; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1177 | -- |
|---|
| 1178 | |
|---|
| 1179 | ALTER TABLE ONLY node_stakeholders |
|---|
| 1180 | ADD CONSTRAINT fk_users FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1181 | |
|---|
| 1182 | |
|---|
| 1183 | -- |
|---|
| 1184 | -- Name: fk_users; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1185 | -- |
|---|
| 1186 | |
|---|
| 1187 | ALTER TABLE ONLY network_stakeholders |
|---|
| 1188 | ADD CONSTRAINT fk_users FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1189 | |
|---|
| 1190 | |
|---|
| 1191 | -- |
|---|
| 1192 | -- Name: fk_venue_types; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1193 | -- |
|---|
| 1194 | |
|---|
| 1195 | ALTER TABLE ONLY nodes |
|---|
| 1196 | ADD CONSTRAINT fk_venue_types FOREIGN KEY (venue_type) REFERENCES venue_types(venue_type) ON UPDATE CASCADE ON DELETE RESTRICT; |
|---|
| 1197 | |
|---|
| 1198 | |
|---|
| 1199 | -- |
|---|
| 1200 | -- Name: flickr_photostream_content_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1201 | -- |
|---|
| 1202 | |
|---|
| 1203 | ALTER TABLE ONLY content_flickr_photostream |
|---|
| 1204 | ADD CONSTRAINT flickr_photostream_content_fkey FOREIGN KEY (flickr_photostream_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1205 | |
|---|
| 1206 | |
|---|
| 1207 | -- |
|---|
| 1208 | -- Name: network_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1209 | -- |
|---|
| 1210 | |
|---|
| 1211 | ALTER TABLE ONLY network_has_content |
|---|
| 1212 | ADD CONSTRAINT network_id_fkey FOREIGN KEY (network_id) REFERENCES networks(network_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1213 | |
|---|
| 1214 | |
|---|
| 1215 | -- |
|---|
| 1216 | -- Name: network_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1217 | -- |
|---|
| 1218 | |
|---|
| 1219 | ALTER TABLE ONLY nodes |
|---|
| 1220 | ADD CONSTRAINT network_id_fkey FOREIGN KEY (network_id) REFERENCES networks(network_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1221 | |
|---|
| 1222 | |
|---|
| 1223 | -- |
|---|
| 1224 | -- Name: nodes_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog |
|---|
| 1225 | -- |
|---|
| 1226 | |
|---|
| 1227 | ALTER TABLE ONLY node_stakeholders |
|---|
| 1228 | ADD CONSTRAINT nodes_fkey FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|---|
| 1229 | |
|---|
| 1230 | |
|---|
| 1231 | -- |
|---|
| 1232 | -- PostgreSQL database dump complete |
|---|
| 1233 | -- |
|---|
| 1234 | |
|---|