Exemple #1
0
        private void UpdateObject(SqlObject source, SqlObject destination)
        {
            switch (source.Type)
            {
            case SqlObjectType.Table:
                UpdateTables(source as SqlTable, destination as SqlTable);
                break;

            case SqlObjectType.Type:
                UpdateTypes(source as SqlType, destination as SqlType);
                break;

            default:
                _syncScript.Add(new SyncAction
                {
                    Name = source.Name,
                    Text = source.CreateScript(),
                    Type = GetCreateActionType(source.Type)
                });
                _syncScript.Add(new SyncAction
                {
                    Name = destination.Name,
                    Text = destination.DropScript(),
                    Type = GetDropActionType(destination.Type)
                });
                break;
            }
        }
Exemple #2
0
        private void DropObject(SqlObject obj)
        {
            switch (obj.Type)
            {
            case SqlObjectType.Table:
                DropTable(obj as SqlTable);
                break;

            default:
                _syncScript.Add(new SyncAction
                {
                    Name = obj.Name,
                    Text = obj.DropScript(),
                    Type = GetDropActionType(obj.Type)
                });
                break;
            }
        }