Permalink
Browse files

update lobos

  • Loading branch information...
1 parent 3a3b918 commit 6d59e778e19381d59d81d3a2a6d126fd0f25cca6 @sunng87 committed Apr 6, 2012
Showing with 21 additions and 10 deletions.
  1. +21 −10 src/lobos/migrations.clj
View
@@ -11,9 +11,7 @@
(create
(table :kusers (integer :id :primary-key :auto-inc)
(varchar :email 100 :unique)
- (timestamp :nextupdate)))
- (index :kusers [:email])
- (index :kusers [:nextupdate]))
+ (timestamp :nextupdate))))
(down []
(drop (table :kusers))))
@@ -29,14 +27,27 @@
(down []
(drop (table :karma))))
-(defmigration rename-user-table-timestamp
+
+
+
+(defmigration create-test-table
+ (up []
+ (create
+ (table :kk
+ (integer :hello))))
+ (down []
+ (drop (table :kk))))
+
+(defmigration rename-test-table
(up []
- (alter
- (table :kusers
- (column :nextupdate :to :lastupdate))))
+ (alter :rename
+ (table :kk
+ (column :hello :to :world))))
(down []
- (alter
- (table :kusers
- (column :lastupdate :to :nextupdate)))))
+ (alter :rename
+ (table :kk
+ (column :world :to :hello)))))
+
+

0 comments on commit 6d59e77

Please sign in to comment.