github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/engine/pkg/orm/model/project.go (about) 1 // Copyright 2022 PingCAP, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 package model 15 16 import "time" 17 18 // ProjectInfo for Multi-projects support 19 type ProjectInfo struct { 20 Model 21 ID string `gorm:"column:id;type:varchar(128) not null;uniqueIndex:uidx_id"` 22 Name string `gorm:"type:varchar(128) not null"` 23 } 24 25 // ProjectOperation records each operation of a project 26 type ProjectOperation struct { 27 SeqID uint `gorm:"primaryKey;auto_increment"` 28 ProjectID string `gorm:"type:varchar(128) not null;index:idx_op"` 29 Operation string `gorm:"type:varchar(16) not null"` 30 JobID string `gorm:"type:varchar(128) not null"` 31 CreatedAt time.Time `gorm:"autoCreateTime;index:idx_op"` 32 }