Exemple #1
0
        /// <summary>
        /// Alter the table or its columns/options<br/>
        /// If <paramref name="migration"/>.SchemaPrefix have a value, the Syntax-OldName will be computed to {<paramref name="migration"/>.SchemaPrefix}{<paramref name="tableName"/>}<br/>
        /// If NOT, the Syntax-OldName will be the same as {<paramref name="tableName"/>}
        /// </summary>
        /// <param name="root">Expression root to extend</param>
        /// <param name="tableName">
        /// The table name to alter<br/>
        /// See summary-section how this parameter is used
        /// </param>
        /// <param name="migration"><see cref="IMigrationModel"/></param>
        /// <returns>The interface for the modifications - <see cref="IAlterTableAddColumnOrAlterColumnOrSchemaOrDescriptionSyntax"/></returns>
        public static IAlterTableAddColumnOrAlterColumnOrSchemaOrDescriptionSyntax Table(this IAlterExpressionRoot root, string tableName, IMigrationModel migration)
        {
            var syntax = root.Table(migration.GetPrefixedName(tableName));

            syntax.InSchema(migration.SchemaName);
            return(syntax);
        }
Exemple #2
0
        /// <summary>
        /// Specify the new name of the table<br/>
        /// If <paramref name="migration"/>.SchemaPrefix have a value, the Syntax-TableName will be computed to {<paramref name="migration"/>.SchemaPrefix}{<paramref name="tableName"/>}<br/>
        /// If NOT, the Syntax-TableName will be the same as {<paramref name="tableName"/>}
        /// </summary>
        /// <param name="syntax">Syntax to extend</param>
        /// <param name="tableName">
        /// The new table name<br/>
        /// See summary-section how this parameter is used
        /// </param>
        /// <param name="migration"></param>
        /// <returns>return <see cref="IInSchemaSyntax"/></returns>
        public static IInSchemaSyntax ToTable(this IRenameTableToOrInSchemaSyntax syntax, string tableName, IMigrationModel migration)
        {
            var tableSyntax = syntax.To(migration.GetPrefixedName(tableName));

            tableSyntax.InSchema(migration.SchemaName);
            return(tableSyntax);
        }
Exemple #3
0
        /// <summary>
        /// Renames a table in Schema {<paramref name="migration"/>.SchemaName}<br/>
        /// If <paramref name="migration"/>.SchemaPrefix have a value, the Syntax-OldName will be computed to {<paramref name="migration"/>.SchemaPrefix}{<paramref name="oldName"/>}<br/>
        /// If NOT, the Syntax-OldName will be the same as {<paramref name="oldName"/>}
        /// </summary>
        /// <param name="root">Expression root to extend</param>
        /// <param name="oldName">
        /// The current table name<br/>
        /// See summary-section how this parameter is used
        /// </param>
        /// <param name="migration">FluentDbTools <see cref="IMigrationModel"/></param>
        /// <returns>The next step</returns>
        public static IRenameTableToOrInSchemaSyntax Table(this IRenameExpressionRoot root, string oldName, IMigrationModel migration)
        {
            var syntax = root.Table(migration.GetPrefixedName(oldName));

            syntax.InSchema(migration.SchemaName);
            return(syntax);
        }
Exemple #4
0
        /// <summary>
        /// Specify the table for the new column<br/>
        /// If <paramref name="migration"/>.SchemaPrefix have a value, the Syntax-TableName will be computed to {<paramref name="migration"/>.SchemaPrefix}{<paramref name="tableName"/>}<br/>
        /// If NOT, the Syntax-TableName will be the same as {<paramref name="tableName"/>}
        /// </summary>
        /// <param name="syntax">Syntax to extend</param>
        /// <param name="tableName">
        /// The table name for the new column <br/>
        /// See summary-section how this parameter is used
        /// </param>
        /// <param name="migration"></param>
        /// <returns>The interface to specify the table schema or column information</returns>
        public static ICreateColumnAsTypeOrInSchemaSyntax OnTable(this ICreateColumnOnTableSyntax syntax, string tableName, IMigrationModel migration)
        {
            var tableSyntax = syntax.OnTable(migration.GetPrefixedName(tableName));

            tableSyntax.InSchema(migration.SchemaName);
            return(tableSyntax);
        }