My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
actAs: &actAs
Timestampable: ~
Blameable: &Blameable
default: null
blameVar: id
listener: BlameableCustomListener
columns:
created:
name: author_id
length: 4
options:
notnull: false
updated:
disabled: true
relations:
created:
class: sfGuardUser
disabled: false
name: Author
# Versionable:
# listener: Doctrine_AuditLog_Listener_Microtime
# actAs:
# Blameable:
# <<: *Blameable

# apply this to the sfDoctrineGuard schema as well
options:
collation: utf8_general_ci
charset: utf8
type: InnoDB

sfGuardGroup:
actAs:
Timestampable: ~

sfGuardPermission:
actAs:
Timestampable: ~

sfGuardGroupPermission:
actAs:
Timestampable: ~

sfGuardUser:
actAs:
Timestampable: ~
SoftDelete: ~
Blameable:
<<: *Blameable

sfGuardUserPermission:
actAs:
Timestampable: ~

sfGuardUserGroup:
actAs:
Timestampable: ~

sfGuardRememberKey:
actAs:
Timestampable: ~

sfGuardUserProfile:
tableName: sf_guard_user_profile
columns:
id:
type: integer(4)
primary: true
autoincrement: true
user_id:
type: integer(4)
notnull: true
email:
type: string(80)
fullname:
type: string(80)
validate:
type: string(17)
relations:
User:
class: sfGuardUser
foreign: id
local: user_id
type: one
onDelete: cascade
foreignType: one
foreignAlias: Profile

Import:
actAs:
Timestampable: ~
SoftDelete: ~
Blameable:
<<: *Blameable
inheritance:
type: column_aggregation
extends: sfGuardUser
columns:
excel_file_id:
type: integer(4)
notnull: false
relations:
ExcelFile:
class: ExcelFile
local: excel_file_id
foreign: id

ExcelFile:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
notnull: true
file:
type: string(255)
notnull: true
is_imported:
type: boolean
notnull: true
default: false
relations:
sfGuardUser:
class: sfGuardUser
local: author_id
foreign: id

Addressee:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
notnull: true
description:
type: clob
relations:
ClauseBodies:
class: ClauseBody
local: addressee_id
foreign: clause_body_id
refClass: ClauseAddressee

Organisation:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
notnull: true
description:
type: clob
slug:
type: string(255)
parent_id:
type: integer(4)
relations:
OrganisationParent:
class: Organisation
local: parent_id
foreign: id
foreignAlias: Suborganisations

DocumentType:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
notnull: true
rank_priority:
type: integer(4)
legal_value:
type: string(30)
notnull: true
description:
type: clob

Document:
actAs:
<<: *actAs
MyCommentable: ~
columns:
id:
type: integer(4)
primary: true
autoincrement: true
title:
type: string(1000)
notnull: true
slug:
type: string(50)
enforcement_date:
type: date
adoption_date:
type: date
notnull: true
code:
type: string(255)
min_ratification_count:
type: integer(4)
is_ratified:
type: boolean
vote_url:
type: string(500)
private_comment:
type: clob
public_comment:
type: clob
parent_document_id:
type: integer(4)
root_document_id:
type: integer(4)
organisation_id:
type: integer(4)
documenttype_id:
type: integer(4)
document_url:
type: string(500)
status:
type: enum
values: [draft, review, reviewed, inactive, active]
default: draft
notnull: true
indexes:
root_document:
fields:
id: []
root_document_id: []
relations:
DocumentParent:
class: Document
local: parent_document_id
foreign: id
foreignAlias: Subdocuments
Organisation:
local: organisation_id
foreign: id
foreignAlias: Organisations
DocumentType:
local: documenttype_id
foreign: id
foreignAlias: Documents
Tags:
class: Tag
local: document_id
foreign: tag_id
refClass: DocumentTag

DocumentDocumentRelation:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
type:
type: enum
values: [recalls, closely related]
notnull: true
document_id:
type: integer(4)
notnull: true
related_document_id:
type: integer(4)
notnull: true
relations:
Document:
local: document_id
foreign: id
DocumentRelated:
class: Document
local: related_document_id
foreign: id
indexes:
mapping:
fields: [document_id, related_document_id, type]
type: unique

DocumentClauseRelation:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
type:
type: enum
values: [closely related]
notnull: true
document_id:
type: integer(4)
notnull: true
related_clause_body_id:
type: integer(4)
notnull: true
relations:
Document:
local: document_id
foreign: id
ClauseRelated:
class: ClauseBody
local: related_clause_body_id
foreign: id
indexes:
mapping:
fields: [document_id, related_clause_body_id, type]
type: unique

DocumentReservation:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
document_id:
type: integer(4)
country_id:
type: integer(4)
reservation:
type: clob
relations:
Document:
class: Document
local: document_id
foreign: id
Country:
local: country_id
foreign: id
foreignAlias: Countries
indexes:
mapping:
fields: [document_id, country_id]
type: unique

ClauseClauseRelation:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
type:
type: enum
values: [recalls, closely related]
notnull: true
clause_id:
type: integer(4)
notnull: true
related_clause_id:
type: integer(4)
notnull: true
relations:
Clause:
local: clause_id
foreign: id
ClauseRelated:
class: Clause
local: related_clause_id
foreign: id
indexes:
mapping:
fields: [clause_id, related_clause_id, type]
type: unique

