mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 18:55:18 +01:00
Merge pull request #497 from reasonerjt/job-service
update db migration code to update version and add index
This commit is contained in:
commit
876db4804e
@ -143,7 +143,8 @@ create table replication_job (
|
||||
tags varchar(16384),
|
||||
creation_time timestamp default CURRENT_TIMESTAMP,
|
||||
update_time timestamp default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (id)
|
||||
PRIMARY KEY (id),
|
||||
INDEX policy (policy_id)
|
||||
);
|
||||
|
||||
create table properties (
|
||||
@ -152,11 +153,8 @@ create table properties (
|
||||
primary key (k)
|
||||
);
|
||||
|
||||
insert into properties (k, v) values
|
||||
('schema_version', '0.1.1');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `alembic_version` (
|
||||
`version_num` varchar(32) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
insert into alembic_version values ('0.2.0');
|
||||
insert into alembic_version values ('0.3.0');
|
||||
|
@ -124,3 +124,4 @@ class ReplicationJob(Base):
|
||||
creation_time = sa.Column(mysql.TIMESTAMP, server_default = sa.text("CURRENT_TIMESTAMP"))
|
||||
update_time = sa.Column(mysql.TIMESTAMP, server_default = sa.text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
|
||||
|
||||
__table_args__ = (sa.Index('policy', "policy_id"),)
|
||||
|
@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""0.1.1 to 0.2.0
|
||||
"""0.1.1 to 0.3.0
|
||||
|
||||
Revision ID: 0.1.1
|
||||
Revises:
|
||||
@ -20,7 +20,7 @@ Revises:
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0.2.0'
|
||||
revision = '0.3.0'
|
||||
down_revision = '0.1.1'
|
||||
branch_labels = None
|
||||
depends_on = None
|
Loading…
Reference in New Issue
Block a user