Re: Managing database schema

2015-05-26 Thread andy . chambers
One problem we found with ragtime is that if multiple developers are 
working on a schema simultaneously, it's quite easy to get into a state 
where `lein ragtime migrate` will complain about finding a migration it 
doesn't expect. I think you can work around this by rolling back to the 
nearest common ancestor and then going forward again but it's just a bit of 
a speed bump to be aware of.

On Thursday, 14 May 2015 02:19:01 UTC-7, Gadzhi Musaev wrote:

 Have you looked at ragtime? Particularly it's sql.files library. As far as 
 I see, it will suit your needs.

 https://github.com/weavejester/ragtime

 On 14 May 2015 at 11:45, Colin Yates colin...@gmail.com javascript: 
 wrote:

 Is there a lib that will allow me to have my sql defined in a file which 
 I can reference from Clojure? I cannot use one of the existing migration 
 libraries as I need to do more than just manipulate SQL on a version 
 upgrade.

 I am aware of yesql which would be great but it didn't work out for DDL. 
 Specifically yesql seems to associate one block of sql for each name. I 
 want to have multiple blocks (e.g. a 'create table ...' as well as a number 
 of 'alter table create index idx_').

 I have tried embedding the sql as a string in the .clj file. This isn't 
 as painful as it might sound but is still painful enough.

 Any suggestions?

  -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com 
 javascript:
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+u...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Managing database schema

2015-05-15 Thread René Groß
I can suggest https://github.com/teropa/lein-flyway, which wraps the 
functionality of flyway into leiningen commands.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Managing database schema

2015-05-14 Thread Brett Morgan
I use clj-liquibase, https://github.com/kumarshantanu/clj-liquibase. It's a 
clojure wrapper for Liquibase.  There is a function to load schema changes 
(changeset) from a file, along with many other functions to create changesets 
for your schema. 

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Managing database schema

2015-05-14 Thread Gadzhi Musaev
Have you looked at ragtime? Particularly it's sql.files library. As far as
I see, it will suit your needs.

https://github.com/weavejester/ragtime

On 14 May 2015 at 11:45, Colin Yates colin.ya...@gmail.com wrote:

 Is there a lib that will allow me to have my sql defined in a file which I
 can reference from Clojure? I cannot use one of the existing migration
 libraries as I need to do more than just manipulate SQL on a version
 upgrade.

 I am aware of yesql which would be great but it didn't work out for DDL.
 Specifically yesql seems to associate one block of sql for each name. I
 want to have multiple blocks (e.g. a 'create table ...' as well as a number
 of 'alter table create index idx_').

 I have tried embedding the sql as a string in the .clj file. This isn't as
 painful as it might sound but is still painful enough.

 Any suggestions?

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Managing database schema

2015-05-14 Thread Colin Yates
Is there a lib that will allow me to have my sql defined in a file which I 
can reference from Clojure? I cannot use one of the existing migration 
libraries as I need to do more than just manipulate SQL on a version 
upgrade.

I am aware of yesql which would be great but it didn't work out for DDL. 
Specifically yesql seems to associate one block of sql for each name. I 
want to have multiple blocks (e.g. a 'create table ...' as well as a number 
of 'alter table create index idx_').

I have tried embedding the sql as a string in the .clj file. This isn't as 
painful as it might sound but is still painful enough.

Any suggestions?

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Managing database schema

2015-05-14 Thread Colin Yates
Thanks, I'll take a look

Sent from my iPhone

 On 14 May 2015, at 10:18, Gadzhi Musaev musaevgad...@gmail.com wrote:
 
 Have you looked at ragtime? Particularly it's sql.files library. As far as I 
 see, it will suit your needs.
 
 https://github.com/weavejester/ragtime
 
 On 14 May 2015 at 11:45, Colin Yates colin.ya...@gmail.com wrote:
 Is there a lib that will allow me to have my sql defined in a file which I 
 can reference from Clojure? I cannot use one of the existing migration 
 libraries as I need to do more than just manipulate SQL on a version upgrade.
 
 I am aware of yesql which would be great but it didn't work out for DDL. 
 Specifically yesql seems to associate one block of sql for each name. I want 
 to have multiple blocks (e.g. a 'create table ...' as well as a number of 
 'alter table create index idx_').
 
 I have tried embedding the sql as a string in the .clj file. This isn't as 
 painful as it might sound but is still painful enough.
 
 Any suggestions?
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Managing database schema

2015-05-14 Thread Stuart Sierra
You can put a .sql file in /resources and read it with 
clojure.java.io/resource.
–S


On Thursday, May 14, 2015 at 9:45:31 AM UTC+1, Colin Yates wrote:

 Is there a lib that will allow me to have my sql defined in a file which I 
 can reference from Clojure? I cannot use one of the existing migration 
 libraries as I need to do more than just manipulate SQL on a version 
 upgrade.

 I am aware of yesql which would be great but it didn't work out for DDL. 
 Specifically yesql seems to associate one block of sql for each name. I 
 want to have multiple blocks (e.g. a 'create table ...' as well as a number 
 of 'alter table create index idx_').

 I have tried embedding the sql as a string in the .clj file. This isn't as 
 painful as it might sound but is still painful enough.

 Any suggestions?



-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.