django.db.utils.OperationalError: (1050, "Table 'devtypeinfo' already exists

用django1.7.6创建的工程,在想数据库mysql同步表格时,出现问题;django.db.utils.OperationalError: (1050, "Table 'devtypeinfo' already exists;


环境:创建完项目之后,已经同步了一次,后来又需要添加表格,又在models.py中加入了一个class类,进行同步时(./manage.py makemigrations 没有错误信息,执行,.manage.py migrate时出现错误)


解决方法:

                  用./manage.py migrate myapp 命令同步;

展开阅读全文

jboss:Table already exists: JMS_MESSAGES in statement [CREATE CACHED TABLE JMS_MESSAGES]

08-29

jboss连接mysql时出现这个错误rnrn我在deploy下有mysql-ds.xmlrnrn各位大侠有出现这个问题的嘛?怎么解决呢rnrnrn谢谢rnrnrn2005-10-29 23:28:39,436 DEBUG [org.jboss.mq.pm.jdbc2.PersistenceManager] Could not create table with SQL: CREATE CACHED TABLE JMS_MESSAGES ( MESSAGEID INTEGER NOT NULL, DESTINATION VARCHAR(255) NOT NULL, TXID INTEGER, TXOP CHAR(1), MESSAGEBLOB OBJECT, PRIMARY KEY (MESSAGEID, DESTINATION) )rnjava.sql.SQLException: Table already exists: JMS_MESSAGES in statement [CREATE CACHED TABLE JMS_MESSAGES]rn at org.hsqldb.jdbc.jdbcUtil.throwError(Unknown Source)rn at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)rn at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:316)rn at org.jboss.mq.pm.jdbc2.PersistenceManager.resolveAllUncommitedTXs(PersistenceManager.java:224)rn at org.jboss.mq.pm.jdbc2.PersistenceManager.startService(PersistenceManager.java:1422)rn at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)rn at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)rn at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:585)rn at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)rn at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)rn at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)rn at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)rn at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)rn at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)rn at $Proxy0.start(Unknown Source) 论坛

TIdFTP.get 报错 'destination file already exists' 的问题

02-16

我在Indy网站上下了一个关于TIdFTP的demo,其中有这么一句:rnrnFTP.Get(FileName, SaveFile.FileName, true, true);rnrn总是报错'destination file already exists',明明目录下没有那个文件。如是我看看get实现的源码rnrn[code=Delphi(Pascal)]rnrnprocedure TIdFTP.Get(const ASourceFile: string; ADest: TIdStream; AResume: Boolean = False);rnbeginrn //for SSL FXP, we have to do it here because InternalGet is used by the LIST commandrn //where SSCN is ignored.rn ClearSSCN;rn AResume := AResume and CanResume;rn ADest.Position := 0;rn InternalGet('RETR ' + ASourceFile, ADest, AResume);rnend;rnrnprocedure TIdFTP.Get(const ASourceFile, ADestFile: string; const ACanOverwrite: boolean = False;rn AResume: Boolean = false);rnvarrn LDestStream: TIdStream;rnbeginrnrn AResume := AResume and CanResume;rn if ACanOverwrite and (not AResume) then beginrn Sys.DeleteFile(ADestFile);rn LDestStream := TFileCreateStream.Create(ADestFile);rn endrnrn else beginrn if (not ACanOverwrite) and AResume thenrn beginrn LDestStream := TAppendFileStream.Create(ADestFile);rn endrn elsern beginrn raise EIdFTPFileAlreadyExists.Create(RSDestinationFileAlreadyExists);rn end;rn end;rnrn tryrn Get(ASourceFile, LDestStream, AResume);rn finallyrn Sys.FreeAndNil(LDestStream);rn end;rnend;rnrn[/code]rnrn我看了raise EIdFTPFileAlreadyExists.Create(RSDestinationFileAlreadyExists);之前的代码发现get方法的后两个boolean参数不能相同啊,即不能同时为true或false,不能既覆盖又重传(可以接受),不能不覆盖不重传,但默认的两个参数的值是两个false,这是怎么搞的嘛?rnrn还想问一个问题:TIdFTP如何支持sftp呢?我看它有这个属性FUsingSFTP : Boolean;但是它是只读属性,没办法啊。 论坛

vs2015 MVC5 使用带视图EF基架创建控制器时失败 Key already exists in table

12-25

基架为包含视图的MVC5控制器(使用Entity Framework),模型类Album,数据上下文类MusicStoreDB,控制器名称StoreManagerController,创建时提示key already exists in table。弄了一天实在没找到错,按MVC5高级编程书上抄的代码。总共三个类,Album, Artist, Genre:rnrn[code=csharp]rnusing System;rnusing System.Collections.Generic;rnusing System.Linq;rnusing System.Web;rnrnnamespace MusicStoreDemo.Modelsrnrn public class Albumrn rn public int AlbumId get; set; rn public string Title get; set; rn public decimal Price get; set; rn public string AlbumArtUrl get; set; rnrn public int ArtistId get; set; rn public virtual Artist Artist get; set; rn public int GenreId get; set; rn public virtual Genre Genre get; set; rn rnrn[/code]rn[code=csharp]rnusing System;rnusing System.Collections.Generic;rnusing System.Linq;rnusing System.Web;rnrnnamespace MusicStoreDemo.Modelsrnrn public class Artistrn rn public int ArtistId get; set; rn public string Name get; set; rn rnrn[/code]rn[code=csharp]rnusing System;rnusing System.Collections.Generic;rnusing System.Linq;rnusing System.Web;rnrnnamespace MusicStoreDemo.Modelsrnrn public class Genrern rn public int GenreId get; set; rn public string Name get; set; rn public string Description get; set; rnrn public virtual List Albums get; set; rn rnrn[/code]rn[img=https://img-bbs.csdn.net/upload/201512/25/1451033256_843058.jpg][/img]rn[img=https://img-bbs.csdn.net/upload/201512/25/1451033225_972794.jpg][/img] 论坛

没有更多推荐了,返回首页