mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-22 23:51:27 +01:00
update db migration code to update version and add index
This commit is contained in:
parent
2ec20e44c3
commit
84d41794ac
@ -143,7 +143,8 @@ create table replication_job (
|
|||||||
tags varchar(16384),
|
tags varchar(16384),
|
||||||
creation_time timestamp default CURRENT_TIMESTAMP,
|
creation_time timestamp default CURRENT_TIMESTAMP,
|
||||||
update_time timestamp default CURRENT_TIMESTAMP on update 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 (
|
create table properties (
|
||||||
@ -152,11 +153,8 @@ create table properties (
|
|||||||
primary key (k)
|
primary key (k)
|
||||||
);
|
);
|
||||||
|
|
||||||
insert into properties (k, v) values
|
|
||||||
('schema_version', '0.1.1');
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `alembic_version` (
|
CREATE TABLE IF NOT EXISTS `alembic_version` (
|
||||||
`version_num` varchar(32) NOT NULL
|
`version_num` varchar(32) NOT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) 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"))
|
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"))
|
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
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
"""0.1.1 to 0.2.0
|
"""0.1.1 to 0.3.0
|
||||||
|
|
||||||
Revision ID: 0.1.1
|
Revision ID: 0.1.1
|
||||||
Revises:
|
Revises:
|
||||||
@ -20,7 +20,7 @@ Revises:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = '0.2.0'
|
revision = '0.3.0'
|
||||||
down_revision = '0.1.1'
|
down_revision = '0.1.1'
|
||||||
branch_labels = None
|
branch_labels = None
|
||||||
depends_on = None
|
depends_on = None
|
Loading…
Reference in New Issue
Block a user