From f0cab2479e25ab0ed36a8bf256406d80b21ddb19 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Mon, 9 Jun 2014 22:26:00 +0800 Subject: Bug 720832: Add the ability to watch component starting with a string (schema only) --- extensions/ComponentWatching/Extension.pm | 32 ++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'extensions/ComponentWatching') diff --git a/extensions/ComponentWatching/Extension.pm b/extensions/ComponentWatching/Extension.pm index c4951d877..addbaba70 100644 --- a/extensions/ComponentWatching/Extension.pm +++ b/extensions/ComponentWatching/Extension.pm @@ -28,8 +28,13 @@ sub db_schema_abstract_schema { my ($self, $args) = @_; $args->{'schema'}->{'component_watch'} = { FIELDS => [ + id => { + TYPE => 'MEDIUMSERIAL', + NOTNULL => 1, + PRIMARYKEY => 1, + }, user_id => { - TYPE => 'INT3', + TYPE => 'INT3', NOTNULL => 1, REFERENCES => { TABLE => 'profiles', @@ -38,7 +43,7 @@ sub db_schema_abstract_schema { } }, component_id => { - TYPE => 'INT2', + TYPE => 'INT2', NOTNULL => 0, REFERENCES => { TABLE => 'components', @@ -47,7 +52,7 @@ sub db_schema_abstract_schema { } }, product_id => { - TYPE => 'INT2', + TYPE => 'INT2', NOTNULL => 0, REFERENCES => { TABLE => 'products', @@ -55,6 +60,10 @@ sub db_schema_abstract_schema { DELETE => 'CASCADE', } }, + component_prefix => { + TYPE => 'VARCHAR(64)', + NOTNULL => 0, + }, ], }; } @@ -73,6 +82,23 @@ sub install_update_db { } } ); + $dbh->bz_add_column( + 'component_watch', + 'id', + { + TYPE => 'MEDIUMSERIAL', + NOTNULL => 1, + PRIMARYKEY => 1, + }, + ); + $dbh->bz_add_column( + 'component_watch', + 'component_prefix', + { + TYPE => 'VARCHAR(64)', + NOTNULL => 0, + } + ); } # -- cgit v1.2.3-24-g4f1b