Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Database not properly merge with version control (git)
Forum Updated to NodeBB v4.3 + New Features

[Solved] Database not properly merge with version control (git)

Scheduled Pinned Locked Moved General and Desktop
11 Posts 2 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hareen Laks
    wrote on last edited by
    #1

    Hi all,

    I'm not sure this is proper place to ask this question. If not please forgive me.
    But I hope some one can help me.

    I'm using Qt Creator 4.7, SQLITE 3.3.55.2206 and git 1.7.11.msysgit.1.

    Normally I follow below steps.

    1. Coding
    2. Update DBs
    3. Commit changes
    4. pull from git repository
    5. push my changes

    4th step is problematic. After pull all the local changes (mine) to the database vanish.

    In other words, can not properly manage the database updates with git. I search for solution, and some site says git regard DB file as binary file and pull causes to overwrite the existing one.

    Are there any solution?

    Thanking you.

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      [quote]I’m not sure this is proper place to ask this question. If not please forgive me.[/quote]It's not the right place because this is not related to Qt or Qt Creator, but we're happy to help with small, once-off issues :) (just don't do it too often)

      [quote]some site says git regard DB file as binary file and pull causes to overwrite the existing one.[/quote]That's correct. Git is for managing changes to your source code; it is not for managing databases.

      You should separate your database from your source code, and let git manage your source code only.

      What's in your database?

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Hareen Laks
        wrote on last edited by
        #3

        Thanks JKSH..

        I don't do it again :) sorry.

        My application handling some sort of item collection of a company. Database consist the items with their details.

        Thanks again..

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          That's ok :)

          Why did you want to put that database in git?

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • H Offline
            H Offline
            Hareen Laks
            wrote on last edited by
            #5

            I'm one member of development team. Each one need to read/write from/to database. So we put the database in to git.

            We can not use the centralized location inside LAN because some members are working outside of the country. And according to our App database should exist locally.

            Thank you.

            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              [quote]I’m one member of development team. Each one need to read/write from/to database. So we put the database in to git.

              We can not use the centralized location inside LAN because some members are working outside of the country.[/quote]http://en.wikipedia.org/wiki/Virtual_private_network

              [quote]And according to our App database should exist locally.[/quote]Why?

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • H Offline
                H Offline
                Hareen Laks
                wrote on last edited by
                #7

                We asked for VPN from administration still haven't replied. :( Then we gave up the idea.

                This application going to deliver to the customers of the company. So we are not going give them access to the server. Local DB preferred.

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  Hareen Laks
                  wrote on last edited by
                  #8

                  I think you are asking for handle the code using git and make the Db as centralized? isn't it?

                  Then I have a question how can we versioning the Db?

                  Thanks for replying me.

                  1 Reply Last reply
                  0
                  • JKSHJ Offline
                    JKSHJ Offline
                    JKSH
                    Moderators
                    wrote on last edited by
                    #9

                    [quote]This application going to deliver to the customers of the company. So we are not going give them access to the server. Local DB preferred.[/quote]That's a good point.

                    [quote]I think you are asking for handle the code using git and make the Db as centralized? isn’t it?[/quote]Yes, that was my original idea because git cannot merge/fork a SQLITE file. I was thinking you could use a centralized database during development and then export the data into an SQLITE file when you ship it to your customer.

                    However, I did some Googling, and found out that my original idea isn't very good. Sorry about that.

                    [quote]Then I have a question how can we versioning the Db?[/quote]http://stackoverflow.com/questions/115369/do-you-use-source-control-for-your-database-items Other developers recommend putting your database scripts in version control. Scripts are like source code, so git can handle them.

                    Your team should edit the scripts, not the database itself. Then, when you are ready to test/deploy, generate the database from the scripts.

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    1 Reply Last reply
                    0
                    • H Offline
                      H Offline
                      Hareen Laks
                      wrote on last edited by
                      #10

                      Dear JKSH,

                      Thank you very much for the support.

                      I'll discuss this idea with my team.

                      Thank you again.

                      1 Reply Last reply
                      0
                      • JKSHJ Offline
                        JKSHJ Offline
                        JKSH
                        Moderators
                        wrote on last edited by
                        #11

                        You're welcome. All the best.

                        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved