This is a migrated thread and some comments may be shown as answers.

database update script

2 Answers 90 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Antti Stoor
Top achievements
Rank 1
Antti Stoor asked on 13 Nov 2009, 08:32 AM
Hi, I just moved to Telerim ORM from Vanatec OpenAccess.
I added some new persistent fields to my class and when I compile, I get the error

 

 
<P>c:\program files\telerik\openaccess orm\bin\VSchema.exe   
-assembly:C:\Projects\MesPal\LavaLib\bin\Release\LavaLib.dll -migrate</P> 
<P>Data truncated for column 'db_status_time' at row 1</P> 
<P>at   
Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.executeUpdate(String   
sql)</P> 
<P>at Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.execute(String   
sql)</P> 
<P>at   
OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.ExecuteSqlScript(String   
script, Connection con, SqlDriver sqlDriver, Boolean noShredder)</P> 
<P>OpenAccess Error: Telerik.OpenAccess: Updating SQL schema failed.   
Telerik.OpenAccess.OpenAccessException: SQL exception on 'ALTER TABLE `machine`   
CHANGE COLUMN `db_status_time` `db_status_time` DATETIME NOT NULL' : Data   
truncated for column 'db_status_time' at row 1</P> 
<P>OpenAccess Error: Data truncated for column 'db_status_time' at row </P> 

With earlier versions, OpenAccess made a database schema update script for me and there it first made the new field NULL then updated values and then altered the field as not null.

How do I get the script file?

2 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 13 Nov 2009, 04:36 PM
Hello Antti,

the update scripts should be in your bin\Release or bin\Debug folder, depending on your configuration.

Best wishes,
Thomas
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
IT-Als
Top achievements
Rank 1
answered on 16 Nov 2009, 06:53 AM
Hello Antti,

If you want to control the specifics of generating schemas (create or migrate), you can do direct calls to the vschema.exe on the command-line. See these docs. Take a look at the -migrate option and the -outputdir switch

The same functionality is accessible through the API. Check out this doc entry for a sample.

Regards

Henrik
Tags
Getting Started
Asked by
Antti Stoor
Top achievements
Rank 1
Answers by
Thomas
Telerik team
IT-Als
Top achievements
Rank 1
Share this question
or