首页 \ 问答 \ 需要为近1000个软件包更新ssis连接管理器(Need to update ssis connection manager for almost 1000 packages)

需要为近1000个软件包更新ssis连接管理器(Need to update ssis connection manager for almost 1000 packages)

我的团队正在将他们的SQL Server 2012更新为SQL Server 2016,因此我们必须更新我们的Visual Studio(2012)SSIS / Data Tools包连接以使用SQL Server 2016。

目前计划是逐一做到这一点!

有更快的方法吗?


My team is updating their SQL Server 2012 to SQL Server 2016, and thus we must update our Visual Studio (2012) SSIS/Data Tools package connections to use SQL Server 2016.

Currently the plan is to do this one by one!

Is there a faster way?


原文:https://stackoverflow.com/questions/46452528
更新时间:2023-10-28 16:10

最满意答案

感谢多态关联,我们可以将所有关系放在一个表中,如下所示:

create_table :follows do |t|
        t.references :followable, :polymorphic => true
        t.references :followed_by, :polymorphic => true
end

然后模型是:

class User < ActiveRecord::Base
    has_many :following_objects, :class_name => 'Follow', :as => :followed_by
    has_many :followed_objects, :class_name => 'Follow', :as => :followable
end

class Company < ActiveRecord::Base
    has_many :following_objects, :class_name => 'Follow', :as => :followed_by
    has_many :followed_objects, :class_name => 'Follow', :as => :followable
end

class Follow < ActiveRecord::Base
    belongs_to :followable, :polymorphic => true
    belongs_to :followed_by, :polymorphic => true
end

抱歉丑陋的名字。


Thanks to polymorphic associations, we can put all relations into one table which like this:

create_table :follows do |t|
        t.references :followable, :polymorphic => true
        t.references :followed_by, :polymorphic => true
end

Then the models are:

class User < ActiveRecord::Base
    has_many :following_objects, :class_name => 'Follow', :as => :followed_by
    has_many :followed_objects, :class_name => 'Follow', :as => :followable
end

class Company < ActiveRecord::Base
    has_many :following_objects, :class_name => 'Follow', :as => :followed_by
    has_many :followed_objects, :class_name => 'Follow', :as => :followable
end

class Follow < ActiveRecord::Base
    belongs_to :followable, :polymorphic => true
    belongs_to :followed_by, :polymorphic => true
end

Sorry for the ugly names.

相关问答

更多
  • 该错误是因为您有循环导入。 两个模块不可能相互导入。 在这种情况下,您无需将模型导入每个应用程序。 删除导入,然后使用字符串app_label.ModelName 。 # app1.models.py class FirstModel(models.Model): first_field = models.ManyToManyField('app2.SecondModel') # app2.models.py class SecondModel(models.Model): second_ ...
  • MVC(模型视图控制器)是一个设计模式 ,基于做一件事的原则,并做得很好...... 单个模型可以与N个视图一起使用......这就是MVC的特性。 模型包含业务逻辑和数据 View是用于向用户显示结果的内容。 控制器是完成操作的控制器 java中的Swing基于MVC。 也称为PLAF (Pluggable Look and Feel)。 一个Java程序,其中Model与View分开,可以轻松地与不同的View一起使用。 例如:业务逻辑编写得很好,与View部分分开,可以在Swing中使用,也可以用JS ...
  • 感谢多态关联,我们可以将所有关系放在一个表中,如下所示: create_table :follows do |t| t.references :followable, :polymorphic => true t.references :followed_by, :polymorphic => true end 然后模型是: class User < ActiveRecord::Base has_many :following_objects, :class_nam ...
  • 是的,这正是我做的。 如果您需要向模型添加更多元素或使用属性装饰模型,则以后简单易用。 或者,您可以使用Tuple ,将模型类型声明为: @model Tuple> Yeah, that's exactly how I'd do it. It's simple and easy to extend later if you need to add more elements to the model or decorate the model with a ...
  • 我建议使用store_accessor和STI的组合。 商店访问者将允许您添加模型特定属性并支持验证。 如果使用PostgreSQL,您可以利用GIN / GiST索引有效地搜索自定义字段。 class User < ActiveRecord::Base has_many :friends end class Friend < ActiveRecord::Base belongs_to :user # exclude nil values from uniq check v ...
  • 在这种情况下有两个ForeignKey字段是可以的。 ManyToManyField可能会导致错误,当3队将被添加。 因此,您可以使用ForeignKey指定两个ForeignKey字段: class Match(models.Model): team1 = models.ForeignKey('Team', related_name='team1') team2 = models.ForeignKey('Team', related_name='team2') tournament ...
  • 您的关系假定user_id为外键作为默认值。 您还可以通过将其他参数传递给hasMany方法来覆盖外键和本地键: return $this->hasMany('App\Ticket', 'foreign_key', 'local_key'); 所以, 用户模型: public function tickets() { return $this->hasMany('App\Ticket','userId','id'); } 门票型号: public function use ...
  • 我通常通过重写我的视图的创建/更新来调用一些业务或额外的验证步骤来解决此问题,然后调用序列化器的保存。 I usually solve this by rewriting my view's create / update to call some business or extra validation steps before calling the serializer's save.
  • 目前,关系仅存在于MySQL和SQLite3等关系数据库中。 因此,您需要进行两次查询才能获得所需的数据。 我们正在努力为基于文档的数据库添加对关系的支持,但目前还没有时间表。 您可以在帖子的结果上使用Set :: extract来提取所有用户ID,然后使用其中的结果从用户进行单个查询 - 所以从你可以做的帖子$ userIDs = Set :: extract('/ posts / user_id',$ posts-> data()); 然后User :: find('all',array('condit ...
  • Django模型不支持多个主键: https : //docs.djangoproject.com/en/1.3/faq/models/#do-django-models-support-multiple-column-primary-keys 但是,正如文档所描述的那样,您可以使用ForeignKey字段上的其他属性(如unique_together)来执行相同的操作。 希望能帮到你。 Django models don't support multiple primary keys: https://d ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)