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