Bug 1127532 - database index is missed defined in the model code
Summary: database index is missed defined in the model code
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Community
Component: scheduler
Version: 0.17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified vote
Target Milestone: 19.0
Assignee: beaker-dev-list
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-07 04:24 UTC by matt jia
Modified: 2018-02-06 00:41 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-13 03:17:55 UTC


Attachments (Terms of Use)

Description matt jia 2014-08-07 04:24:33 UTC
Description of problem:

The email_address index is not defined in the tg_user table when running beaker-init against a fresh db.

How reproducible:

always

Steps to Reproduce:
1. run beaker-init against a fresh db
2. login to db and show create table tg_user

Actual results:

MariaDB [beaker]> show create table tg_user;
 CREATE TABLE `tg_user` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_name` varchar(255) DEFAULT NULL,
  `email_address` varchar(255) DEFAULT NULL,
  `display_name` varchar(255) DEFAULT NULL,
  `password` text,
  `root_password` varchar(255) DEFAULT NULL,
  `rootpw_changed` datetime DEFAULT NULL,
  `openstack_username` varchar(255) DEFAULT NULL,
  `openstack_password` varchar(2048) DEFAULT NULL,
  `openstack_tenant_name` varchar(2048) DEFAULT NULL,
  `created` datetime DEFAULT NULL,
  `disabled` tinyint(1) NOT NULL,
  `removed` datetime DEFAULT NULL,
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `user_name` (`user_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |

Expected results:

| tg_user | CREATE TABLE `tg_user` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_name` varchar(255) DEFAULT NULL,
  `email_address` varchar(255) DEFAULT NULL,
  `display_name` varchar(255) DEFAULT NULL,
  `password` text,
  `root_password` varchar(255) DEFAULT NULL,
  `rootpw_changed` datetime DEFAULT NULL,
  `openstack_username` varchar(255) DEFAULT NULL,
  `openstack_password` varchar(2048) DEFAULT NULL,
  `openstack_tenant_name` varchar(2048) DEFAULT NULL,
  `created` datetime DEFAULT NULL,
  `disabled` tinyint(1) NOT NULL,
  `removed` datetime DEFAULT NULL,
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `user_name` (`user_name`),
  KEY `email_address` (`email_address`)
) ENGINE=InnoDB AUTO_INCREMENT=281 DEFAULT CHARSET=utf8 |

Additional info:

Other than adding the missing index definition in the model code, we also need to use alembic to create a revision for those instances that have already been upgraded to beaker 0.17.

Comment 2 Dan Callaghan 2014-11-13 03:17:55 UTC
This was fixed as part of the cleanups for database migration tests.


Note You need to log in before you can comment on or make changes to this bug.