1. Packages
  2. Sql Provider
  3. API Docs
  4. Migrate
sql 0.5.0 published on Monday, Apr 14, 2025 by paultyng

sql.Migrate

Explore with Pulumi AI

sql logo
sql 0.5.0 published on Monday, Apr 14, 2025 by paultyng

    Example Usage

    Create Migrate Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Migrate(name: string, args?: MigrateArgs, opts?: CustomResourceOptions);
    @overload
    def Migrate(resource_name: str,
                args: Optional[MigrateArgs] = None,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Migrate(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                migrations: Optional[Sequence[MigrateMigrationArgs]] = None)
    func NewMigrate(ctx *Context, name string, args *MigrateArgs, opts ...ResourceOption) (*Migrate, error)
    public Migrate(string name, MigrateArgs? args = null, CustomResourceOptions? opts = null)
    public Migrate(String name, MigrateArgs args)
    public Migrate(String name, MigrateArgs args, CustomResourceOptions options)
    
    type: sql:Migrate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args MigrateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args MigrateArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args MigrateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MigrateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MigrateArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var migrateResource = new Sql.Migrate("migrateResource", new()
    {
        Migrations = new[]
        {
            new Sql.Inputs.MigrateMigrationArgs
            {
                Down = "string",
                Id = "string",
                Up = "string",
            },
        },
    });
    
    example, err := sql.NewMigrate(ctx, "migrateResource", &sql.MigrateArgs{
    	Migrations: sql.MigrateMigrationArray{
    		&sql.MigrateMigrationArgs{
    			Down: pulumi.String("string"),
    			Id:   pulumi.String("string"),
    			Up:   pulumi.String("string"),
    		},
    	},
    })
    
    var migrateResource = new Migrate("migrateResource", MigrateArgs.builder()
        .migrations(MigrateMigrationArgs.builder()
            .down("string")
            .id("string")
            .up("string")
            .build())
        .build());
    
    migrate_resource = sql.Migrate("migrateResource", migrations=[{
        "down": "string",
        "id": "string",
        "up": "string",
    }])
    
    const migrateResource = new sql.Migrate("migrateResource", {migrations: [{
        down: "string",
        id: "string",
        up: "string",
    }]});
    
    type: sql:Migrate
    properties:
        migrations:
            - down: string
              id: string
              up: string
    

    Migrate Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Migrate resource accepts the following input properties:

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Migrate resource produces the following output properties:

    CompleteMigrations List<MigrateCompleteMigration>
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    Id string
    The provider-assigned unique ID for this managed resource.
    CompleteMigrations []MigrateCompleteMigration
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    Id string
    The provider-assigned unique ID for this managed resource.
    completeMigrations List<MigrateCompleteMigration>
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    id String
    The provider-assigned unique ID for this managed resource.
    completeMigrations MigrateCompleteMigration[]
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    id string
    The provider-assigned unique ID for this managed resource.
    complete_migrations Sequence[MigrateCompleteMigration]
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    id str
    The provider-assigned unique ID for this managed resource.
    completeMigrations List<Property Map>
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Migrate Resource

    Get an existing Migrate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: MigrateState, opts?: CustomResourceOptions): Migrate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            complete_migrations: Optional[Sequence[MigrateCompleteMigrationArgs]] = None,
            migrations: Optional[Sequence[MigrateMigrationArgs]] = None) -> Migrate
    func GetMigrate(ctx *Context, name string, id IDInput, state *MigrateState, opts ...ResourceOption) (*Migrate, error)
    public static Migrate Get(string name, Input<string> id, MigrateState? state, CustomResourceOptions? opts = null)
    public static Migrate get(String name, Output<String> id, MigrateState state, CustomResourceOptions options)
    resources:  _:    type: sql:Migrate    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CompleteMigrations List<MigrateCompleteMigration>
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    Migrations List<MigrateMigration>
    CompleteMigrations []MigrateCompleteMigrationArgs
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    Migrations []MigrateMigrationArgs
    completeMigrations List<MigrateCompleteMigration>
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    migrations List<MigrateMigration>
    completeMigrations MigrateCompleteMigration[]
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    migrations MigrateMigration[]
    complete_migrations Sequence[MigrateCompleteMigrationArgs]
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    migrations Sequence[MigrateMigrationArgs]
    completeMigrations List<Property Map>
    The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
    migrations List<Property Map>

    Supporting Types

    MigrateCompleteMigration, MigrateCompleteMigrationArgs

    Down string
    Id string
    Up string
    Down string
    Id string
    Up string
    down String
    id String
    up String
    down string
    id string
    up string
    down str
    id str
    up str
    down String
    id String
    up String

    MigrateMigration, MigrateMigrationArgs

    Down string
    The query to run when undoing this migration.
    Id string
    Identifier can be any string to help identifying the migration in the source.
    Up string
    The query to run when applying this migration.
    Down string
    The query to run when undoing this migration.
    Id string
    Identifier can be any string to help identifying the migration in the source.
    Up string
    The query to run when applying this migration.
    down String
    The query to run when undoing this migration.
    id String
    Identifier can be any string to help identifying the migration in the source.
    up String
    The query to run when applying this migration.
    down string
    The query to run when undoing this migration.
    id string
    Identifier can be any string to help identifying the migration in the source.
    up string
    The query to run when applying this migration.
    down str
    The query to run when undoing this migration.
    id str
    Identifier can be any string to help identifying the migration in the source.
    up str
    The query to run when applying this migration.
    down String
    The query to run when undoing this migration.
    id String
    Identifier can be any string to help identifying the migration in the source.
    up String
    The query to run when applying this migration.

    Package Details

    Repository
    sql paultyng/terraform-provider-sql
    License
    Notes
    This Pulumi package is based on the sql Terraform Provider.
    sql logo
    sql 0.5.0 published on Monday, Apr 14, 2025 by paultyng