rewrite .sql / .rel files, drop unnecessary entity types, explicit imports
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 27 Jul 2009 10:57:33 +0200
changeset 2508 b1958ebed570
parent 2507 45248d0ad8a0
child 2509 fb26d662f2fd
rewrite .sql / .rel files, drop unnecessary entity types, explicit imports
devtools/test/data/bootstrap_cubes
devtools/test/data/schema.py
devtools/test/data/schema/Bug.sql
devtools/test/data/schema/Project.sql
devtools/test/data/schema/Story.sql
devtools/test/data/schema/Version.sql
devtools/test/data/schema/custom.py
devtools/test/data/schema/relations.rel
--- a/devtools/test/data/bootstrap_cubes	Mon Jul 27 09:40:31 2009 +0200
+++ b/devtools/test/data/bootstrap_cubes	Mon Jul 27 10:57:33 2009 +0200
@@ -1,1 +1,1 @@
-person, comment
+person
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devtools/test/data/schema.py	Mon Jul 27 10:57:33 2009 +0200
@@ -0,0 +1,20 @@
+"""
+
+:organization: Logilab
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
+:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
+:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
+"""
+from yams.buildobjs import EntityType, SubjectRelation, String, Int, Date
+
+from cubes.person.schema import Person
+
+Person.add_relation(Date(), 'birthday')
+
+class Bug(EntityType):
+    title = String(maxsize=64, required=True, fulltextindexed=True)
+    severity = String(vocabulary=('important', 'normal', 'minor'), default='normal')
+    cost = Int()
+    description	= String(maxsize=4096, fulltextindexed=True)
+    identical_to = SubjectRelation('Bug', symetric=True)
+
--- a/devtools/test/data/schema/Bug.sql	Mon Jul 27 09:40:31 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-title		ivarchar(64) not null
-state		CHOICE('open', 'rejected', 'validation pending', 'resolved') default 'open'
-severity	CHOICE('important', 'normal', 'minor') default 'normal'
-cost 		integer
-description	ivarchar(4096)
--- a/devtools/test/data/schema/Project.sql	Mon Jul 27 09:40:31 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-name		ivarchar(64) not null
-summary		ivarchar(128)	
-vcsurl		varchar(256)
-reporturl	varchar(256)
-description	ivarchar(1024)
-url		varchar(128)
--- a/devtools/test/data/schema/Story.sql	Mon Jul 27 09:40:31 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-title		ivarchar(64) not null
-state		CHOICE('open', 'rejected', 'validation pending', 'resolved') default 'open'
-priority	CHOICE('minor', 'normal', 'important') default 'normal'
-cost	        integer
-description	ivarchar(4096)
--- a/devtools/test/data/schema/Version.sql	Mon Jul 27 09:40:31 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-num	varchar(16) not null
-diem	date	
-status 	CHOICE('planned', 'dev', 'published') default 'planned'
--- a/devtools/test/data/schema/custom.py	Mon Jul 27 09:40:31 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-"""
-
-:organization: Logilab
-:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
-:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
-:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
-"""
-Person = import_erschema('Person')
-Person.add_relation(Date(), 'birthday')
--- a/devtools/test/data/schema/relations.rel	Mon Jul 27 09:40:31 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-Bug concerns Project inline
-Story concerns Project inline
-
-Bug corrected_in Version inline CONSTRAINT E concerns P, X version_of P
-Story done_in Version inline CONSTRAINT E concerns P, X version_of P
-
-Bug   identical_to Bug   symetric
-Bug   identical_to Story symetric
-Story identical_to Story symetric
-
-Story depends_on Story
-Story depends_on Bug
-Bug   depends_on Story
-Bug   depends_on Bug
-
-Bug     see_also Bug	 symetric
-Bug	see_also Story	 symetric
-Bug	see_also Project symetric
-Story	see_also Story	 symetric
-Story	see_also Project symetric
-Project see_also Project symetric
-
-Project uses Project
-
-Version version_of Project inline
-Version todo_by CWUser
-
-Comment about Bug inline
-Comment about Story inline
-Comment about Comment inline
-
-CWUser interested_in Project
-