Rails 与 SQL Server 2008/2012 - FILESTREAM
新手来了!我目前正在使用 Ruby on Rails 创建一个应用程序。
该特定应用程序使用二进制数据作为内容。显然,由于 FILESTREAM 功能,SQL Server 是最好的选择。根据我从文档中发现的内容,这基本上为> >的二进制对象创建了一个文件系统。 1MB。
话虽如此,我正在使用 Ruby on Rails 并准备设置 activerecord-sqlserver-adapter,但我需要知道在设置具有活动记录迁移的数据库时如何指定要使用 FILESTREAM 的列?我是否只需编辑列以接受 SQL Server 管理中的 FILESTREAM? (这显然是在允许在 SQL SERVER 中使用 FILESTREAM 之后。)
所以我预测的设置是: 1.安装SQL Server和所有支持组件 2.安装activerecord-sqlserver-adpater gem 3. 创建一个 varbinary(max) 数据库列(用于二进制文件) - 迁移中 4.在sql server中指定为FILESTREAM使用所述列
总而言之,当使用rails/ruby在数据库中创建列时,如何配置以指定使用FILESTREAM?
Novice here! I'm currently creating an application using Ruby on Rails.
This particular application uses binary data for content. Apparently, SQL Server is the best way to go because of the FILESTREAM feature. From what I found from documentation, this basically creates a file system for binary objects that are > 1mb.
With that said, I am using Ruby on Rails and preparing to setup the activerecord-sqlserver-adapter but I need to know how will I be able to specify a column to use FILESTREAM while setting up a database with active record migration? Would I just edit the column to accept FILESTREAM in SQL Server management? (This is obviously after allowing FILESTREAM to be used in SQL SERVER.)
So the setup I predict is:
1. install SQL Server and all supporting components
2. install activerecord-sqlserver-adpater gem
3. create a varbinary(max) database column (for the binary file) - In migration
4. specify in sql server to use said column for FILESTREAM
All in all, How do I configure to specify the use of FILESTREAM when creating a column in a database using rails/ruby?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这还不是全部,每个具有存储为 FILESTREAM 列 varbinary(max) 的表都应该具有 rowguid 类型的列。
这是我用于附件的示例
No that's not the all, every table that has a column varbinary(max) which stored as a FILESTREAM should have a column with rowguid type.
Here is a sample that I've used for Attachments