OpenSourceCommerce / log-explorer

5 stars 7 forks source link

Need of console command to create pre-defined tables #130

Closed SirUrban closed 2 years ago

SirUrban commented 3 years ago

As we want to be able to automatically install log-explorer in our customer projects we do need a console command to create the needed tables. Parameters should be:

Example:

./bin/console app:createtable -n apache_access --fields=status:Int16,method:String,size:Int16,size:Int16,referrer:String

The format of the params may be changed - choose what fits best for you. This should work the same way as if you create a table in log-explorer UI. May be you need additional params like lifetime?

nhatdo-nfq commented 3 years ago

Description:

Create new table.

Example php bin/console app:createtable apache_access -f status:Int16 -f method:String -f size:Int16 -f referer:String -f createdAt:DateTime --ttl='timestamp:3:MONTH'

Usage:

app:createtable [options] [--] []

Arguments: name Table name

Options: -f, --fields=FIELDS Table column. status:Int16 (multiple values allowed) -t, --ttl[=TTL] Time to life {column_name}:{interval}:{type} Ex: timestamp:3:month -> "TTL timestamp + INTERVAL 3 MONTH"

SirUrban commented 2 years ago

@nhatdo-nfq Can you please add the content of your last comment to the README file?