Re: [git-users] How to track changes to db

2020-08-06 Thread rhkramer
On Wednesday, August 05, 2020 07:43:53 PM SJW wrote:
> On Wednesday, 5 August 2020 at 23:15:49 UTC+10 rhkr...@gmail.com wrote:
> > Interesting puzzle ;-)
> > 
> > Do you create one file named feature.txt, or do you create a different
> > file for
> > each feature with a unique name?
> > 
> > (I'm trying to understand "all these text files" from below.)
> > 
> > One thing I'd consider is just having one file named feature.txt, or
> > notes.txt
> > and modify that as appropriate and commit it with each change.
> > 
> > Then when you checkout a feature branch, you get the notes (DB ALTER
> > statements) associated with that feature, and it stays associated with
> > that
> > feature branch.
> > 
> > You could choose another name for the text file, perhaps: db_alter.txt
> 
> I have a different file for each feature - problem is, when I merge the
> feature and delete the branch, the notes get merged so if I have 5 feature
> branchs, I end up with 5 rogue feature.txt files

I guess you mean you have a .txt file for each feature, each with a 
different name.

In retrospect (retrospect is easy ;-), not the way I'd do it.

I don't know how big your repository is and how hard / time consuming it would 
be to go back and rename each of those .txt files with the same name, 
and then, as discussed earlier, merge those files at the same time you merge 
the features.

(E.g., you probably don't need this, but to clarify: you might have a file sort 
of like a history file (probably in reverse chronological sequence?)>:

(e.g.) file features.txt

 Feature 




...

 Feature 




Now that you're in the present condition, I don't have another suggestion to 
offer.












Re: [git-users] How to track changes to db

2020-08-05 Thread SJW


On Thursday, 6 August 2020 at 06:59:28 UTC+10 Magnus Therning wrote:

>
> SJW  writes: 
>
> > I'm not sure I understand exactly what it is you are talling about 
>
> As I mentioned, I'm not sure I understand your question... anyway, it 
> might be worthwhile looking into migrations since it sounds like you're 
> doing a lot of manual changes to DB schemas and trying to keep track of 
> them. 
>

Example. I developed integration with a cloud storage service.  I created a 
txt file for this feature and in it contained:

1. Instructions on how to generate the API key required to communicate with 
the cloud server
2. The new database tables created in dev that need to be replicated in 
staging and production
3. Limitations of the integration that may need to be addressed in the 
future.
 

>
> Here's what looks like a decent introduction to database migrations: 
> https://rollout.io/blog/database-migration/ 
>
> I'm sure there's a library to do that in whatever language you are 
> comfortable with. Some examples: 
>
> - Python: https://pypi.org/project/yoyo-migrations/ 
> - Ruby: https://github.com/winebarrel/ridgepole 
> - Java: https://github.com/liquibase/liquibase 
> - Go: https://github.com/golang-migrate/migrate 
>
> and there are command line tools for it as well 
>
> - https://github.com/golang-migrate/migrate 
> - https://github.com/aphel-bilisim-hizmetleri/pg-migrator 
>
> /M 
>
> -- 
> Magnus Therning OpenPGP: 0x927912051716CE39 
> email: 
> twitter: magthe http://magnus.therning.org/ 
>
> Reality is that which, when you stop believing in it, doesn't go away. 
> — Philip K. Dick 
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/ef8ffcca-0e35-47aa-9fb9-fe7de0f28d75n%40googlegroups.com.


Re: [git-users] How to track changes to db

2020-08-05 Thread SJW


On Wednesday, 5 August 2020 at 23:15:49 UTC+10 rhkr...@gmail.com wrote:

> On Tuesday, August 04, 2020 10:34:59 PM SJW wrote: 
> > I am trying to find a good way to track changes to the db but havn't got 
> it 
> > down pat yet. 
> > 
> > What I am doing 
> > 
> > ``` 
> > git branch feature 
> > git checkout feature 
> > ``` 
> > 
> > modify code and add/modify database tables 
> > ... 
> > create a txt file called feature.txt and list changes. e.g. DB ALTER 
> > statements etc. that I need to apply to staging and production db's 
>
> Interesting puzzle ;-) 
>
> Do you create one file named feature.txt, or do you create a different 
> file for 
> each feature with a unique name? 
>
> (I'm trying to understand "all these text files" from below.) 
>
> One thing I'd consider is just having one file named feature.txt, or 
> notes.txt 
> and modify that as appropriate and commit it with each change. 
>
> Then when you checkout a feature branch, you get the notes (DB ALTER 
> statements) associated with that feature, and it stays associated with 
> that 
> feature branch. 
>
> You could choose another name for the text file, perhaps: db_alter.txt 
>
>  
I have a different file for each feature - problem is, when I merge the 
feature and delete the branch, the notes get merged so if I have 5 feature 
branchs, I end up with 5 rogue feature.txt files  

I started with just database.sql and I would export the structure on each 
environment and then just compare but when I started using git push, the 
compare became redundant  
 

>
> > ... 
> > 
> > ``` 
> > git add . 
> > git commit -m "Message" 
> > git checkout staging 
> > git merge feature 
> > git checkout master 
> > git merge feature 
> > ``` 
> > 
> > Problem I have is that I have all these txt files that are just notes so 
> I 
> > delete them but they keep reappearing ( because I merged them into 
> master 
> > and then create new branch etc. ) 
> > 
> > I found this was a bit annoying so I stopped adding and committing the 
> txt 
> > files but now I have these txt files sitting in the unstaged changes 
> area 
> > of all projects - not a great idea either. 
> > 
> > Any suggestions on how to better manage these notes and somehow ensure 
> they 
> > remain linked to each feature branch? 
> > 
> > Thanks 
>

 

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/dd9db861-ad67-4609-a9f3-7057cbc3afd1n%40googlegroups.com.


Re: [git-users] How to track changes to db

2020-08-05 Thread SJW
>> Can you please explain whet do you want to do with the feature.txt 
files? Do you want to versioncontol them or not at all or just separate 
them but somehow link them together with the repo? what's the purpose of 
these files?   

They are my notes - things that need to be considered when the feature goes 
live. Things outside of php files or even just things to be aware of of.
On Wednesday, 5 August 2020 at 21:14:24 UTC+10 alexa...@gmail.com wrote:

> Hey,
>
> Can you please explain whet do you want to do with the feature.txt files? 
> Do you want to versioncontol them or not at all or just separate them but 
> somehow link them together with the repo? what's the purpose of these 
> files? 
>
> Best,
> s
>
> On Wed, Aug 5, 2020, 13:02 SJW  wrote:
>
>> I'm not sure I understand exactly what it is you are talling about
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Git for human beings" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to git-users+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/git-users/1b25b65b-a304-454f-a5e4-be08d6d1f506o%40googlegroups.com
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/ae6791b9-1a9e-4826-91bc-03a1bc339f29n%40googlegroups.com.


Re: [git-users] How to track changes to db

2020-08-05 Thread Magnus Therning

SJW  writes:

> I'm not sure I understand exactly what it is you are talling about

As I mentioned, I'm not sure I understand your question... anyway, it
might be worthwhile looking into migrations since it sounds like you're
doing a lot of manual changes to DB schemas and trying to keep track of
them.

Here's what looks like a decent introduction to database migrations:
https://rollout.io/blog/database-migration/

I'm sure there's a library to do that in whatever language you are
comfortable with. Some examples:

- Python: https://pypi.org/project/yoyo-migrations/
- Ruby: https://github.com/winebarrel/ridgepole
- Java: https://github.com/liquibase/liquibase
- Go: https://github.com/golang-migrate/migrate

and there are command line tools for it as well

- https://github.com/golang-migrate/migrate
- https://github.com/aphel-bilisim-hizmetleri/pg-migrator

/M

--
Magnus Therning  OpenPGP: 0x927912051716CE39
email: mag...@therning.org
twitter: magthe  http://magnus.therning.org/

Reality is that which, when you stop believing in it, doesn't go away.
 — Philip K. Dick

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87v9hwdd1u.fsf%40therning.org.


signature.asc
Description: PGP signature


Re: [git-users] How to track changes to db

2020-08-05 Thread rhkramer
On Tuesday, August 04, 2020 10:34:59 PM SJW wrote:
> I am trying to find a good way to track changes to the db but havn't got it
> down pat yet.
> 
> What I am doing
> 
> ```
> git branch feature
> git checkout feature
> ```
> 
> modify code and add/modify database tables
> ...
> create a txt file called feature.txt and list changes. e.g. DB ALTER
> statements etc. that I need to apply to staging and production db's

Interesting puzzle ;-)

Do you create one file named feature.txt, or do you create a different file for 
each feature with a unique name?

(I'm trying to understand "all these text files" from below.)

One thing I'd consider is just having one file named feature.txt, or notes.txt 
and modify that as appropriate and commit it with each change.  

Then when you checkout a feature branch, you get the notes (DB ALTER 
statements) associated with that feature, and it stays associated with that 
feature branch.  

You could choose another name for the text file, perhaps: db_alter.txt



> ...
> 
> ```
> git add .
> git commit -m "Message"
> git checkout staging
> git merge feature
> git checkout master
> git merge feature
> ```
> 
> Problem I have is that I have all these txt files that are just notes so I
> delete them but they keep reappearing ( because I merged them into master
> and then create new branch etc. )
> 
> I found this was a bit annoying so I stopped adding and committing the txt
> files but now I have these txt files sitting in the unstaged changes area
> of all projects - not a great idea either.
> 
> Any suggestions on how to better manage these notes and somehow ensure they
> remain linked to each feature branch?
> 
> Thanks


Re: [git-users] How to track changes to db

2020-08-05 Thread Alexandra Vass
Hey,

Can you please explain whet do you want to do with the feature.txt files?
Do you want to versioncontol them or not at all or just separate them but
somehow link them together with the repo? what's the purpose of these
files?

Best,
s

On Wed, Aug 5, 2020, 13:02 SJW  wrote:

> I'm not sure I understand exactly what it is you are talling about
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/git-users/1b25b65b-a304-454f-a5e4-be08d6d1f506o%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CAErL4gi4LZkHePeY9P2S3b%2ByMTxf2eaWUZxCB6VCh9FOry90uA%40mail.gmail.com.


Re: [git-users] How to track changes to db

2020-08-05 Thread SJW
I'm not sure I understand exactly what it is you are talling about

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/1b25b65b-a304-454f-a5e4-be08d6d1f506o%40googlegroups.com.


Re: [git-users] How to track changes to db

2020-08-05 Thread Magnus Therning


SJW  writes:

> I am trying to find a good way to track changes to the db but havn't
> got it down pat yet.
>
> What I am doing
>
> ```
> git branch feature
> git checkout feature
> ```
>
> modify code and add/modify database tables
> ...
> create a txt file called feature.txt and list changes. e.g. DB ALTER
> statements etc. that I need to apply to staging and production db's
> ...
>
> ```
> git add .
> git commit -m "Message"
> git checkout staging
> git merge feature
> git checkout master
> git merge feature
> ```
>
> Problem I have is that I have all these txt files that are just notes
> so I delete them but they keep reappearing ( because I merged them
> into master and then create new branch etc. )
>
> I found this was a bit annoying so I stopped adding and committing the
> txt files but now I have these txt files sitting in the unstaged
> changes area of all projects - not a great idea either.
>
> Any suggestions on how to better manage these notes and somehow ensure
> they remain linked to each feature branch?

I'm not sure I understand exactly what it is you are doing, but it
sounds a bit like you are trying to keep track of manual changes you
make manually in a DB. Have you looked at making use of a
library/framework for migrations instead?

/M

--
Magnus Therning  OpenPGP: 0x927912051716CE39
email: mag...@therning.org
twitter: magthe  http://magnus.therning.org/

Action is the foundational key to all success.
 — Pablo Picasso

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87y2mtcynf.fsf%40therning.org.