[zypp-commit] r5532 - /trunk/libzypp/zypp2/cache/schema/schema.sql
Author: dmacvicar Date: Thu May 10 18:07:56 2007 New Revision: 5532 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5532&view=rev Log: add tables to handle all attributes. Will explain in mailing list later Modified: trunk/libzypp/zypp2/cache/schema/schema.sql Modified: trunk/libzypp/zypp2/cache/schema/schema.sql URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/cache/schema/schema.sql?rev=5532&r1=5531&r2=5532&view=diff ============================================================================== --- trunk/libzypp/zypp2/cache/schema/schema.sql (original) +++ trunk/libzypp/zypp2/cache/schema/schema.sql Thu May 10 18:07:56 2007 @@ -3,6 +3,7 @@ -- The cleanup can be generated as: -- cat schema.sql | grep "^CREATE" | awk '{print "DROP " $2 " IF EXISTS " $3 ";"}' | sort -r ------------------------------------------------ + DROP VIEW IF EXISTS scripts; DROP VIEW IF EXISTS products; DROP VIEW IF EXISTS patterns; @@ -11,22 +12,40 @@ DROP VIEW IF EXISTS messages; DROP TRIGGER IF EXISTS remove_resolvables; DROP TRIGGER IF EXISTS remove_patch_packages_baseversions; -DROP TABLE IF EXISTS translated_texts; DROP TABLE IF EXISTS split_capabilities; +DROP TABLE IF EXISTS script_ttext_attributes; +DROP TABLE IF EXISTS script_text_attributes; +DROP TABLE IF EXISTS script_script_ttext_attributes; +DROP TABLE IF EXISTS script_script_text_attributes; DROP TABLE IF EXISTS script_details; +DROP TABLE IF EXISTS resolvable_ttext_attributes; +DROP TABLE IF EXISTS resolvable_text_attributes; DROP TABLE IF EXISTS resolvables_catalogs; DROP TABLE IF EXISTS resolvables; -DROP TABLE IF EXISTS resolvable_texts; +DROP TABLE IF EXISTS resolvable_resolvable_ttext_attributes; +DROP TABLE IF EXISTS resolvable_resolvable_text_attributes; +DROP TABLE IF EXISTS product_ttext_attributes; +DROP TABLE IF EXISTS product_text_attributes; +DROP TABLE IF EXISTS product_product_ttext_attributes; +DROP TABLE IF EXISTS product_product_text_attributes; DROP TABLE IF EXISTS product_details; DROP TABLE IF EXISTS pattern_details; +DROP TABLE IF EXISTS patch_text_attributes; +DROP TABLE IF EXISTS patch_patch_text_attributes; DROP TABLE IF EXISTS patch_packages_baseversions; DROP TABLE IF EXISTS patch_packages; DROP TABLE IF EXISTS patch_details; +DROP TABLE IF EXISTS package_ttext_attributes; +DROP TABLE IF EXISTS package_text_attributes; +DROP TABLE IF EXISTS package_package_ttext_attributes; +DROP TABLE IF EXISTS package_package_text_attributes; DROP TABLE IF EXISTS package_details; DROP TABLE IF EXISTS other_capabilities; DROP TABLE IF EXISTS names; DROP TABLE IF EXISTS named_capabilities; DROP TABLE IF EXISTS modalias_capabilities; +DROP TABLE IF EXISTS message_ttext_attributes; +DROP TABLE IF EXISTS message_message_ttext_attributes; DROP TABLE IF EXISTS message_details; DROP TABLE IF EXISTS locks; DROP TABLE IF EXISTS hal_capabilities; @@ -39,6 +58,7 @@ DROP TABLE IF EXISTS catalogs; DROP INDEX IF EXISTS package_details_resolvable_id; DROP INDEX IF EXISTS named_capabilities_name; + ------------------------------------------------ -- version metadata, probably not needed, there -- is pragma user_version @@ -91,25 +111,6 @@ ); ------------------------------------------------ --- File names table and normalized sub tables ------------------------------------------------- - -CREATE TABLE translated_texts ( - id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL - , text_id INTEGER NOT NULL - , lang_id INTEGER NOT NULL - , text TEXT - -); - -CREATE TABLE resolvable_texts ( - resolvable_id INTEGER NOT NULL - , text_id INTEGER NOT NULL - , lang_id INTEGER NOT NULL - , field_id INTEGER NOT NULL -); - ------------------------------------------------- -- Resolvables table ------------------------------------------------ @@ -121,25 +122,71 @@ , epoch INTEGER , arch INTEGER , kind INTEGER - , summary_text_id INTEGER - , description_text_id INTEGER - , insnotify TEXT - , delnotify TEXT - , license_to_confirm TEXT - , vendor TEXT - , installed_size INTEGER + , catalog_id INTEGER REFERENCES catalogs(id) + , installed_size INTEGER , archive_size INTEGER , install_only INTEGER , build_time INTEGER , install_time INTEGER - , catalog_id INTEGER REFERENCES catalogs(id) ); +-- Resolvables translated strings +CREATE TABLE resolvable_ttext_attributes ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL + , lang_code INTEGER + , summary TEXT + , description TEXT + , insnotify TEXT + , delnotify TEXT + , license_to_confirm +); + +-- Association between ttext attributes and resolvables +CREATE TABLE resolvable_resolvable_ttext_attributes ( + resolvable_id INTEGER REFERENCES resolvable(id) + , ttext_attribute_id INTEGER REFERENCES resolvable_ttext_attributes(id) + , PRIMARY KEY ( resolvable_id, ttext_attribute_id ) +); + +-- Resolvables untranslated strings +CREATE TABLE resolvable_text_attributes ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL +); + +-- Association between text attributes and resolvables +CREATE TABLE resolvable_resolvable_text_attributes ( + resolvable_id INTEGER REFERENCES resolvable(id) + , text_attribute_id INTEGER REFERENCES text_attribute(id) + , PRIMARY KEY ( resolvable_id, text_attribute_id ) +); + +------------------------------------------------ +-- Resolvables kind details +------------------------------------------------ + CREATE TABLE message_details ( resolvable_id INTEGER REFERENCES resolvables(id) , text TEXT ); +-- messages translated strings +CREATE TABLE message_ttext_attributes ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL + , lang_code INTEGER + , summary TEXT + , description TEXT + , insnotify TEXT + , delnotify TEXT + , license_to_confirm +); + +-- Association between ttext attributes and messages +CREATE TABLE message_message_ttext_attributes ( + message_id INTEGER REFERENCES message(id) + , ttext_attribute_id INTEGER REFERENCES message_ttext_attributes(id) + , PRIMARY KEY ( message_id, ttext_attribute_id ) +); + CREATE TABLE patch_details ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , resolvable_id INTEGER REFERENCES resolvables(id) @@ -151,6 +198,20 @@ ); +-- patchs translated strings +CREATE TABLE patch_text_attributes ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL + , patch_id TEXT + , category TEXT +); + +-- Association between ttext attributes and patchs +CREATE TABLE patch_patch_text_attributes ( + patch_id INTEGER REFERENCES patch(id) + , text_attribute_id INTEGER REFERENCES patch_text_attributes(id) + , PRIMARY KEY ( patch_id, text_attribute_id ) +); + CREATE TABLE pattern_details ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , resolvable_id INTEGER REFERENCES resolvables(id) @@ -166,7 +227,28 @@ CREATE TABLE product_details ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , resolvable_id INTEGER REFERENCES resolvables(id) +); + +-- products translated strings +CREATE TABLE product_ttext_attributes ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL + , lang_code INTEGER + , short_name TEXT +); + +-- Association between ttext attributes and products +CREATE TABLE product_product_ttext_attributes ( + product_id INTEGER REFERENCES product(id) + , ttext_attribute_id INTEGER REFERENCES product_ttext_attributes(id) + , PRIMARY KEY ( product_id, ttext_attribute_id ) +); + +-- products translated strings +CREATE TABLE product_text_attributes ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , category TEXT + , distribution_name TEXT + , distribution_edition TEXT , vendor TEXT , release_notes_url TEXT , update_urls TEXT @@ -174,19 +256,45 @@ , optional_urls TEXT , flags TEXT , short_name TEXT - , long_name TEXT - , distribution_name TEXT - , distribution_edition TEXT +); +-- Association between ttext attributes and products +CREATE TABLE product_product_text_attributes ( + product_id INTEGER REFERENCES product(id) + , text_attribute_id INTEGER REFERENCES product_text_attributes(id) + , PRIMARY KEY ( product_id, text_attribute_id ) ); CREATE TABLE script_details ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , resolvable_id INTEGER REFERENCES resolvables(id) +); + +-- scripts translated strings +CREATE TABLE script_ttext_attributes ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL + , lang_code INTEGER +); + +-- Association between ttext attributes and scripts +CREATE TABLE script_script_ttext_attributes ( + script_id INTEGER REFERENCES script(id) + , ttext_attribute_id INTEGER REFERENCES script_ttext_attributes(id) + , PRIMARY KEY ( script_id, ttext_attribute_id ) +); + +-- scripts translated strings +CREATE TABLE script_text_attributes ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , do_script TEXT , undo_script TEXT +); - +-- Association between ttext attributes and scripts +CREATE TABLE script_script_text_attributes ( + script_id INTEGER REFERENCES script(id) + , text_attribute_id INTEGER REFERENCES script_text_attributes(id) + , PRIMARY KEY ( script_id, text_attribute_id ) ); CREATE TABLE package_details ( @@ -212,6 +320,43 @@ ); CREATE INDEX package_details_resolvable_id ON package_details (resolvable_id); +-- packages translated strings +CREATE TABLE package_ttext_attributes ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL + , lang_code INTEGER + , short_name TEXT +); + +-- Association between ttext attributes and packages +CREATE TABLE package_package_ttext_attributes ( + package_id INTEGER REFERENCES package(id) + , ttext_attribute_id INTEGER REFERENCES package_ttext_attributes(id) + , PRIMARY KEY ( package_id, ttext_attribute_id ) +); + +-- packages translated strings +CREATE TABLE package_text_attributes ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL + , category TEXT + , distribution_name TEXT + , distribution_edition TEXT + , vendor TEXT + , release_notes_url TEXT + , update_urls TEXT + , extra_urls TEXT + , optional_urls TEXT + , flags TEXT + , short_name TEXT +); + +-- Association between ttext attributes and packages +CREATE TABLE package_package_text_attributes ( + package_id INTEGER REFERENCES package(id) + , text_attribute_id INTEGER REFERENCES package_text_attributes(id) + , PRIMARY KEY ( package_id, text_attribute_id ) +); + + ------------------------------------------------ -- Do we need those here? ------------------------------------------------ -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
dmacvicar@svn.opensuse.org