Giter Site home page Giter Site logo

maven-db-plugin's People

Watchers

 avatar  avatar

maven-db-plugin's Issues

Execution support and multiple databases?

May be in the future could support execution in phase support and multiple 
databases??

Currently there is no plugin that support multiple databases to do the exact of 
this plugin does. If you need any help, please let me know!

Thanks
Jorge


Original issue reported on code.google.com by [email protected] on 2 Aug 2011 at 1:31

Can't skip execution...

I don't see a way to skip execution.... Most plugins have a "skip" property 
that will allow you to configure a property or just configure an execution 
through a profile to skip the execution of a plugins's goals.  This makes it 
very difficult to have a way for users to skip execution of the database steps 
if needed without commenting out sections of the pom file.  Please correct me 
if I'm wrong, but I don't see anything in the documentation about this.

Original issue reported on code.google.com by [email protected] on 9 Jul 2013 at 4:07

Plugin always uses the sql/data dir for scripts, regardless of the goal

What steps will reproduce the problem?
1. put a script in the schema dir
2. execute mvn db:schema
3.

What is the expected output? What do you see instead?
should execute the script in the schema dir, but searches in the (empty) data 
dir instead

What version of the product are you using? On what operating system?
using version 1.3

Please provide any additional information below.
same thing if executed out of eclipse run configurations


Original issue reported on code.google.com by [email protected] on 22 Nov 2011 at 2:07

Work with BOM unicode files

The plugin can't work with unicode wile which start with BOM index. There is 
easy solution how to solve this problem. The comons-io (which is used in 
project) have ability to work with this type of files.

Changes in pom.xml
@@ -70,11 +70,11 @@
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
-                                       <source>1.4</source>
-                                       <target>1.4</target>
+                                       <source>1.6</source>
+                                       <target>1.6</target>
                                </configuration>
                        </plugin>
@@ -99,7 +99,7 @@
                <dependency>
                        <groupId>commons-io</groupId>
                        <artifactId>commons-io</artifactId>
-                       <version>1.3.1</version>
+                       <version>2.4</version>
                </dependency>

Changes in AbstractDBMojo.java:
@@ -19,6 +19,8 @@
 import java.util.List;
 import java.util.zip.GZIPInputStream;

+import org.apache.commons.io.ByteOrderMark;
+import org.apache.commons.io.input.BOMInputStream;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -233,14 +240,13 @@

         // check encoding
         checkEncoding();
-
+
         // our file reader
-        Reader reader;
-        reader = new InputStreamReader(ips, scriptEncoding);
-
+        Reader reader = inputStreamToReaderBOM(ips);
+
         // create SQL Statement
         Statement st = con.createStatement();
-
+
         StringBuffer sql = new StringBuffer();
         String line;
         BufferedReader in = new BufferedReader(reader);
@@ -323,17 +328,16 @@
             ips = new GZIPInputStream(ips);
             getLog().info(" file is gz compressed, using gzip stream");
         }
-
+
         // check encoding
         checkEncoding();
-
+
         // our file reader
-        Reader reader;
-        reader = new InputStreamReader(ips, scriptEncoding);
-
+        Reader reader = inputStreamToReaderBOM(ips);
+
         // create SQL Statement
         Statement st = con.createStatement();
-
+
         StringBuffer sql = new StringBuffer();
         String line;
         BufferedReader in = new BufferedReader(reader);


+
+    private Reader inputStreamToReaderBOM(InputStream in) throws IOException {
+        BOMInputStream bOMInputStream = new BOMInputStream(in,
+            ByteOrderMark.UTF_16LE, ByteOrderMark.UTF_16BE,
+            ByteOrderMark.UTF_32LE, ByteOrderMark.UTF_32BE);
+        ByteOrderMark bom = bOMInputStream.getBOM();
+
+        String charsetName = bom == null ? scriptEncoding : 
bom.getCharsetName();
+
+        return new InputStreamReader(new BufferedInputStream(bOMInputStream), 
charsetName);
+    }
+


Original issue reported on code.google.com by [email protected] on 2 Feb 2015 at 7:00

Does the plugin maintain the changelog

I am planning to use this plugin and so had a very basic question about its 
usage - may be just a qucik FAQ to add.

Lets say, we have a existing database with pre-loaded data

1. Should we place Database dump @ - schema scripts i.e src/main/sql/schema


2. Everytime we run db-create it will override the database?


3. Let's suppose we need to add one more column in some x table, where should 
we keep that update x.sql script? I guess in update scripts i.e in 
src/main/sql/update ?

4. If yes, does everytime we run mvn db:update, it will execute all the scripts 
there? 

5. This will cause DB errors, like adding same column again and again?

6. Let's suppose we need to add more seed-data in some x table, where should we 
keep that x-data.sql? I guess in data scripts i.e in src/main/sql/data?

7. If yes, will same problem as 4 & 5 will occur again?


In nutshell, does the plugin maintain the changelog or handle what is updated 
and what is not? So that next time goal runs nothing fails?

I would love to use this plugin and try if I get above usage explained.

Original issue reported on code.google.com by [email protected] on 23 Apr 2015 at 6:16

Scripts encoding

I found your maven-db-plugin very useful, but there is no setting for encoding 
of sql scripts files.

Some people (like me) are needed to set for example UTF-8 for reading of these 
files.

I've explored your code and added optional scriptsEncoding setting locally. Now 
it works fine with encoding.

Here is a patch attached for adding this setting.

Please add these changes and deploy new version to repository.

Thanks a lot!

Roman

Original issue reported on code.google.com by [email protected] on 14 May 2013 at 7:06

Attachments:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.