| 1 |
// Code generated by ent, DO NOT EDIT. |
| 2 |
|
| 3 |
package migrate |
| 4 |
|
| 5 |
import ( |
| 6 |
"entgo.io/ent/dialect/sql/schema" |
| 7 |
"entgo.io/ent/schema/field" |
| 8 |
) |
| 9 |
|
| 10 |
var ( |
| 11 |
// AttestationsColumns holds the columns for the "attestations" table. |
| 12 |
AttestationsColumns = []*schema.Column{ |
| 13 |
{Name: "id", Type: field.TypeUUID, Unique: true}, |
| 14 |
{Name: "type", Type: field.TypeString}, |
| 15 |
{Name: "attestation_collection_attestations", Type: field.TypeUUID}, |
| 16 |
} |
| 17 |
// AttestationsTable holds the schema information for the "attestations" table. |
| 18 |
AttestationsTable = &schema.Table{ |
| 19 |
Name: "attestations", |
| 20 |
Columns: AttestationsColumns, |
| 21 |
PrimaryKey: []*schema.Column{AttestationsColumns[0]}, |
| 22 |
ForeignKeys: []*schema.ForeignKey{ |
| 23 |
{ |
| 24 |
Symbol: "attestations_attestation_collections_attestations", |
| 25 |
Columns: []*schema.Column{AttestationsColumns[2]}, |
| 26 |
RefColumns: []*schema.Column{AttestationCollectionsColumns[0]}, |
| 27 |
OnDelete: schema.NoAction, |
| 28 |
}, |
| 29 |
}, |
| 30 |
Indexes: []*schema.Index{ |
| 31 |
{ |
| 32 |
Name: "attestation_type", |
| 33 |
Unique: false, |
| 34 |
Columns: []*schema.Column{AttestationsColumns[1]}, |
| 35 |
}, |
| 36 |
}, |
| 37 |
} |
| 38 |
// AttestationCollectionsColumns holds the columns for the "attestation_collections" table. |
| 39 |
AttestationCollectionsColumns = []*schema.Column{ |
| 40 |
{Name: "id", Type: field.TypeUUID, Unique: true}, |
| 41 |
{Name: "name", Type: field.TypeString}, |
| 42 |
{Name: "statement_attestation_collections", Type: field.TypeUUID, Unique: true}, |
| 43 |
} |
| 44 |
// AttestationCollectionsTable holds the schema information for the "attestation_collections" table. |
| 45 |
AttestationCollectionsTable = &schema.Table{ |
| 46 |
Name: "attestation_collections", |
| 47 |
Columns: AttestationCollectionsColumns, |
| 48 |
PrimaryKey: []*schema.Column{AttestationCollectionsColumns[0]}, |
| 49 |
ForeignKeys: []*schema.ForeignKey{ |
| 50 |
{ |
| 51 |
Symbol: "attestation_collections_statements_attestation_collections", |
| 52 |
Columns: []*schema.Column{AttestationCollectionsColumns[2]}, |
| 53 |
RefColumns: []*schema.Column{StatementsColumns[0]}, |
| 54 |
OnDelete: schema.NoAction, |
| 55 |
}, |
| 56 |
}, |
| 57 |
Indexes: []*schema.Index{ |
| 58 |
{ |
| 59 |
Name: "attestationcollection_name", |
| 60 |
Unique: false, |
| 61 |
Columns: []*schema.Column{AttestationCollectionsColumns[1]}, |
| 62 |
}, |
| 63 |
}, |
| 64 |
} |
| 65 |
// AttestationPoliciesColumns holds the columns for the "attestation_policies" table. |
| 66 |
AttestationPoliciesColumns = []*schema.Column{ |
| 67 |
{Name: "id", Type: field.TypeUUID, Unique: true}, |
| 68 |
{Name: "name", Type: field.TypeString}, |
| 69 |
{Name: "statement_policy", Type: field.TypeUUID, Unique: true, Nullable: true}, |
| 70 |
} |
| 71 |
// AttestationPoliciesTable holds the schema information for the "attestation_policies" table. |
| 72 |
AttestationPoliciesTable = &schema.Table{ |
| 73 |
Name: "attestation_policies", |
| 74 |
Columns: AttestationPoliciesColumns, |
| 75 |
PrimaryKey: []*schema.Column{AttestationPoliciesColumns[0]}, |
| 76 |
ForeignKeys: []*schema.ForeignKey{ |
| 77 |
{ |
| 78 |
Symbol: "attestation_policies_statements_policy", |
| 79 |
Columns: []*schema.Column{AttestationPoliciesColumns[2]}, |
| 80 |
RefColumns: []*schema.Column{StatementsColumns[0]}, |
| 81 |
OnDelete: schema.SetNull, |
| 82 |
}, |
| 83 |
}, |
| 84 |
Indexes: []*schema.Index{ |
| 85 |
{ |
| 86 |
Name: "attestationpolicy_name", |
| 87 |
Unique: false, |
| 88 |
Columns: []*schema.Column{AttestationPoliciesColumns[1]}, |
| 89 |
}, |
| 90 |
}, |
| 91 |
} |
| 92 |
// DssesColumns holds the columns for the "dsses" table. |
| 93 |
DssesColumns = []*schema.Column{ |
| 94 |
{Name: "id", Type: field.TypeUUID, Unique: true}, |
| 95 |
{Name: "created_at", Type: field.TypeTime, Nullable: true}, |
| 96 |
{Name: "gitoid_sha256", Type: field.TypeString, Unique: true}, |
| 97 |
{Name: "payload_type", Type: field.TypeString}, |
| 98 |
{Name: "dsse_statement", Type: field.TypeUUID, Nullable: true}, |
| 99 |
} |
| 100 |
// DssesTable holds the schema information for the "dsses" table. |
| 101 |
DssesTable = &schema.Table{ |
| 102 |
Name: "dsses", |
| 103 |
Columns: DssesColumns, |
| 104 |
PrimaryKey: []*schema.Column{DssesColumns[0]}, |
| 105 |
ForeignKeys: []*schema.ForeignKey{ |
| 106 |
{ |
| 107 |
Symbol: "dsses_statements_statement", |
| 108 |
Columns: []*schema.Column{DssesColumns[4]}, |
| 109 |
RefColumns: []*schema.Column{StatementsColumns[0]}, |
| 110 |
OnDelete: schema.SetNull, |
| 111 |
}, |
| 112 |
}, |
| 113 |
} |
| 114 |
// PayloadDigestsColumns holds the columns for the "payload_digests" table. |
| 115 |
PayloadDigestsColumns = []*schema.Column{ |
| 116 |
{Name: "id", Type: field.TypeUUID, Unique: true}, |
| 117 |
{Name: "algorithm", Type: field.TypeString}, |
| 118 |
{Name: "value", Type: field.TypeString}, |
| 119 |
{Name: "dsse_payload_digests", Type: field.TypeUUID, Nullable: true}, |
| 120 |
} |
| 121 |
// PayloadDigestsTable holds the schema information for the "payload_digests" table. |
| 122 |
PayloadDigestsTable = &schema.Table{ |
| 123 |
Name: "payload_digests", |
| 124 |
Columns: PayloadDigestsColumns, |
| 125 |
PrimaryKey: []*schema.Column{PayloadDigestsColumns[0]}, |
| 126 |
ForeignKeys: []*schema.ForeignKey{ |
| 127 |
{ |
| 128 |
Symbol: "payload_digests_dsses_payload_digests", |
| 129 |
Columns: []*schema.Column{PayloadDigestsColumns[3]}, |
| 130 |
RefColumns: []*schema.Column{DssesColumns[0]}, |
| 131 |
OnDelete: schema.SetNull, |
| 132 |
}, |
| 133 |
}, |
| 134 |
Indexes: []*schema.Index{ |
| 135 |
{ |
| 136 |
Name: "payloaddigest_value", |
| 137 |
Unique: false, |
| 138 |
Columns: []*schema.Column{PayloadDigestsColumns[2]}, |
| 139 |
}, |
| 140 |
}, |
| 141 |
} |
| 142 |
// SignaturesColumns holds the columns for the "signatures" table. |
| 143 |
SignaturesColumns = []*schema.Column{ |
| 144 |
{Name: "id", Type: field.TypeUUID, Unique: true}, |
| 145 |
{Name: "key_id", Type: field.TypeString}, |
| 146 |
{Name: "signature", Type: field.TypeString, SchemaType: map[string]string{"mysql": "text"}}, |
| 147 |
{Name: "dsse_signatures", Type: field.TypeUUID, Nullable: true}, |
| 148 |
} |
| 149 |
// SignaturesTable holds the schema information for the "signatures" table. |
| 150 |
SignaturesTable = &schema.Table{ |
| 151 |
Name: "signatures", |
| 152 |
Columns: SignaturesColumns, |
| 153 |
PrimaryKey: []*schema.Column{SignaturesColumns[0]}, |
| 154 |
ForeignKeys: []*schema.ForeignKey{ |
| 155 |
{ |
| 156 |
Symbol: "signatures_dsses_signatures", |
| 157 |
Columns: []*schema.Column{SignaturesColumns[3]}, |
| 158 |
RefColumns: []*schema.Column{DssesColumns[0]}, |
| 159 |
OnDelete: schema.SetNull, |
| 160 |
}, |
| 161 |
}, |
| 162 |
Indexes: []*schema.Index{ |
| 163 |
{ |
| 164 |
Name: "signature_key_id", |
| 165 |
Unique: false, |
| 166 |
Columns: []*schema.Column{SignaturesColumns[1]}, |
| 167 |
}, |
| 168 |
}, |
| 169 |
} |
| 170 |
// StatementsColumns holds the columns for the "statements" table. |
| 171 |
StatementsColumns = []*schema.Column{ |
| 172 |
{Name: "id", Type: field.TypeUUID, Unique: true}, |
| 173 |
{Name: "predicate", Type: field.TypeString}, |
| 174 |
} |
| 175 |
// StatementsTable holds the schema information for the "statements" table. |
| 176 |
StatementsTable = &schema.Table{ |
| 177 |
Name: "statements", |
| 178 |
Columns: StatementsColumns, |
| 179 |
PrimaryKey: []*schema.Column{StatementsColumns[0]}, |
| 180 |
Indexes: []*schema.Index{ |
| 181 |
{ |
| 182 |
Name: "statement_predicate", |
| 183 |
Unique: false, |
| 184 |
Columns: []*schema.Column{StatementsColumns[1]}, |
| 185 |
}, |
| 186 |
}, |
| 187 |
} |
| 188 |
// SubjectsColumns holds the columns for the "subjects" table. |
| 189 |
SubjectsColumns = []*schema.Column{ |
| 190 |
{Name: "id", Type: field.TypeUUID, Unique: true}, |
| 191 |
{Name: "created_at", Type: field.TypeTime, Nullable: true}, |
| 192 |
{Name: "name", Type: field.TypeString}, |
| 193 |
{Name: "statement_subjects", Type: field.TypeUUID, Nullable: true}, |
| 194 |
} |
| 195 |
// SubjectsTable holds the schema information for the "subjects" table. |
| 196 |
SubjectsTable = &schema.Table{ |
| 197 |
Name: "subjects", |
| 198 |
Columns: SubjectsColumns, |
| 199 |
PrimaryKey: []*schema.Column{SubjectsColumns[0]}, |
| 200 |
ForeignKeys: []*schema.ForeignKey{ |
| 201 |
{ |
| 202 |
Symbol: "subjects_statements_subjects", |
| 203 |
Columns: []*schema.Column{SubjectsColumns[3]}, |
| 204 |
RefColumns: []*schema.Column{StatementsColumns[0]}, |
| 205 |
OnDelete: schema.SetNull, |
| 206 |
}, |
| 207 |
}, |
| 208 |
Indexes: []*schema.Index{ |
| 209 |
{ |
| 210 |
Name: "subject_name", |
| 211 |
Unique: false, |
| 212 |
Columns: []*schema.Column{SubjectsColumns[2]}, |
| 213 |
}, |
| 214 |
}, |
| 215 |
} |
| 216 |
// SubjectDigestsColumns holds the columns for the "subject_digests" table. |
| 217 |
SubjectDigestsColumns = []*schema.Column{ |
| 218 |
{Name: "id", Type: field.TypeUUID, Unique: true}, |
| 219 |
{Name: "algorithm", Type: field.TypeString}, |
| 220 |
{Name: "value", Type: field.TypeString}, |
| 221 |
{Name: "subject_subject_digests", Type: field.TypeUUID, Nullable: true}, |
| 222 |
} |
| 223 |
// SubjectDigestsTable holds the schema information for the "subject_digests" table. |
| 224 |
SubjectDigestsTable = &schema.Table{ |
| 225 |
Name: "subject_digests", |
| 226 |
Columns: SubjectDigestsColumns, |
| 227 |
PrimaryKey: []*schema.Column{SubjectDigestsColumns[0]}, |
| 228 |
ForeignKeys: []*schema.ForeignKey{ |
| 229 |
{ |
| 230 |
Symbol: "subject_digests_subjects_subject_digests", |
| 231 |
Columns: []*schema.Column{SubjectDigestsColumns[3]}, |
| 232 |
RefColumns: []*schema.Column{SubjectsColumns[0]}, |
| 233 |
OnDelete: schema.SetNull, |
| 234 |
}, |
| 235 |
}, |
| 236 |
Indexes: []*schema.Index{ |
| 237 |
{ |
| 238 |
Name: "subjectdigest_value", |
| 239 |
Unique: false, |
| 240 |
Columns: []*schema.Column{SubjectDigestsColumns[2]}, |
| 241 |
}, |
| 242 |
}, |
| 243 |
} |
| 244 |
// TimestampsColumns holds the columns for the "timestamps" table. |
| 245 |
TimestampsColumns = []*schema.Column{ |
| 246 |
{Name: "id", Type: field.TypeUUID, Unique: true}, |
| 247 |
{Name: "type", Type: field.TypeString}, |
| 248 |
{Name: "timestamp", Type: field.TypeTime}, |
| 249 |
{Name: "signature_timestamps", Type: field.TypeUUID, Nullable: true}, |
| 250 |
} |
| 251 |
// TimestampsTable holds the schema information for the "timestamps" table. |
| 252 |
TimestampsTable = &schema.Table{ |
| 253 |
Name: "timestamps", |
| 254 |
Columns: TimestampsColumns, |
| 255 |
PrimaryKey: []*schema.Column{TimestampsColumns[0]}, |
| 256 |
ForeignKeys: []*schema.ForeignKey{ |
| 257 |
{ |
| 258 |
Symbol: "timestamps_signatures_timestamps", |
| 259 |
Columns: []*schema.Column{TimestampsColumns[3]}, |
| 260 |
RefColumns: []*schema.Column{SignaturesColumns[0]}, |
| 261 |
OnDelete: schema.SetNull, |
| 262 |
}, |
| 263 |
}, |
| 264 |
} |
| 265 |
// Tables holds all the tables in the schema. |
| 266 |
Tables = []*schema.Table{ |
| 267 |
AttestationsTable, |
| 268 |
AttestationCollectionsTable, |
| 269 |
AttestationPoliciesTable, |
| 270 |
DssesTable, |
| 271 |
PayloadDigestsTable, |
| 272 |
SignaturesTable, |
| 273 |
StatementsTable, |
| 274 |
SubjectsTable, |
| 275 |
SubjectDigestsTable, |
| 276 |
TimestampsTable, |
| 277 |
} |
| 278 |
) |
| 279 |
|
| 280 |
func init() { |
| 281 |
AttestationsTable.ForeignKeys[0].RefTable = AttestationCollectionsTable |
| 282 |
AttestationCollectionsTable.ForeignKeys[0].RefTable = StatementsTable |
| 283 |
AttestationPoliciesTable.ForeignKeys[0].RefTable = StatementsTable |
| 284 |
DssesTable.ForeignKeys[0].RefTable = StatementsTable |
| 285 |
PayloadDigestsTable.ForeignKeys[0].RefTable = DssesTable |
| 286 |
SignaturesTable.ForeignKeys[0].RefTable = DssesTable |
| 287 |
SubjectsTable.ForeignKeys[0].RefTable = StatementsTable |
| 288 |
SubjectDigestsTable.ForeignKeys[0].RefTable = SubjectsTable |
| 289 |
TimestampsTable.ForeignKeys[0].RefTable = SignaturesTable |
| 290 |
} |