You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* The object 'dbo.posts' does not have any indexes, or you do not have permissions. *//* No constraints are defined on object 'dbo.posts', or you do not have permissions. *//* No foreign keys reference table 'dbo.posts', or you do not have permissions on referencing tables. *//* No views with schema binding reference table 'dbo.posts'. */CREATETABLEdbo.posts
( ID intNOT NULL
, Body varchar(-1) NOT NULL
)
CREATEVIEWpopular_postsASSELECT*FROM posts
As a result, when loading the objects back into the database via structure_load, the following error is thrown.
$ rails db:setup
...
rails aborted!
ActiveRecord::StatementInvalid: TinyTds::Error: 'CREATE VIEW' must be the first statement in a query batch.
/Users/jonahgeorge/src/funcard/funcard/bin/rails:5:in `<top (required)>'
/Users/jonahgeorge/src/funcard/funcard/bin/spring:10:in `block in <top (required)>'
/Users/jonahgeorge/src/funcard/funcard/bin/spring:7:in `<top (required)>'
Expected behavior
structure_load should be capable of loading a structure.sql file generated by structure_dump.
Actual behavior
TinyTds::Error: 'CREATE VIEW' must be the first statement in a query batch. exception is raised.
Details
Rails version: 6.1.4
SQL Server adapter version: v6.1.2.1
FreeTDS details:
$ tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v1.3.3
freetds.conf directory: /opt/homebrew/etc
MS db-lib source compatibility: no
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 7.3
iODBC: no
unixodbc: yes
SSPI "trusted" logins: no
Kerberos: yes
OpenSSL: yes
GnuTLS: no
MARS: yes
The text was updated successfully, but these errors were encountered:
Issue
Given an example schema:
structure_dump
generates the following file (which strips theGo
statements added in between the various objects).As a result, when loading the objects back into the database via
structure_load
, the following error is thrown.Expected behavior
structure_load
should be capable of loading astructure.sql
file generated bystructure_dump
.Actual behavior
TinyTds::Error: 'CREATE VIEW' must be the first statement in a query batch.
exception is raised.Details
6.1.4
v6.1.2.1
The text was updated successfully, but these errors were encountered: