Parent Directory
|
Revision Log
|
Revision Graph
Add introduced column to bills
| 1 | <?php |
| 2 | // $Id: legislature.install,v 1.32 2009/10/29 21:22:17 drumm Exp $ |
| 3 | |
| 4 | function legislature_install() { |
| 5 | drupal_install_schema('legislature'); |
| 6 | } |
| 7 | |
| 8 | function legislature_uninstall() { |
| 9 | drupal_uninstall_schema('legislature'); |
| 10 | } |
| 11 | |
| 12 | function legislature_schema() { |
| 13 | return array( |
| 14 | 'legislature_action' => array( |
| 15 | 'fields' => array( |
| 16 | 'action_id' => array( |
| 17 | 'type' => 'serial', |
| 18 | 'unsigned' => TRUE, |
| 19 | 'not null' => TRUE, |
| 20 | ), |
| 21 | 'bill_id' => array( |
| 22 | 'type' => 'int', |
| 23 | 'not null' => TRUE, |
| 24 | ), |
| 25 | 'amendment_id' => array( |
| 26 | 'type' => 'int', |
| 27 | 'unsigned' => TRUE, |
| 28 | 'not null' => TRUE, |
| 29 | ), |
| 30 | 'type' => array( |
| 31 | 'type' => 'varchar', |
| 32 | 'length' => 50, |
| 33 | 'not null' => TRUE, |
| 34 | ), |
| 35 | 'description' => array( |
| 36 | 'type' => 'varchar', |
| 37 | 'length' => 50, |
| 38 | 'not null' => TRUE, |
| 39 | ), |
| 40 | 'topic' => array( |
| 41 | 'type' => 'varchar', |
| 42 | 'length' => 50, |
| 43 | 'not null' => TRUE, |
| 44 | ), |
| 45 | 'author' => array( |
| 46 | 'type' => 'varchar', |
| 47 | 'length' => 255, |
| 48 | 'not null' => TRUE, |
| 49 | ), |
| 50 | 'coauthor' => array( |
| 51 | 'type' => 'varchar', |
| 52 | 'length' => 255, |
| 53 | 'not null' => TRUE, |
| 54 | ), |
| 55 | 'date' => array( |
| 56 | 'type' => 'int', |
| 57 | 'not null' => TRUE, |
| 58 | ), |
| 59 | 'motion' => array( |
| 60 | 'type' => 'text', |
| 61 | 'not null' => TRUE, |
| 62 | ), |
| 63 | 'location' => array( |
| 64 | 'type' => 'varchar', |
| 65 | 'length' => 100, |
| 66 | 'not null' => TRUE, |
| 67 | ), |
| 68 | 'ayes' => array( |
| 69 | 'type' => 'varchar', |
| 70 | 'length' => 5, |
| 71 | 'not null' => TRUE, |
| 72 | ), |
| 73 | 'noes' => array( |
| 74 | 'type' => 'varchar', |
| 75 | 'length' => 5, |
| 76 | 'not null' => TRUE, |
| 77 | ), |
| 78 | 'outcome' => array( |
| 79 | 'type' => 'varchar', |
| 80 | 'length' => 10, |
| 81 | 'not null' => TRUE, |
| 82 | ), |
| 83 | 'is_vote' => array( |
| 84 | 'type' => 'int', |
| 85 | 'size' => 'tiny', |
| 86 | 'not null' => TRUE, |
| 87 | ), |
| 88 | 'is_substantive' => array( |
| 89 | 'type' => 'int', |
| 90 | 'size' => 'tiny', |
| 91 | 'not null' => TRUE, |
| 92 | ), |
| 93 | 'document' => array( |
| 94 | 'type' => 'text', |
| 95 | 'size' => 'medium', |
| 96 | 'not null' => TRUE, |
| 97 | ), |
| 98 | 'date_int' => array( |
| 99 | 'type' => 'int', |
| 100 | 'not null' => TRUE, |
| 101 | ), |
| 102 | 'vote_roll' => array( |
| 103 | 'type' => 'int', |
| 104 | 'not null' => TRUE, |
| 105 | ), |
| 106 | 'weight' => array( |
| 107 | 'type' => 'int', |
| 108 | 'size' => 'small', |
| 109 | 'not null' => TRUE, |
| 110 | ), |
| 111 | 'required' => array( |
| 112 | 'type' => 'varchar', |
| 113 | 'length' => 3, |
| 114 | 'not null' => TRUE, |
| 115 | ), |
| 116 | ), |
| 117 | 'primary key' => array('action_id'), |
| 118 | 'indexes' => array( |
| 119 | 'bill_id' => array('bill_id'), |
| 120 | 'is_vote' => array('is_vote'), |
| 121 | 'date' => array('date'), |
| 122 | ), |
| 123 | ), |
| 124 | |
| 125 | 'legislature_action_politician' => array( |
| 126 | 'fields' => array( |
| 127 | 'politician_id' => array( |
| 128 | 'type' => 'int', |
| 129 | 'not null' => TRUE, |
| 130 | ), |
| 131 | 'action_id' => array( |
| 132 | 'type' => 'int', |
| 133 | 'not null' => TRUE, |
| 134 | ), |
| 135 | 'vote' => array( |
| 136 | 'type' => 'varchar', |
| 137 | 'length' => 5, |
| 138 | 'not null' => TRUE, |
| 139 | ), |
| 140 | ), |
| 141 | 'indexes' => array( |
| 142 | 'politician_id_action_id' => array('politician_id', 'action_id'), |
| 143 | 'action_id' => array('action_id'), |
| 144 | 'vote' => array('vote'), |
| 145 | ), |
| 146 | ), |
| 147 | |
| 148 | 'legislature_bill' => array( |
| 149 | 'fields' => array( |
| 150 | 'bill_id' => array( |
| 151 | 'type' => 'serial', |
| 152 | 'unsigned' => TRUE, |
| 153 | 'not null' => TRUE, |
| 154 | ), |
| 155 | 'measure' => array( |
| 156 | 'type' => 'varchar', |
| 157 | 'length' => 20, |
| 158 | 'not null' => TRUE, |
| 159 | ), |
| 160 | 'session_id' => array( |
| 161 | 'type' => 'int', |
| 162 | 'not null' => TRUE, |
| 163 | ), |
| 164 | 'prefix' => array( |
| 165 | 'type' => 'varchar', |
| 166 | 'length' => 10, |
| 167 | 'not null' => TRUE, |
| 168 | ), |
| 169 | 'topic' => array( |
| 170 | 'type' => 'varchar', |
| 171 | 'length' => 255, |
| 172 | 'not null' => TRUE, |
| 173 | ), |
| 174 | 'description' => array( |
| 175 | 'type' => 'text', |
| 176 | 'not null' => TRUE, |
| 177 | ), |
| 178 | 'status' => array( |
| 179 | 'type' => 'varchar', |
| 180 | 'length' => 20, |
| 181 | 'not null' => TRUE, |
| 182 | ), |
| 183 | 'last_version' => array( |
| 184 | 'type' => 'varchar', |
| 185 | 'length' => 32, |
| 186 | 'not null' => TRUE, |
| 187 | ), |
| 188 | 'introduced' => array( |
| 189 | 'type' => 'int', |
| 190 | 'not null' => TRUE, |
| 191 | ), |
| 192 | ), |
| 193 | 'primary key' => array('bill_id'), |
| 194 | 'indexes' => array( |
| 195 | 'measure' => array('measure'), |
| 196 | 'prefix' => array('prefix'), |
| 197 | ), |
| 198 | ), |
| 199 | |
| 200 | 'legislature_bill_committee' => array( |
| 201 | 'fields' => array( |
| 202 | 'bill_id' => array( |
| 203 | 'type' => 'int', |
| 204 | 'not null' => TRUE, |
| 205 | ), |
| 206 | 'committee_id' => array( |
| 207 | 'type' => 'int', |
| 208 | 'not null' => TRUE, |
| 209 | ), |
| 210 | 'activity' => array( |
| 211 | 'type' => 'varchar', |
| 212 | 'length' => 255, |
| 213 | 'not null' => TRUE, |
| 214 | ), |
| 215 | 'activity_date' => array( |
| 216 | 'type' => 'int', |
| 217 | 'unsigned' => TRUE, |
| 218 | 'size' => 'normal', |
| 219 | 'not null' => TRUE, |
| 220 | ), |
| 221 | ), |
| 222 | 'indexes' => array( |
| 223 | 'bill_id' => array('bill_id'), |
| 224 | 'committee_id' => array('committee_id'), |
| 225 | ), |
| 226 | ), |
| 227 | |
| 228 | 'legislature_bill_sponsor' => array( |
| 229 | 'fields' => array( |
| 230 | 'bill_id' => array( |
| 231 | 'type' => 'int', |
| 232 | 'not null' => TRUE, |
| 233 | ), |
| 234 | 'politician_id' => array( |
| 235 | 'type' => 'int', |
| 236 | 'not null' => TRUE, |
| 237 | ), |
| 238 | 'type' => array( |
| 239 | 'type' => 'int', |
| 240 | 'size' => 'tiny', |
| 241 | 'not null' => TRUE, |
| 242 | ), |
| 243 | ), |
| 244 | 'indexes' => array( |
| 245 | 'bill_id' => array('bill_id'), |
| 246 | 'politician_id' => array('politician_id'), |
| 247 | ), |
| 248 | ), |
| 249 | |
| 250 | 'legislature_bill_title' => array( |
| 251 | 'fields' => array( |
| 252 | 'bill_id' => array( |
| 253 | 'type' => 'int', |
| 254 | 'not null' => TRUE, |
| 255 | ), |
| 256 | 'title' => array( |
| 257 | 'type' => 'text', |
| 258 | 'not null' => TRUE, |
| 259 | ), |
| 260 | 'type' => array( |
| 261 | 'type' => 'varchar', |
| 262 | 'length' => 10, |
| 263 | 'not null' => TRUE, |
| 264 | ), |
| 265 | 'status_as' => array( |
| 266 | 'type' => 'varchar', |
| 267 | 'length' => 40, |
| 268 | 'not null' => TRUE, |
| 269 | ), |
| 270 | ), |
| 271 | 'indexes' => array( |
| 272 | 'bill_id' => array('bill_id'), |
| 273 | ), |
| 274 | ), |
| 275 | |
| 276 | 'legislature_committee' => array( |
| 277 | 'fields' => array( |
| 278 | 'committee_id' => array( |
| 279 | 'type' => 'serial', |
| 280 | 'unsigned' => TRUE, |
| 281 | 'not null' => TRUE, |
| 282 | ), |
| 283 | 'session_id' => array( |
| 284 | 'type' => 'int', |
| 285 | 'not null' => TRUE, |
| 286 | ), |
| 287 | 'office_id' => array( |
| 288 | 'type' => 'int', |
| 289 | 'not null' => TRUE, |
| 290 | ), |
| 291 | 'name' => array( |
| 292 | 'type' => 'varchar', |
| 293 | 'length' => 255, |
| 294 | 'not null' => TRUE, |
| 295 | ), |
| 296 | 'url' => array( |
| 297 | 'type' => 'varchar', |
| 298 | 'length' => 255, |
| 299 | 'not null' => TRUE, |
| 300 | ), |
| 301 | ), |
| 302 | 'primary key' => array('committee_id'), |
| 303 | ), |
| 304 | |
| 305 | 'legislature_committee_membership' => array( |
| 306 | 'fields' => array( |
| 307 | 'politician_id' => array( |
| 308 | 'type' => 'int', |
| 309 | 'not null' => TRUE, |
| 310 | ), |
| 311 | 'committee_id' => array( |
| 312 | 'type' => 'int', |
| 313 | 'not null' => TRUE, |
| 314 | ), |
| 315 | 'position' => array( |
| 316 | 'type' => 'varchar', |
| 317 | 'length' => 255, |
| 318 | 'not null' => TRUE, |
| 319 | ), |
| 320 | ), |
| 321 | 'primary key' => array('politician_id', 'committee_id'), |
| 322 | ), |
| 323 | |
| 324 | 'legislature_committee_name' => array( |
| 325 | 'fields' => array( |
| 326 | 'committee_id' => array( |
| 327 | 'type' => 'int', |
| 328 | 'not null' => TRUE, |
| 329 | ), |
| 330 | 'session_id' => array( |
| 331 | 'type' => 'int', |
| 332 | 'not null' => TRUE, |
| 333 | ), |
| 334 | 'name' => array( |
| 335 | 'type' => 'varchar', |
| 336 | 'length' => 255, |
| 337 | 'not null' => TRUE, |
| 338 | ), |
| 339 | ), |
| 340 | 'primary key' => array('committee_id', 'session_id'), |
| 341 | 'indexes' => array( |
| 342 | 'name' => array('name'), |
| 343 | ), |
| 344 | ), |
| 345 | |
| 346 | 'legislature_district' => array( |
| 347 | 'fields' => array( |
| 348 | 'district_id' => array( |
| 349 | 'type' => 'serial', |
| 350 | 'unsigned' => TRUE, |
| 351 | 'not null' => TRUE, |
| 352 | ), |
| 353 | 'jurisdiction' => array( |
| 354 | 'type' => 'varchar', |
| 355 | 'length' => 10, |
| 356 | 'not null' => TRUE, |
| 357 | ), |
| 358 | 'name' => array( |
| 359 | 'type' => 'varchar', |
| 360 | 'length' => 255, |
| 361 | 'not null' => TRUE, |
| 362 | ), |
| 363 | 'office' => array( |
| 364 | 'type' => 'varchar', |
| 365 | 'length' => 30, |
| 366 | 'not null' => TRUE, |
| 367 | ), |
| 368 | 'number' => array( |
| 369 | 'type' => 'varchar', |
| 370 | 'length' => 30, |
| 371 | 'not null' => TRUE, |
| 372 | ), |
| 373 | 'city' => array( |
| 374 | 'type' => 'varchar', |
| 375 | 'length' => 255, |
| 376 | 'not null' => TRUE, |
| 377 | ), |
| 378 | 'state' => array( |
| 379 | 'type' => 'char', |
| 380 | 'length' => 2, |
| 381 | 'not null' => TRUE, |
| 382 | ), |
| 383 | 'name_display' => array( |
| 384 | 'type' => 'varchar', |
| 385 | 'length' => 255, |
| 386 | 'not null' => TRUE, |
| 387 | ), |
| 388 | ), |
| 389 | 'primary key' => array('district_id'), |
| 390 | 'indexes' => array( |
| 391 | 'jurisdiction' => array('jurisdiction'), |
| 392 | ), |
| 393 | ), |
| 394 | |
| 395 | 'legislature_elected_job' => array( |
| 396 | 'fields' => array( |
| 397 | 'elected_job_id' => array( |
| 398 | 'type' => 'serial', |
| 399 | 'unsigned' => TRUE, |
| 400 | 'not null' => TRUE, |
| 401 | ), |
| 402 | 'politician_id' => array( |
| 403 | 'type' => 'int', |
| 404 | 'not null' => TRUE, |
| 405 | ), |
| 406 | 'office_id' => array( |
| 407 | 'type' => 'int', |
| 408 | 'not null' => TRUE, |
| 409 | ), |
| 410 | 'district_id' => array( |
| 411 | 'type' => 'int', |
| 412 | 'not null' => TRUE, |
| 413 | ), |
| 414 | 'start' => array( |
| 415 | 'type' => 'int', |
| 416 | 'not null' => TRUE, |
| 417 | ), |
| 418 | 'end' => array( |
| 419 | 'type' => 'int', |
| 420 | 'not null' => TRUE, |
| 421 | ), |
| 422 | 'is_most_recent' => array( |
| 423 | 'type' => 'int', |
| 424 | 'size' => 'tiny', |
| 425 | 'not null' => TRUE, |
| 426 | ), |
| 427 | 'is_candidate' => array( |
| 428 | 'type' => 'int', |
| 429 | 'size' => 'tiny', |
| 430 | 'not null' => TRUE, |
| 431 | ), |
| 432 | ), |
| 433 | 'primary key' => array('elected_job_id'), |
| 434 | 'indexes' => array( |
| 435 | 'politician_id' => array('politician_id'), |
| 436 | 'is_most_recent' => array('is_most_recent'), |
| 437 | 'is_candidate' => array('is_candidate'), |
| 438 | ), |
| 439 | ), |
| 440 | |
| 441 | 'legislature_elected_job_session' => array( |
| 442 | 'fields' => array( |
| 443 | 'elected_job_id' => array( |
| 444 | 'type' => 'int', |
| 445 | 'not null' => TRUE, |
| 446 | ), |
| 447 | 'session_id' => array( |
| 448 | 'type' => 'int', |
| 449 | 'not null' => TRUE, |
| 450 | ), |
| 451 | ), |
| 452 | 'indexes' => array( |
| 453 | 'elected_job_id' => array('elected_job_id'), |
| 454 | 'session_id' => array('session_id'), |
| 455 | ), |
| 456 | ), |
| 457 | |
| 458 | 'legislature_office' => array( |
| 459 | 'fields' => array( |
| 460 | 'office_id' => array( |
| 461 | 'type' => 'serial', |
| 462 | 'unsigned' => TRUE, |
| 463 | 'not null' => TRUE, |
| 464 | ), |
| 465 | 'jurisdiction' => array( |
| 466 | 'type' => 'varchar', |
| 467 | 'length' => 50, |
| 468 | 'not null' => TRUE, |
| 469 | ), |
| 470 | 'title' => array( |
| 471 | 'type' => 'varchar', |
| 472 | 'length' => 50, |
| 473 | 'not null' => TRUE, |
| 474 | ), |
| 475 | 'length' => array( |
| 476 | 'type' => 'int', |
| 477 | 'size' => 'tiny', |
| 478 | 'unsigned' => TRUE, |
| 479 | 'not null' => TRUE, |
| 480 | ), |
| 481 | 'count_limit' => array( |
| 482 | 'type' => 'int', |
| 483 | 'size' => 'tiny', |
| 484 | 'unsigned' => TRUE, |
| 485 | 'not null' => TRUE, |
| 486 | ), |
| 487 | ), |
| 488 | 'primary key' => array('office_id'), |
| 489 | ), |
| 490 | |
| 491 | 'legislature_politician' => array( |
| 492 | 'fields' => array( |
| 493 | 'politician_id' => array( |
| 494 | 'type' => 'serial', |
| 495 | 'unsigned' => TRUE, |
| 496 | 'not null' => TRUE, |
| 497 | ), |
| 498 | 'last_name' => array( |
| 499 | 'type' => 'varchar', |
| 500 | 'length' => 50, |
| 501 | 'not null' => TRUE, |
| 502 | ), |
| 503 | 'full_name' => array( |
| 504 | 'type' => 'varchar', |
| 505 | 'length' => 255, |
| 506 | 'not null' => TRUE, |
| 507 | ), |
| 508 | 'roster_name' => array( |
| 509 | 'type' => 'varchar', |
| 510 | 'length' => 255, |
| 511 | 'not null' => TRUE, |
| 512 | ), |
| 513 | 'middle_name' => array( |
| 514 | 'type' => 'varchar', |
| 515 | 'length' => 255, |
| 516 | 'not null' => TRUE, |
| 517 | ), |
| 518 | 'nick_name' => array( |
| 519 | 'type' => 'varchar', |
| 520 | 'length' => 255, |
| 521 | 'not null' => TRUE, |
| 522 | ), |
| 523 | 'first_name' => array( |
| 524 | 'type' => 'varchar', |
| 525 | 'length' => 255, |
| 526 | 'not null' => TRUE, |
| 527 | ), |
| 528 | 'name_modifier' => array( |
| 529 | 'type' => 'varchar', |
| 530 | 'length' => 255, |
| 531 | 'not null' => TRUE, |
| 532 | ), |
| 533 | 'imsp_name' => array( |
| 534 | 'type' => 'varchar', |
| 535 | 'length' => 50, |
| 536 | 'not null' => TRUE, |
| 537 | ), |
| 538 | 'phone' => array( |
| 539 | 'type' => 'varchar', |
| 540 | 'length' => 20, |
| 541 | 'not null' => TRUE, |
| 542 | ), |
| 543 | 'fax' => array( |
| 544 | 'type' => 'varchar', |
| 545 | 'length' => 20, |
| 546 | 'not null' => TRUE, |
| 547 | ), |
| 548 | 'email' => array( |
| 549 | 'type' => 'varchar', |
| 550 | 'length' => 50, |
| 551 | 'not null' => TRUE, |
| 552 | ), |
| 553 | 'party' => array( |
| 554 | 'type' => 'varchar', |
| 555 | 'length' => 50, |
| 556 | 'not null' => TRUE, |
| 557 | ), |
| 558 | 'gender' => array( |
| 559 | 'type' => 'varchar', |
| 560 | 'length' => 10, |
| 561 | 'not null' => TRUE, |
| 562 | ), |
| 563 | 'govtrack_id' => array( |
| 564 | 'type' => 'int', |
| 565 | 'not null' => TRUE, |
| 566 | ), |
| 567 | 'crp_id' => array( |
| 568 | 'type' => 'varchar', |
| 569 | 'length' => 20, |
| 570 | 'not null' => TRUE, |
| 571 | ), |
| 572 | 'legis_id' => array( |
| 573 | 'type' => 'int', |
| 574 | 'not null' => TRUE, |
| 575 | ), |
| 576 | 'congresspedia_url' => array( |
| 577 | 'type' => 'text', |
| 578 | 'not null' => TRUE, |
| 579 | ), |
| 580 | 'fec_id' => array( |
| 581 | 'type' => 'char', |
| 582 | 'length' => 9, |
| 583 | 'not null' => TRUE, |
| 584 | ), |
| 585 | 'bioguide_id' => array( |
| 586 | 'type' => 'char', |
| 587 | 'length' => 7, |
| 588 | 'not null' => TRUE, |
| 589 | ), |
| 590 | ), |
| 591 | 'primary key' => array('politician_id'), |
| 592 | ), |
| 593 | |
| 594 | 'legislature_session' => array( |
| 595 | 'description' => 'A list of supported jurisdictions and sessions.', |
| 596 | 'fields' => array( |
| 597 | 'session_id' => array( |
| 598 | 'type' => 'serial', |
| 599 | 'unsigned' => TRUE, |
| 600 | 'not null' => TRUE, |
| 601 | ), |
| 602 | 'session_name' => array( |
| 603 | 'description' => 'Either the session number, like 111 for 111th U.S. Congress, or starting year of the legislative session.', |
| 604 | 'type' => 'varchar', |
| 605 | 'length' => 10, |
| 606 | 'not null' => TRUE, |
| 607 | ), |
| 608 | 'session_jurisdiction' => array( |
| 609 | 'description' => 'Abbreviation for the jurisdiction, such as "us" for U.S. Congress and "ia" for Iowa State Legislature.', |
| 610 | 'type' => 'varchar', |
| 611 | 'length' => 10, |
| 612 | 'not null' => TRUE, |
| 613 | ), |
| 614 | 'enabled' => array( |
| 615 | 'type' => 'int', |
| 616 | 'size' => 'tiny', |
| 617 | 'not null' => TRUE, |
| 618 | ), |
| 619 | ), |
| 620 | 'primary key' => array('session_id'), |
| 621 | 'indexes' => array( |
| 622 | 'enabled' => array('enabled'), |
| 623 | ), |
| 624 | ), |
| 625 | |
| 626 | 'legislature_amendment' => array( |
| 627 | 'fields' => array( |
| 628 | 'amendment_id' => array( |
| 629 | 'type' => 'serial', |
| 630 | 'unsigned' => TRUE, |
| 631 | 'not null' => TRUE, |
| 632 | ), |
| 633 | 'bill_id' => array( |
| 634 | 'type' => 'int', |
| 635 | 'not null' => TRUE, |
| 636 | ), |
| 637 | 'sponsor_politician_id' => array( |
| 638 | 'type' => 'int', |
| 639 | 'not null' => TRUE, |
| 640 | ), |
| 641 | 'location' => array( |
| 642 | 'type' => 'char', |
| 643 | 'length' => 1, |
| 644 | 'not null' => TRUE, |
| 645 | ), |
| 646 | 'number' => array( |
| 647 | 'type' => 'int', |
| 648 | 'not null' => TRUE, |
| 649 | ), |
| 650 | 'date' => array( |
| 651 | 'type' => 'int', |
| 652 | 'not null' => TRUE, |
| 653 | ), |
| 654 | 'sequence' => array( |
| 655 | 'type' => 'int', |
| 656 | 'size' => 'tiny', |
| 657 | 'not null' => TRUE, |
| 658 | ), |
| 659 | 'description' => array( |
| 660 | 'type' => 'text', |
| 661 | 'not null' => TRUE, |
| 662 | ), |
| 663 | 'purpose' => array( |
| 664 | 'type' => 'text', |
| 665 | 'not null' => TRUE, |
| 666 | ), |
| 667 | 'full_text' => array( |
| 668 | 'type' => 'text', |
| 669 | 'size' => 'medium', |
| 670 | 'not null' => TRUE, |
| 671 | ), |
| 672 | ), |
| 673 | 'primary key' => array('amendment_id'), |
| 674 | 'indexes' => array( |
| 675 | 'bill_id' => array('bill_id'), |
| 676 | 'sponsor_politician_id' => array('sponsor_politician_id'), |
| 677 | 'location' => array('location'), |
| 678 | 'number' => array('number'), |
| 679 | ), |
| 680 | ), |
| 681 | |
| 682 | 'legislature_bill_relation' => array( |
| 683 | 'description' => 'Related bills.', |
| 684 | 'fields' => array( |
| 685 | 'bill_relation_id' => array( |
| 686 | 'description' => 'Primary Key: Unique bill relation ID.', |
| 687 | 'type' => 'serial', |
| 688 | 'not null' => TRUE, |
| 689 | ), |
| 690 | 'bill_id' => array( |
| 691 | 'type' => 'int', |
| 692 | 'unsigned' => TRUE, |
| 693 | 'not null' => TRUE, |
| 694 | ), |
| 695 | 'relation' => array( |
| 696 | 'type' => 'varchar', |
| 697 | 'length' => 20, |
| 698 | 'not null' => TRUE, |
| 699 | ), |
| 700 | 'session' => array( |
| 701 | 'type' => 'int', |
| 702 | 'not null' => TRUE, |
| 703 | ), |
| 704 | 'type' => array( |
| 705 | 'type' => 'varchar', |
| 706 | 'length' => 20, |
| 707 | 'not null' => TRUE, |
| 708 | ), |
| 709 | 'number' => array( |
| 710 | 'type' => 'int', |
| 711 | 'not null' => TRUE, |
| 712 | ), |
| 713 | 'related_bill_id' => array( |
| 714 | 'type' => 'int', |
| 715 | 'unsigned' => TRUE, |
| 716 | 'not null' => TRUE, |
| 717 | ), |
| 718 | ), |
| 719 | 'primary key' => array('bill_relation_id'), |
| 720 | ), |
| 721 | |
| 722 | 'legislature_bill_subject' => array( |
| 723 | 'description' => 'Subject terms.', |
| 724 | 'fields' => array( |
| 725 | 'bill_id' => array( |
| 726 | 'type' => 'int', |
| 727 | 'unsigned' => TRUE, |
| 728 | 'not null' => TRUE, |
| 729 | ), |
| 730 | 'subject' => array( |
| 731 | 'type' => 'varchar', |
| 732 | 'length' => 100, |
| 733 | 'not null' => TRUE, |
| 734 | ), |
| 735 | ), |
| 736 | ), |
| 737 | |
| 738 | 'legislature_ca_law_section' => array( |
| 739 | 'fields' => array( |
| 740 | 'id' => array( |
| 741 | 'type' => 'varchar', |
| 742 | 'length' => '100', |
| 743 | 'not null' => FALSE, |
| 744 | ), |
| 745 | 'law_code' => array( |
| 746 | 'type' => 'varchar', |
| 747 | 'length' => '5', |
| 748 | 'not null' => FALSE, |
| 749 | ), |
| 750 | 'section_num' => array( |
| 751 | 'type' => 'varchar', |
| 752 | 'length' => '30', |
| 753 | 'not null' => FALSE, |
| 754 | ), |
| 755 | 'op_statues' => array( |
| 756 | 'type' => 'varchar', |
| 757 | 'length' => '10', |
| 758 | 'not null' => FALSE, |
| 759 | ), |
| 760 | 'op_chapter' => array( |
| 761 | 'type' => 'varchar', |
| 762 | 'length' => '10', |
| 763 | 'not null' => FALSE, |
| 764 | ), |
| 765 | 'op_section' => array( |
| 766 | 'type' => 'varchar', |
| 767 | 'length' => '20', |
| 768 | 'not null' => FALSE, |
| 769 | ), |
| 770 | 'effective_date' => array( |
| 771 | 'type' => 'datetime', |
| 772 | 'not null' => FALSE, |
| 773 | ), |
| 774 | 'law_section_version_id' => array( |
| 775 | 'type' => 'varchar', |
| 776 | 'length' => '100', |
| 777 | 'not null' => FALSE, |
| 778 | ), |
| 779 | 'division' => array( |
| 780 | 'type' => 'varchar', |
| 781 | 'length' => '100', |
| 782 | 'not null' => FALSE, |
| 783 | ), |
| 784 | 'title' => array( |
| 785 | 'type' => 'varchar', |
| 786 | 'length' => '100', |
| 787 | 'not null' => FALSE, |
| 788 | ), |
| 789 | 'part' => array( |
| 790 | 'type' => 'varchar', |
| 791 | 'length' => '100', |
| 792 | 'not null' => FALSE, |
| 793 | ), |
| 794 | 'chapter' => array( |
| 795 | 'type' => 'varchar', |
| 796 | 'length' => '100', |
| 797 | 'not null' => FALSE, |
| 798 | ), |
| 799 | 'article' => array( |
| 800 | 'type' => 'varchar', |
| 801 | 'length' => '100', |
| 802 | 'not null' => FALSE, |
| 803 | ), |
| 804 | 'history' => array( |
| 805 | 'type' => 'varchar', |
| 806 | 'length' => '1000', |
| 807 | 'not null' => FALSE, |
| 808 | ), |
| 809 | 'content_xml' => array( |
| 810 | 'type' => 'text', |
| 811 | 'size' => 'big', |
| 812 | 'not null' => FALSE, |
| 813 | ), |
| 814 | 'active_flg' => array( |
| 815 | 'type' => 'varchar', |
| 816 | 'length' => '1', |
| 817 | 'not null' => FALSE, |
| 818 | 'default' => 'Y', |
| 819 | ), |
| 820 | 'trans_uid' => array( |
| 821 | 'type' => 'varchar', |
| 822 | 'length' => '30', |
| 823 | 'not null' => FALSE, |
| 824 | ), |
| 825 | 'trans_update' => array( |
| 826 | 'type' => 'datetime', |
| 827 | 'not null' => FALSE, |
| 828 | ), |
| 829 | ), |
| 830 | 'unique keys' => array( |
| 831 | 'law_section_id_idx' => array('law_section_version_id') |
| 832 | ), |
| 833 | 'indexes' => array( |
| 834 | 'law_section_code_idx' => array('law_code'), |
| 835 | 'law_section_pk' => array('id'), |
| 836 | 'law_section_sect_idx' => array('section_num'), |
| 837 | ), |
| 838 | ), |
| 839 | |
| 840 | 'legislature_ca_daily_file' => array( |
| 841 | 'fields' => array( |
| 842 | 'bill_id' => array( |
| 843 | 'type' => 'varchar', |
| 844 | 'length' => '20', |
| 845 | 'not null' => FALSE, |
| 846 | ), |
| 847 | 'location_code' => array( |
| 848 | 'type' => 'varchar', |
| 849 | 'length' => '6', |
| 850 | 'not null' => FALSE, |
| 851 | ), |
| 852 | 'consent_calendar_code' => array( |
| 853 | 'type' => 'int', |
| 854 | 'not null' => FALSE, |
| 855 | ), |
| 856 | 'file_location' => array( |
| 857 | 'type' => 'varchar', |
| 858 | 'length' => '6', |
| 859 | 'not null' => FALSE, |
| 860 | ), |
| 861 | 'publication_date' => array( |
| 862 | 'type' => 'datetime', |
| 863 | 'not null' => FALSE, |
| 864 | ), |
| 865 | ), |
| 866 | 'indexes' => array( |
| 867 | 'daily_file_bill_id_idx' => array('bill_id'), |
| 868 | ), |
| 869 | ), |
| 870 | |
| 871 | 'legislature_ca_law_toc' => array( |
| 872 | 'fields' => array( |
| 873 | 'law_code' => array( |
| 874 | 'type' => 'varchar', |
| 875 | 'length' => '5', |
| 876 | 'not null' => FALSE, |
| 877 | ), |
| 878 | 'division' => array( |
| 879 | 'type' => 'varchar', |
| 880 | 'length' => '100', |
| 881 | 'not null' => FALSE, |
| 882 | ), |
| 883 | 'title' => array( |
| 884 | 'type' => 'varchar', |
| 885 | 'length' => '100', |
| 886 | 'not null' => FALSE, |
| 887 | ), |
| 888 | 'part' => array( |
| 889 | 'type' => 'varchar', |
| 890 | 'length' => '100', |
| 891 | 'not null' => FALSE, |
| 892 | ), |
| 893 | 'chapter' => array( |
| 894 | 'type' => 'varchar', |
| 895 | 'length' => '100', |
| 896 | 'not null' => FALSE, |
| 897 | ), |
| 898 | 'article' => array( |
| 899 | 'type' => 'varchar', |
| 900 | 'length' => '100', |
| 901 | 'not null' => FALSE, |
| 902 | ), |
| 903 | 'heading' => array( |
| 904 | 'type' => 'varchar', |
| 905 | 'length' => '2000', |
| 906 | 'not null' => FALSE, |
| 907 | ), |
| 908 | 'active_flg' => array( |
| 909 | 'type' => 'varchar', |
| 910 | 'length' => '1', |
| 911 | 'not null' => FALSE, |
| 912 | 'default' => 'Y', |
| 913 | ), |
| 914 | 'trans_uid' => array( |
| 915 | 'type' => 'varchar', |
| 916 | 'length' => '30', |
| 917 | 'not null' => FALSE, |
| 918 | ), |
| 919 | 'trans_update' => array( |
| 920 | 'type' => 'datetime', |
| 921 | 'not null' => FALSE, |
| 922 | ), |
| 923 | 'node_sequence' => array( |
| 924 | 'type' => 'numeric', |
| 925 | 'not null' => FALSE, |
| 926 | 'precision' => '22', |
| 927 | 'scale' => '0', |
| 928 | ), |
| 929 | 'node_level' => array( |
| 930 | 'type' => 'numeric', |
| 931 | 'not null' => FALSE, |
| 932 | 'precision' => '22', |
| 933 | 'scale' => '0', |
| 934 | ), |
| 935 | 'node_position' => array( |
| 936 | 'type' => 'numeric', |
| 937 | 'not null' => FALSE, |
| 938 | 'precision' => '22', |
| 939 | 'scale' => '0', |
| 940 | ), |
| 941 | 'node_treepath' => array( |
| 942 | 'type' => 'varchar', |
| 943 | 'length' => '100', |
| 944 | 'not null' => FALSE, |
| 945 | ), |
| 946 | 'contains_law_sections' => array( |
| 947 | 'type' => 'varchar', |
| 948 | 'length' => '1', |
| 949 | 'not null' => FALSE, |
| 950 | ), |
| 951 | 'history_note' => array( |
| 952 | 'type' => 'varchar', |
| 953 | 'length' => '350', |
| 954 | 'not null' => FALSE, |
| 955 | ), |
| 956 | 'op_statues' => array( |
| 957 | 'type' => 'varchar', |
| 958 | 'length' => '10', |
| 959 | 'not null' => FALSE, |
| 960 | ), |
| 961 | 'op_chapter' => array( |
| 962 | 'type' => 'varchar', |
| 963 | 'length' => '10', |
| 964 | 'not null' => FALSE, |
| 965 | ), |
| 966 | 'op_section' => array( |
| 967 | 'type' => 'varchar', |
| 968 | 'length' => '20', |
| 969 | 'not null' => FALSE, |
| 970 | ), |
| 971 | ), |
| 972 | 'indexes' => array( |
| 973 | 'law_toc_article_idx' => array('article'), |
| 974 | 'law_toc_chapter_idx' => array('chapter'), |
| 975 | 'law_toc_code_idx' => array('law_code'), |
| 976 | 'law_toc_division_idx' => array('division'), |
| 977 | 'law_toc_part_idx' => array('part'), |
| 978 | 'law_toc_title_idx' => array('title'), |
| 979 | ), |
| 980 | ), |
| 981 | |
| 982 | 'legislature_ca_law_toc_sections' => array( |
| 983 | 'fields' => array( |
| 984 | 'id' => array( |
| 985 | 'type' => 'varchar', |
| 986 | 'length' => '100', |
| 987 | 'not null' => FALSE, |
| 988 | ), |
| 989 | 'law_code' => array( |
| 990 | 'type' => 'varchar', |
| 991 | 'length' => '5', |
| 992 | 'not null' => FALSE, |
| 993 | ), |
| 994 | 'node_treepath' => array( |
| 995 | 'type' => 'varchar', |
| 996 | 'length' => '100', |
| 997 | 'not null' => FALSE, |
| 998 | ), |
| 999 | 'section_num' => array( |
| 1000 | 'type' => 'varchar', |
| 1001 | 'length' => '30', |
| 1002 | 'not null' => FALSE, |
| 1003 | ), |
| 1004 | 'section_order' => array( |
| 1005 | 'type' => 'numeric', |
| 1006 | 'not null' => FALSE, |
| 1007 | 'precision' => '22', |
| 1008 | 'scale' => '0', |
| 1009 | ), |
| 1010 | 'title' => array( |
| 1011 | 'type' => 'varchar', |
| 1012 | 'length' => '400', |
| 1013 | 'not null' => FALSE, |
| 1014 | ), |
| 1015 | 'op_statues' => array( |
| 1016 | 'type' => 'varchar', |
| 1017 | 'length' => '10', |
| 1018 | 'not null' => FALSE, |
| 1019 | ), |
| 1020 | 'op_chapter' => array( |
| 1021 | 'type' => 'varchar', |
| 1022 | 'length' => '10', |
| 1023 | 'not null' => FALSE, |
| 1024 | ), |
| 1025 | 'op_section' => array( |
| 1026 | 'type' => 'varchar', |
| 1027 | 'length' => '20', |
| 1028 | 'not null' => FALSE, |
| 1029 | ), |
| 1030 | 'trans_uid' => array( |
| 1031 | 'type' => 'varchar', |
| 1032 | 'length' => '30', |
| 1033 | 'not null' => FALSE, |
| 1034 | ), |
| 1035 | 'trans_update' => array( |
| 1036 | 'type' => 'datetime', |
| 1037 | 'not null' => FALSE, |
| 1038 | ), |
| 1039 | 'law_section_version_id' => array( |
| 1040 | 'type' => 'varchar', |
| 1041 | 'length' => '100', |
| 1042 | 'not null' => FALSE, |
| 1043 | ), |
| 1044 | ), |
| 1045 | 'indexes' => array( |
| 1046 | 'law_toc_sections_node_idx' => array('law_code', 'node_treepath'), |
| 1047 | ), |
| 1048 | ), |
| 1049 | |
| 1050 | 'legislature_ca_location_code' => array( |
| 1051 | 'fields' => array( |
| 1052 | 'session_year' => array( |
| 1053 | 'type' => 'varchar', |
| 1054 | 'length' => '8', |
| 1055 | 'not null' => FALSE, |
| 1056 | ), |
| 1057 | 'location_code' => array( |
| 1058 | 'type' => 'varchar', |
| 1059 | 'length' => '6', |
| 1060 | 'not null' => TRUE, |
| 1061 | ), |
| 1062 | 'location_type' => array( |
| 1063 | 'type' => 'varchar', |
| 1064 | 'length' => '1', |
| 1065 | 'not null' => TRUE, |
| 1066 | ), |
| 1067 | 'consent_calendar_code' => array( |
| 1068 | 'type' => 'varchar', |
| 1069 | 'length' => '2', |
| 1070 | 'not null' => FALSE, |
| 1071 | ), |
| 1072 | 'description' => array( |
| 1073 | 'type' => 'varchar', |
| 1074 | 'length' => '60', |
| 1075 | 'not null' => FALSE, |
| 1076 | ), |
| 1077 | 'long_description' => array( |
| 1078 | 'type' => 'varchar', |
| 1079 | 'length' => '200', |
| 1080 | 'not null' => FALSE, |
| 1081 | ), |
| 1082 | 'active_flg' => array( |
| 1083 | 'type' => 'varchar', |
| 1084 | 'length' => '1', |
| 1085 | 'not null' => FALSE, |
| 1086 | 'default' => 'Y', |
| 1087 | ), |
| 1088 | 'trans_uid' => array( |
| 1089 | 'type' => 'varchar', |
| 1090 | 'length' => '30', |
| 1091 | 'not null' => FALSE, |
| 1092 | ), |
| 1093 | 'trans_update' => array( |
| 1094 | 'type' => 'datetime', |
| 1095 | 'not null' => FALSE, |
| 1096 | ), |
| 1097 | ), |
| 1098 | 'indexes' => array( |
| 1099 | 'localtion_code_session_idx1' => array('session_year'), |
| 1100 | 'location_code_pk1' => array('location_code'), |
| 1101 | ), |
| 1102 | ), |
| 1103 | |
| 1104 | 'legislature_ca_legislator' => array( |
| 1105 | 'fields' => array( |
| 1106 | 'district' => array( |
| 1107 | 'type' => 'varchar', |
| 1108 | 'length' => '5', |
| 1109 | 'not null' => TRUE, |
| 1110 | ), |
| 1111 | 'session_year' => array( |
| 1112 | 'type' => 'varchar', |
| 1113 | 'length' => '8', |
| 1114 | 'not null' => FALSE, |
| 1115 | ), |
| 1116 | 'legislator_name' => array( |
| 1117 | 'type' => 'varchar', |
| 1118 | 'length' => '30', |
| 1119 | 'not null' => FALSE, |
| 1120 | ), |
| 1121 | 'house_type' => array( |
| 1122 | 'type' => 'varchar', |
| 1123 | 'length' => '1', |
| 1124 | 'not null' => FALSE, |
| 1125 | ), |
| 1126 | 'author_name' => array( |
| 1127 | 'type' => 'varchar', |
| 1128 | 'length' => '200', |
| 1129 | 'not null' => FALSE, |
| 1130 | ), |
| 1131 | 'first_name' => array( |
| 1132 | 'type' => 'varchar', |
| 1133 | 'length' => '30', |
| 1134 | 'not null' => FALSE, |
| 1135 | ), |
| 1136 | 'last_name' => array( |
| 1137 | 'type' => 'varchar', |
| 1138 | 'length' => '30', |
| 1139 | 'not null' => FALSE, |
| 1140 | ), |
| 1141 | 'middle_initial' => array( |
| 1142 | 'type' => 'varchar', |
| 1143 | 'length' => '1', |
| 1144 | 'not null' => FALSE, |
| 1145 | ), |
| 1146 | 'name_suffix' => array( |
| 1147 | 'type' => 'varchar', |
| 1148 | 'length' => '12', |
| 1149 | 'not null' => FALSE, |
| 1150 | ), |
| 1151 | 'name_title' => array( |
| 1152 | 'type' => 'varchar', |
| 1153 | 'length' => '34', |
| 1154 | 'not null' => FALSE, |
| 1155 | ), |
| 1156 | 'web_name_title' => array( |
| 1157 | 'type' => 'varchar', |
| 1158 | 'length' => '34', |
| 1159 | 'not null' => FALSE, |
| 1160 | ), |
| 1161 | 'party' => array( |
| 1162 | 'type' => 'varchar', |
| 1163 | 'length' => '4', |
| 1164 | 'not null' => FALSE, |
| 1165 | ), |
| 1166 | 'active_flg' => array( |
| 1167 | 'type' => 'varchar', |
| 1168 | 'length' => '1', |
| 1169 | 'not null' => TRUE, |
| 1170 | ), |
| 1171 | 'trans_uid' => array( |
| 1172 | 'type' => 'varchar', |
| 1173 | 'length' => '30', |
| 1174 | 'not null' => FALSE, |
| 1175 | ), |
| 1176 | 'trans_update' => array( |
| 1177 | 'type' => 'datetime', |
| 1178 |