Clause:
actAs:
<<: *actAs
MyCommentable: ~
sfLuceneDoctrineTemplate: ~
columns:
id:
type: integer(4)
primary: true
autoincrement: true
document_id:
type: integer(4)
notnull: true
is_latest_clause:
type: boolean
default: true
clause_body_id:
type: integer(4)
notnull: true
clause_number:
type: integer(4)
notnull: true
clause_number_information:
type: string(255)
clause_number_subparagraph:
type: string(255)
private_comment:
type: clob
slug:
type: string(50)
relations:
Document:
local: document_id
foreign: id
foreignAlias: Clauses
ClauseBody:
local: clause_body_id
foreign: id
indexes:
mapping:
fields: [document_id, clause_body_id]
type: unique

ClauseBody:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
content:
type: clob
information_type_id:
type: integer(4)
operative_phrase_id:
type: integer(4)
public_comment:
type: clob
parent_clause_body_id:
type: integer(4)
root_clause_body_id:
type: integer(4)
status:
type: enum
values: [draft, review, reviewed, inactive, active]
default: draft
notnull: true
indexes:
root_clause_body:
fields:
id: []
root_clause_body_id: []
relations:
Addressees:
class: Addressee
local: clause_body_id
foreign: addressee_id
refClass: ClauseAddressee
ClauseBodyRoot:
class: ClauseBody
local: root_clause_body_id
foreign: id
foreignAlias: Rootclause
ClauseBodyParent:
class: ClauseBody
local: parent_clause_body_id
foreign: id
foreignAlias: Subclauses
ClauseInformationType:
local: information_type_id
foreign: id
foreignAlias: Clauses
ClauseOperativePhrase:
local: operative_phrase_id
foreign: id
foreignAlias: Clauses
Tags:
class: Tag
local: clause_body_id
foreign: tag_id
refClass: ClauseBodyTag

ClauseReservation:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
clause_body_id:
type: integer(4)
country_id:
type: integer(4)
reservation:
type: clob
relations:
Clause:
class: ClauseBody
local: clause_body_id
foreign: id
Country:
local: country_id
foreign: id
foreignAlias: Countries
indexes:
mapping:
fields: [clause_body_id, country_id]
type: unique

ClauseOperativePhrase:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
notnull: true
description:
type: clob

ClauseInformationType:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
notnull: true
description:
type: clob

Tag:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
notnull: true
description:
type: clob
relations:
Documents:
class: Document
local: tag_id
foreign: document_id
refClass: DocumentTag
ClauseBodies:
class: ClauseBody
local: tag_id
foreign: clause_body_id
refClass: ClauseBodyTag
indexes:
name:
fields: [name]
type: unique

TagImplication:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
implication_type:
type: enum
values: ['implies', 'suggests']
notnull: true
tag_id:
type: integer(4)
notnull: true
implied_tag_id:
type: integer(4)
notnull: true
relations:
Tag:
class: Tag
local: tag_id
foreign: id
ImpliedTag:
class: Tag
local: implied_tag_id
foreign: id
indexes:
mapping:
fields: [tag_id, implied_tag_id]
type: unique

Bookmark:
actAs:
Timestampable: ~
columns:
id:
type: integer(4)
primary: true
autoincrement: true
user_id:
type: integer(4)
notnull: true
object_type:
type: enum
values: [clause, document]
notnull: true
object_id:
type: integer(4)
notnull: true
indexes:
mapping:
fields: [user_id, object_type, object_id]
type: unique

Country:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
iso:
type: string(3)
notnull: true
name:
type: string(255)
notnull: true

CountryOrganisation:
actAs:
<<: *actAs
Temporal:
unique_fields: [country_id, organisation_id]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
country_id:
type: integer(4)
notnull: true
organisation_id:
type: integer(4)
notnull: true
relations:
Country:
local: country_id
foreign: id
foreignAlias: Organisations
Organisation:
local: organisation_id
foreign: id
foreignAlias: Countries

Vote:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
type:
type: enum
values: ['adopted without a vote','yes','no','abstention','not present','signed','ratified']
vote_date:
type: datetime
document_id:
type: integer(4)
notnull: true
country_id:
type: integer(4)
notnull: true
relations:
Document:
local: document_id
foreign: id
foreignAlias: Votes
Country:
local: country_id
foreign: id
foreignAlias: Votes
indexes:
mapping:
fields: [document_id, country_id]
type: unique

ClauseAddressee:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
clause_body_id:
type: integer(4)
notnull: true
addressee_id:
type: integer(4)
notnull: true
indexes:
mapping:
fields: [clause_body_id, addressee_id]
type: unique

DocumentTag:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
document_id:
type: integer(4)
notnull: true
tag_id:
type: integer(4)
notnull: true
indexes:
mapping:
fields: [document_id, tag_id]
type: unique

ClauseBodyTag:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
clause_body_id:
type: integer(4)
notnull: true
tag_id:
type: integer(4)
notnull: true
indexes:
mapping:
fields: [clause_body_id, tag_id]
type: unique

Change log

r623 by lukas.smith on Aug 13, 2010   Diff
add description field to organisation
model
Go to: 
Project members, sign in to write a code review

Older revisions

r568 by lukas.smith on Jun 12, 2010   Diff
added description for addressee, tag,
operative phrase, information type and
document type
r532 by lukas.smith on May 28, 2010   Diff
added index to improve performance
when checking root_document_id
r529 by lukas.smith on May 28, 2010   Diff
added index to improve performance
when checking root_clause_body_id
All revisions of this file

File info

Size: 13727 bytes, 721 lines
Powered by Google Project Hosting