sql schema is managed under sqlalchemy, no need for the .sql file anymore
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 17 Jan 2012 19:28:07 +0000 (20:28 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 17 Jan 2012 19:28:07 +0000 (20:28 +0100)
Makefile
init.d/sfa
setup.py
sfa.spec
sfa/storage/sfa.sql [deleted file]

index a21ce8f..f1b1ce6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,6 @@ python-install:
        python setup.py install --root=$(DESTDIR)       
        chmod 444 $(DESTDIR)/etc/sfa/default_config.xml
        rm -rf $(DESTDIR)/usr/lib*/python*/site-packages/*egg-info
-       rm -rf $(DESTDIR)/usr/lib*/python*/site-packages/sfa/storage/sfa.sql
        (cd $(DESTDIR)/usr/bin ; ln -s sfi.py sfi; ln -s sfascan.py sfascan)
 
 python-clean: version-clean
@@ -152,7 +151,6 @@ sync: synccheck
        +$(RSYNC)  $(BINS) $(SSHURL)/usr/bin/
        +$(RSYNC) ./init.d/sfa  $(SSHURL)/etc/init.d/
        +$(RSYNC) ./config/default_config.xml $(SSHURL)/etc/sfa/
-       +$(RSYNC) ./sfa/storage/sfa.sql $(SSHURL)/usr/share/sfa/
        $(SSHCOMMAND) exec service sfa restart
 
 # 99% of the time this is enough
index 32cc1a0..885865a 100755 (executable)
@@ -217,9 +217,6 @@ function db_start () {
     if ! psql -U $SFA_DB_USER -c "" $SFA_DB_NAME >/dev/null 2>&1 ; then
        createdb -U postgres --template=template0 --encoding=UNICODE --owner=$SFA_DB_USER $SFA_DB_NAME
        check
-        # install db schema
-        psql -U $SFA_DB_USER -f /usr/share/sfa/sfa.sql $SFA_DB_NAME
-       check
     fi
     check
 
index 033a7d4..6f30257 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -64,7 +64,6 @@ data_files = [ ('/etc/sfa/', [ 'config/aggregates.xml',
                ('/etc/sfatables/matches/', glob('sfatables/matches/*.xml')),
                ('/etc/sfatables/targets/', glob('sfatables/targets/*.xml')),
                ('/etc/init.d/', [ "init.d/%s"%x for x in initscripts ]),
-               ('/usr/share/sfa/', [ 'sfa/storage/sfa.sql' ] ),
                ('/usr/share/sfa/examples/', glob('sfa/examples/*' ) + [ 'cron.d/sfa.cron' ] ),
               ]
 
index 0c1ba9b..d470c35 100644 (file)
--- a/sfa.spec
+++ b/sfa.spec
@@ -152,7 +152,6 @@ rm -rf $RPM_BUILD_ROOT
 %config /etc/sfa/default_config.xml
 %config (noreplace) /etc/sfa/aggregates.xml
 %config (noreplace) /etc/sfa/registries.xml
-/usr/share/sfa/sfa.sql
 /usr/share/sfa/examples
 /var/www/html/wsdl/*.wsdl
 
diff --git a/sfa/storage/sfa.sql b/sfa/storage/sfa.sql
deleted file mode 100644 (file)
index 9a2792c..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
---
--- SFA database schema
---
-
-SET client_encoding = 'UNICODE';
-
---------------------------------------------------------------------------------
--- Version
---------------------------------------------------------------------------------
-
--- Database version
-CREATE TABLE sfa_db_version (
-    version integer NOT NULL,
-    subversion integer NOT NULL DEFAULT 0
-) WITH OIDS;
-
--- the migration scripts do not use the major 'version' number
--- so 5.0 sets subversion at 100
--- in case your database misses the site and persons tags feature, 
--- you might wish to first upgrade to 4.3-rc16 before moving to some 5.0
--- or run the up script here
--- http://svn.planet-lab.org/svn/PLCAPI/branches/4.3/migrations/
-
-INSERT INTO sfa_db_version (version, subversion) VALUES (1, 1);
-
---------------------------------------------------------------------------------
--- Aggregates and store procedures
---------------------------------------------------------------------------------
-
--- Like MySQL GROUP_CONCAT(), this function aggregates values into a
--- PostgreSQL array.
-CREATE AGGREGATE array_accum (
-    sfunc = array_append,
-    basetype = anyelement,
-    stype = anyarray,
-    initcond = '{}'
-);
-
--- Valid record types
-CREATE TABLE record_types (
-       record_type text PRIMARY KEY
-) WITH OIDS;
-INSERT INTO record_types (record_type) VALUES ('authority');
-INSERT INTO record_types (record_type) VALUES ('authority+sa');
-INSERT INTO record_types (record_type) VALUES ('authority+am');
-INSERT INTO record_types (record_type) VALUES ('authority+sm');
-INSERT INTO record_types (record_type) VALUES ('user');
-INSERT INTO record_types (record_type) VALUES ('slice');
-INSERT INTO record_types (record_type) VALUES ('node');
-
-
--- main table 
-CREATE TABLE records ( 
-    record_id serial PRIMARY KEY , 
-    hrn text NOT NULL, 
-    authority text NOT NULL, 
-    peer_authority text, 
-    gid text, 
-    type text REFERENCES record_types, 
-    pointer integer, 
-    date_created timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, 
-    last_updated timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP
-);
-CREATE INDEX sfa_hrn_ids on records (hrn);
-CREATE INDEX sfa_type_ids on records (type);
-CREATE INDEX sfa_authority_ids on records (authority);
-CREATE INDEX sfa_peer_authority_ids on records (peer_authority);
-CREATE INDEX sfa_pointer_ids on records (pointer);