fukamachi / integral

[OBSOLETE] Use Mito instead.
https://github.com/fukamachi/mito
BSD 3-Clause "New" or "Revised" License
54 stars 3 forks source link

Migration時のエラーについて #37

Open yazc opened 9 years ago

yazc commented 9 years ago

スロットを追加した時にエラーが出たので報告します。

;; before
(defclass user ()
  ((slotA :type longtext
          :initarg :slotA
          :accessor slotA))
  (:metaclass <dao-table-class>))

;; after
(defclass user ()
  ((slot-Z :type (varchar 2048)
           :initarg :slot-Z
           :accessor slot-Z)
   (slot-A :type longtext
           :initarg :slot-A
           :accessor slot-A))
  (:metaclass <dao-table-class>))
> (migrate-table 'user)
ALTER TABLE `user` DROP COLUMN `slota`;
ALTER TABLE `user` ADD COLUMN `slot_a` LONGTEXT AFTER `slot_z`, ADD COLUMN `slot_z` VARCHAR(2048) AFTER `%oid`;
DB Error: Unknown column 'slot_z' in 'user' (Code: 1054)
   [Condition of type DBI.ERROR:<DBI-PROGRAMMING-ERROR>]
rudolph-miller commented 9 years ago

Reportありがとうございます. ALTER TABLE文の流す順番みたいですね.