6

Developing on Postmill source code - getting started?

Submitted by WindTalk in Postmill

I want to try adding some new database fields and other experimental changes... so I'm starting to study the code structure.

The SQL table creation seems like something a code generator is publishing. The migrations: https://gitlab.com/edgyemma/Postmill/tree/master/src/Migrations

is there some specific IDE that generates these? Are you using a drag/drop user interface or something? How do you edit/compile/run cycle when developing the PHP + database logic?

Thank you!

Comments

You must log in or register to comment.

5

emma wrote (edited )

BORN TO DIE

WORLD IS A FUCK

鬼神 Kill Em All 1989

I am trash man

410,757,864,530 DEAD COPS

2

WindTalk wrote

Emma, quick question. Why did you go with a uuid for id on forum_subscriptions table as opposed to just a bigint like the id of submission_votes table?

2

emma wrote (edited )

BORN TO DIE

WORLD IS A FUCK

鬼神 Kill Em All 1989

I am trash man

410,757,864,530 DEAD COPS

2

WindTalk wrote (edited )

Thank you for taking the time to share. My thoughts are: UUID takes more storage, so RAM caching is going to be hit. And the overhead of doing the 'next number in sequence' is only on the insert, right? In this example, a user is going to be reading forum_subscription membership table every time they refresh their home page for new posts (reading from server RAM cache) - but inserts are very rare (joining a new forum)... so it seems to me the bigint has the greater advantage?

http://thebuild.com/blog/2015/10/08/uuid-vs-bigserial-for-primary-keys/

1

emma wrote (edited )

BORN TO DIE

WORLD IS A FUCK

鬼神 Kill Em All 1989

I am trash man

410,757,864,530 DEAD COPS

2

WindTalk wrote

The other advantage of UUID is multi-master replication. Independent servers can create new inserts while other servers are unreachable.

2

WindTalk wrote (edited )

Emma,

If you have a minute, can you review my changes. This is an attempt to add a new database field checkbox that clones the database layer of 'sticky'. It is named 'subhidden', a Boolean to do 'hidden submission'. The logic to act on this isn't added yet, I'm only trying to get the entry/edit forms behavior correct at this point.

https://gitlab.com/WakeRealityDev/Postmill/tree/AddDatabase0

The only problem (that I know of) that I'm having is I can't figure out how to populate the English translation. The system is showing messages implying I didn't set a phrase, and the HTML output doesn't show my translation. Ok, I figured out where to insert the translation phrase. translations/messages.en.yml Thank you.

2

emma wrote (edited )

BORN TO DIE

WORLD IS A FUCK

鬼神 Kill Em All 1989

I am trash man

410,757,864,530 DEAD COPS

2

WindTalk wrote (edited )

Emma,

I did a fresh git checkout and fresh PostgreSQL database creation. Via the front-end interface, I added a test category and submission. I have not modified the code at all yet. When I run:

bin/console doctrine:migrations:diff -q

It complains about existing issues off the current git code?

In AbstractPostgreSQLDriver.php line 76:
                                                                                                  
  An exception occurred while executing 'SELECT min_value, increment_by FROM "comments_id_seq"':  
                                                                                                  
  SQLSTATE[42703]: Undefined column: 7 ERROR:  column "min_value" does not exist                  
  LINE 1: SELECT min_value, increment_by FROM "comments_id_seq"                                   
                 ^                                                                                
                                                                                                  

In PDOConnection.php line 106:
                                                                                  
  SQLSTATE[42703]: Undefined column: 7 ERROR:  column "min_value" does not exist  
  LINE 1: SELECT min_value, increment_by FROM "comments_id_seq"                   
                 ^                                                                
                                                                                  

In PDOConnection.php line 104:
                                                                                  
  SQLSTATE[42703]: Undefined column: 7 ERROR:  column "min_value" does not exist  
  LINE 1: SELECT min_value, increment_by FROM "comments_id_seq"                   
                 ^ 
2

emma wrote (edited )

BORN TO DIE

WORLD IS A FUCK

鬼神 Kill Em All 1989

I am trash man

410,757,864,530 DEAD COPS