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