Debian Codegraph @

ent/migrate/migrate.go

raw symbols SCIP
1 // Code generated by ent, DO NOT EDIT.
2
3 package migratescip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/
4
5 import (
6 "contextscip-go gomod github.com/golang/go/src go1.24.0 context/"
7 "fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/"
8 "ioscip-go gomod github.com/golang/go/src go1.24.0 io/"
9
10 "entgo.io/ent/dialectscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect`/"
11 "entgo.io/ent/dialect/sql/schemascip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/"
12 )
13
14 var (
15 // WithGlobalUniqueID sets the universal ids options to the migration.
16 // If this option is enabled, ent migration will allocate a 1<<32 range
17 // for the ids of each entity (table).
18 // Note that this option cannot be applied on tables that already exist.
19 WithGlobalUniqueIDscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/WithGlobalUniqueID. = schemascip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/.WithGlobalUniqueIDscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/WithGlobalUniqueID().
20 // WithDropColumn sets the drop column option to the migration.
21 // If this option is enabled, ent migration will drop old columns
22 // that were used for both fields and edges. This defaults to false.
23 WithDropColumnscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/WithDropColumn. = schemascip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/.WithDropColumnscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/WithDropColumn().
24 // WithDropIndex sets the drop index option to the migration.
25 // If this option is enabled, ent migration will drop old indexes
26 // that were defined in the schema. This defaults to false.
27 // Note that unique constraints are defined using `UNIQUE INDEX`,
28 // and therefore, it's recommended to enable this option to get more
29 // flexibility in the schema changes.
30 WithDropIndexscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/WithDropIndex. = schemascip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/.WithDropIndexscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/WithDropIndex().
31 // WithForeignKeys enables creating foreign-key in schema DDL. This defaults to true.
32 WithForeignKeysscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/WithForeignKeys. = schemascip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/.WithForeignKeysscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/WithForeignKeys().
33 )
34
35 // Schema is the API for creating, migrating and dropping a schema.
36 type Schemascip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema# struct {
37 drvscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#drv. dialectscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect`/.Driverscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect`/Driver#
38 }
39
40 // NewSchema creates a new schema client.
41 func NewSchemascip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/NewSchema().(drv dialectscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect`/.Driverscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect`/Driver#) *Schemascip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema# { return &Schemascip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#{drvscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#drv.: drv} }
42
43 // Create creates all schema resources.
44 func (s *Schemascip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#) Createscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#Create().(ctx contextscip-go gomod github.com/golang/go/src go1.24.0 context/.Contextscip-go gomod github.com/golang/go/src go1.24.0 context/Context#, opts ...schemascip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/.MigrateOptionscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/MigrateOption#) error {
45 return Createscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Create().(ctx, s, Tablesscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Tables., opts...)
46 }
47
48 // Create creates all table resources using the given schema driver.
49 func Createscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Create().(ctx contextscip-go gomod github.com/golang/go/src go1.24.0 context/.Contextscip-go gomod github.com/golang/go/src go1.24.0 context/Context#, s *Schemascip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#, tables []*schemascip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/.Tablescip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/Table#, opts ...schemascip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/.MigrateOptionscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/MigrateOption#) error {
50 migrate, err := schemascip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/.NewMigratescip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/NewMigrate().(s.drvscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#drv., opts...)
51 if err != nil {
52 return fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Errorf().("ent/migrate: %w", err)
53 }
54 return migrate.Createscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/Atlas#Create().(ctx, tables...)
55 }
56
57 // WriteTo writes the schema changes to w instead of running them against the database.
58 //
59 // if err := client.Schema.WriteTo(context.Background(), os.Stdout); err != nil {
60 // log.Fatal(err)
61 // }
62 func (s *Schemascip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#) WriteToscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#WriteTo().(ctx contextscip-go gomod github.com/golang/go/src go1.24.0 context/.Contextscip-go gomod github.com/golang/go/src go1.24.0 context/Context#, w ioscip-go gomod github.com/golang/go/src go1.24.0 io/.Writerscip-go gomod github.com/golang/go/src go1.24.0 io/Writer#, opts ...schemascip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/.MigrateOptionscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/MigrateOption#) error {
63 return Createscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Create().(ctx, &Schemascip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#{drvscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#drv.: &schemascip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/.WriteDriverscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/WriteDriver#{Writerscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/WriteDriver#Writer.: w, Driverscip-go gomod entgo.io/ent v0.14.5 `entgo.io/ent/dialect/sql/schema`/WriteDriver#Driver.: s.drvscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Schema#drv.}}, Tablesscip-go gomod github.com/in-toto/archivista . `github.com/in-toto/archivista/ent/migrate`/Tables., opts...)
64 }