diff options
author | showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-05-12 17:22:49 +0000 |
---|---|---|
committer | showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-05-12 17:22:49 +0000 |
commit | f4ddc40a039d2b478bb7f77c87d9f6f693f979ae (patch) | |
tree | 5475268e54333cc87df439c66098db968e0ae326 /tko/migrations | |
parent | 1dc95d2389de3a815c2cccd0f36742ceb012a093 (diff) |
Add the ability for users to add test attributes. Non-user-created attributes (added by the parser) are still immutable.
* add boolean column user_created to TestAttribute to keep track of which are user created, so we can preserve immutability
* add id primary key field to test attributes. Django requires this and we've been squeezing by without it, but we can't anymore.
* declare some PK fields AutoFields in TKO models, as they should be. this didn't matter before but does now that we have a TKO unit test, since these models determine how the test DB gets created.
* add set_test_attribute RPC to set/delete attributes
* modify get_detailed_test_views() to use the new populate_relationships() method to gather attributes and labels much more efficiently
* add rpc_interface_unittest, a unit test for the TKO rpc interface. TKO was previously completely untested, so this is the first unit test of any kind for it. since the doctests on AFE turned out to be quite unpopular, I'm using the unittest framework this time. this required some changes to AFE testing code.
* various fixes to model_logic to account for assumptions we were previously making that aren't true in TKO (mostly about PK fields being named "id").
Note that the migration may be slow, as it's adding two columns to test_attributes, a potentially large table.
Signed-off-by: Steve Howard <showard@google.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@3109 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/migrations')
-rw-r--r-- | tko/migrations/027_user_created_test_attributes.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tko/migrations/027_user_created_test_attributes.py b/tko/migrations/027_user_created_test_attributes.py new file mode 100644 index 00000000..05767cbc --- /dev/null +++ b/tko/migrations/027_user_created_test_attributes.py @@ -0,0 +1,9 @@ +UP_SQL = """ +ALTER TABLE test_attributes + ADD COLUMN id integer NOT NULL AUTO_INCREMENT PRIMARY KEY, + ADD COLUMN user_created bool NOT NULL DEFAULT FALSE; +""" + +DOWN_SQL = """ +ALTER TABLE test_attributes DROP COLUMN user_created, DROP COLUMN id; +""" |