I am writting a Dockerfile where the entrypoint script checks if any *.sql file present inside initdb.d dir then it import that *.sql file. However as this import mechanism is a part of entrypoint script every time I restart the container the entrypoint script gets executed and the import happens again despite the sql file already imported which takes time. So is there anyway through which I can check that the sql file is already executed or imported so that time it is needed to skip the importing job.
In short how can I make something that will be imported only if the data is different than previous ? Does mysql dump contains any unique id ?