├── .DS_Store ├── .github └── FUNDING.yml ├── .gitignore ├── CONTRIBUTE.md ├── LICENSE.md ├── README.md ├── composer.json ├── composer.lock ├── rector.php └── src ├── .DS_Store ├── Commands ├── GedcomExporter.php └── GedcomImporter.php ├── Events └── GedComProgressSent.php ├── Facades ├── GedcomExpFacade.php └── GedcomParserFacade.php ├── Models ├── Addr.php ├── Author.php ├── Chan.php ├── Citation.php ├── Event.php ├── Family.php ├── FamilyEvent.php ├── FamilySlgs.php ├── ImportJob.php ├── MediaObject.php ├── MediaObjeectFile.php ├── Note.php ├── Person.php ├── PersonAlia.php ├── PersonAnci.php ├── PersonAsso.php ├── PersonDesi.php ├── PersonEvent.php ├── PersonLds.php ├── PersonName.php ├── PersonNameFone.php ├── PersonNameRomn.php ├── PersonSubm.php ├── Place.php ├── Publication.php ├── Refn.php ├── Repository.php ├── Source.php ├── SourceData.php ├── SourceDataEven.php ├── SourceRef.php ├── SourceRefEven.php ├── SourceRepo.php ├── Subm.php └── Subn.php ├── Observers └── EventActionsObserver.php ├── ServiceProvider.php ├── Utils ├── DateParser.php ├── FamilyData.php ├── GedcomGenerator.php ├── GedcomParser.php ├── GedcomWriter.php ├── Importer │ ├── Addr.php │ ├── Caln.php │ ├── Chan.php │ ├── Date.php │ ├── Fam │ │ ├── Even.php │ │ └── Slgs.php │ ├── Indi │ │ ├── Alia.php │ │ ├── Anci.php │ │ ├── Asso.php │ │ ├── Desi.php │ │ ├── Even.php │ │ ├── Even │ │ │ └── Plac.php │ │ ├── Lds.php │ │ ├── Name.php │ │ ├── Name │ │ │ ├── Fone.php │ │ │ └── Romn.php │ │ └── Subm.php │ ├── Note.php │ ├── NoteRef.php │ ├── Obje.php │ ├── ObjeRef.php │ ├── ObjeRef │ │ └── File.php │ ├── Phon.php │ ├── Refn.php │ ├── Repo.php │ ├── RepoRef.php │ ├── Sour.php │ ├── Sour │ │ ├── Data.php │ │ ├── Data │ │ │ └── Even.php │ │ └── Repo.php │ ├── SourRef.php │ ├── SourRef │ │ └── Even.php │ ├── Subm.php │ └── Subn.php ├── ParentData.php ├── exporter │ ├── Addr.php │ ├── Caln.php │ ├── Chan.php │ ├── Date.php │ ├── Fam │ │ ├── Even.php │ │ └── Slgs.php │ ├── Indi │ │ ├── Alia.php │ │ ├── Anci.php │ │ ├── Asso.php │ │ ├── Desi.php │ │ ├── Even.php │ │ ├── Even │ │ │ └── Plac.php │ │ ├── Lds.php │ │ ├── Name.php │ │ ├── Name │ │ │ ├── Fone.php │ │ │ └── Romn.php │ │ └── Subm.php │ ├── Note.php │ ├── NoteRef.php │ ├── Obje.php │ ├── ObjeRef.php │ ├── ObjeRef │ │ └── File.php │ ├── Phon.php │ ├── Refn.php │ ├── Repo.php │ ├── RepoRef.php │ ├── Sour.php │ ├── Sour │ │ ├── Data.php │ │ ├── Data │ │ │ └── Even.php │ │ └── Repo.php │ ├── SourRef.php │ ├── SourRef │ │ └── Even.php │ ├── Subm.php │ └── Subn.php ├── otherFamRecord.php └── otherFields.php ├── factories ├── AddrFactory.php ├── AuthorFactory.php ├── ChanFactory.php ├── CitationFactory.php ├── EventFactory.php ├── FamilyEventFactory.php ├── FamilyFactory.php ├── FamilySlgsFactory.php ├── ImportJobFactory.php ├── MediaObjectFactory.php ├── MediaObjectFileFactory.php ├── NoteFactory.php ├── PersonAliaFactory.php ├── PersonAnciFactory.php ├── PersonAssoFactory.php ├── PersonDesiFactory.php ├── PersonEventFactory.php ├── PersonFactory.php ├── PersonLdsFactory.php ├── PersonNameFactory.php ├── PersonNameFoneFactory.php ├── PersonNameRomnFactory.php ├── PersonSubmFactory.php ├── PlaceFactory.php ├── PublicationFactory.php ├── RefnFactory.php ├── RepositoryFactory.php ├── SourceDataEvenFactory.php ├── SourceDataFactory.php ├── SourceFactory.php ├── SourceRefEvenFactory.php ├── SourceRefFactory.php ├── SourceRepoFactory.php ├── SubmFactory.php └── SubnFactory.php └── migrations ├── 2020_01_01_120000_create_default_people_table.php ├── 2020_04_10_154637_create_citations_table.php ├── 2020_04_10_154850_create_families_table.php ├── 2020_04_10_155019_create_notes_table.php ├── 2020_04_10_155134_create_places_table.php ├── 2020_04_10_155307_create_repositories_table.php ├── 2020_04_10_155413_create_sources_table.php ├── 2020_04_10_171030_create_types_table.php ├── 2020_04_24_211718_create_authors_table.php ├── 2020_04_24_211852_create_publications_table.php ├── 2020_06_01_112223_create_persons_events_table.php ├── 2020_06_01_112242_create_family_events_table.php ├── 2020_06_01_112312_update_events_add_timestamp.php ├── 2020_06_03_192100_add_columns_for_people_table.php ├── 2020_06_11_150000_update_add_columns_person_events_table.php ├── 2020_06_11_152802_update_description_default_places_table.php ├── 2020_06_11_173643_update_add_columns_people_table.php ├── 2020_06_11_175726_update_add_columns_family_table.php ├── 2020_06_12_173700_create_subns_table.php ├── 2020_06_12_190711_create_subm_table.php ├── 2020_06_13_003901_create_media_objects_table.php ├── 2020_06_23_031852_create_importjobs_table.php ├── 2020_06_24_084354_create_sourcedata_table.php ├── 2020_06_24_085159_create_source_data_even_table.php ├── 2020_06_24_090326_create_sourceref_even_table.php ├── 2020_06_24_092055_create_person_alia_table.php ├── 2020_06_24_093608_create_person_asso_table.php ├── 2020_06_24_094758_create_person_subm_table.php ├── 2020_06_24_095241_create_person_anci_table.php ├── 2020_06_24_103355_create_refn_table.php ├── 2020_06_24_105140_create_person_lds_table.php ├── 2020_06_24_135407_create_chans_table.php ├── 2020_06_25_040418_create_family_slgs_table.php ├── 2020_06_25_052028_create_addrs_table.php ├── 2020_08_21_100421_create_personname_table.php ├── 2020_08_21_110811_create_person_name_fone_table.php ├── 2020_08_21_111106_create_person_name_romn_table.php ├── 2020_08_21_124830_create_source_ref_table.php ├── 2020_08_30_035717_create_media_objects_file_table.php ├── 2020_08_31_092310_create_source_repo_table.php ├── 2020_09_12_000100_update_person_events_table.php ├── 2020_09_12_151600_add_column_for_media_objects_table.php ├── 2020_10_13_093608_create_person_desi_table.php ├── 2021_05_28_121021_add_index_key_people_table.php ├── 2021_05_28_121232_add_index_key_person_event_table.php ├── 2021_05_28_122429_add_index_key_person_name_table.php ├── 2021_08_25_031507_set_string_column_husband_id_and_wife_id_to_families_table.php ├── 2021_08_25_121115_add_column_birth_year_and_death_year_to_people_table.php ├── 2021_08_25_155050_add_column_burialday_and_burial_year_to_people_table.php ├── 2021_08_25_173355_drop_column_chan_to_people_table.php ├── 2021_08_25_173444_add_column_chan_to_people_table.php ├── 2021_08_26_203720_remove_column_chan_to_people_table.php ├── 2021_08_26_203800_add_microsecond_in_column_chan_to_people_table.php ├── 2021_08_26_222539_add_column_dati_plac_famc_fams_to_people_table.php ├── 2021_08_27_183956_add_column_month_to_people_table.php └── 2021_08_27_192146_add_column_titl_and_chr_to_people_table.php /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cgdsoftware/laravel-gedcom/2b839a2a44e8349eb37e78d1649362aa01a21f64/.DS_Store -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: familytree365 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | vendor/ 3 | -------------------------------------------------------------------------------- /CONTRIBUTE.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. We accept contributions via Pull Requests on [Github](https://github.com/familytree365/laravel-gedcom). 4 | 5 | ## Pull Requests 6 | 7 | - **[PSR-4 Coding Standard.]** The easiest way to apply the conventions is to install [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer). 8 | - **Document any change in behaviour.** Make sure the `README.md` and any other relevant documentation are kept up-to-date. 9 | - **Create feature branches.** Don't ask us to pull from your master branch. 10 | - **One pull request per feature.** If you want to do more than one thing, send multiple pull requests. 11 | - **Send coherent history.** Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2020 Alexander Mills (alex@asdfx.us) 2 | Copyright 2020 Genealogia Ltd 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cgdprojects/laravel-gedcom", 3 | "description": "A package that converts gedcom files to Eloquent models", 4 | "type": "library", 5 | "require": { 6 | "php": ">=8.0", 7 | "cgdprojects/php-gedcom": "^1.4", 8 | "doctrine/dbal": "^2.8|^3.0" 9 | }, 10 | "license": "MIT", 11 | "autoload": { 12 | "psr-4": { 13 | "FamilyTree365\\LaravelGedcom\\": "src" 14 | } 15 | }, 16 | "extra": { 17 | "laravel": { 18 | "providers": [ 19 | "FamilyTree365\\LaravelGedcom\\ServiceProvider" 20 | ] 21 | } 22 | }, 23 | "require-dev": { 24 | "rector/rector": "^0.11.49" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rector.php: -------------------------------------------------------------------------------- 1 | import(SetList::PHP_80); 11 | // get parameters 12 | $parameters = $containerConfigurator->parameters(); 13 | 14 | // Define what rule sets will be applied 15 | $containerConfigurator->import(SetList::DEAD_CODE); 16 | 17 | // get services (needed for register a single rule) 18 | // $services = $containerConfigurator->services(); 19 | 20 | // register a single rule 21 | // $services->set(TypedPropertyRector::class); 22 | }; 23 | -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cgdsoftware/laravel-gedcom/2b839a2a44e8349eb37e78d1649362aa01a21f64/src/.DS_Store -------------------------------------------------------------------------------- /src/Commands/GedcomExporter.php: -------------------------------------------------------------------------------- 1 | argument('filename').'.GED'; 47 | 48 | $file_path = $dir.'/'.$filename; 49 | 50 | if (!file_exists($dir)) { 51 | Storage::makeDirectory($dir); 52 | } 53 | 54 | $query = DB::table('subms'); 55 | $query->join('addrs', 'addrs.id', '=', 'subms.addr_id'); 56 | $query->select([ 57 | 'subms.name', 58 | 'addrs.adr1', 59 | 'addrs.adr2', 60 | 'addrs.city', 61 | 'addrs.stae', 62 | 'addrs.post', 63 | 'addrs.ctry', 64 | 'subms.phon', 65 | ])->get(); 66 | 67 | $people = Person::all(); 68 | $submissions = $query->get(); 69 | 70 | $data = [ 71 | 'submissions' => $submissions, 72 | 'people' => $people, 73 | ]; 74 | 75 | $source = View::make('stubs.ged', $data)->render(); 76 | 77 | $ged_doc = "HEAD \nGEDC \nVERS 5.5.5 \nFORM LINEAGE-LINKED \nVERS 5.5.5 \nCHAR UTF-8 \nSOUR GS \nVERS 5.5.5 \nCORP gedcom.org\n"; 78 | 79 | $handle = fopen($filename, 'w'); 80 | 81 | fputs($handle, $ged_doc.$source); 82 | 83 | fclose($handle); 84 | 85 | $headers = [ 86 | 'Content-Type' => 'text/ged', 87 | ]; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/Commands/GedcomImporter.php: -------------------------------------------------------------------------------- 1 | argument('filename'); 42 | GedcomParserFacade::parse('mysql', $filename, true, true); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Events/GedComProgressSent.php: -------------------------------------------------------------------------------- 1 | 'gedcom-progress', 'eventName' => 'newMessage'] 34 | ) { 35 | $this->slug = $slug; 36 | $this->total = $total; 37 | $this->complete = $complete; 38 | $this->queue = 'low'; 39 | 40 | $this->channel = $channel; 41 | } 42 | 43 | /** 44 | * Get the data to broadcast. 45 | * 46 | * @return array 47 | */ 48 | public function broadcastWith() 49 | { 50 | return [ 51 | 'slug' => $this->slug, 52 | 'total' => $this->total, 53 | 'complete' => $this->complete, 54 | ]; 55 | } 56 | 57 | /** 58 | * Get the channels the event should broadcast on. 59 | * 60 | * @return Channel|array 61 | */ 62 | public function broadcastOn() 63 | { 64 | return new Channel($this->channel['name']); 65 | } 66 | 67 | public function broadcastAs() 68 | { 69 | return $this->channel['eventName']; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/Facades/GedcomExpFacade.php: -------------------------------------------------------------------------------- 1 | false]; 12 | 13 | protected $casts = ['is_active' => 'boolean']; 14 | } 15 | -------------------------------------------------------------------------------- /src/Models/Chan.php: -------------------------------------------------------------------------------- 1 | false]; 12 | 13 | protected $casts = ['is_active' => 'boolean']; 14 | 15 | public function sources() 16 | { 17 | return $this->belongsToMany(Source::class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Models/Event.php: -------------------------------------------------------------------------------- 1 | hasOne(Place::class, 'id', 'places_id'); 14 | } 15 | 16 | public function getPlacename() 17 | { 18 | return $this->place ? $this->place->title : 'unknown place'; 19 | } 20 | 21 | public function getTitle() 22 | { 23 | return $this->gedcom_event_names[$this->title] ?? $this->title; 24 | } 25 | 26 | public function scopeOrderByDate($query) 27 | { 28 | return $query->orderBy('year')->orderBy('month')->orderBy('day'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Models/Family.php: -------------------------------------------------------------------------------- 1 | false]; 12 | 13 | protected $casts = ['is_active' => 'boolean']; 14 | 15 | public function events() 16 | { 17 | return $this->hasMany(FamilyEvent::class); 18 | } 19 | 20 | public function children() 21 | { 22 | return $this->hasMany(Person::class, 'child_in_family_id'); 23 | } 24 | 25 | public function husband() 26 | { 27 | return $this->hasOne(Person::class, 'id', 'husband_id'); 28 | } 29 | 30 | public function wife() 31 | { 32 | return $this->hasOne(Person::class, 'id', 'wife_id'); 33 | } 34 | 35 | public function title() 36 | { 37 | return ($this->husband ? $this->husband->fullname() : '?'). 38 | ' + '. 39 | ($this->wife ? $this->wife->fullname() : '?'); 40 | } 41 | 42 | public static function getList() 43 | { 44 | $families = self::query()->get(); 45 | $result = []; 46 | foreach ($families as $family) { 47 | $result[$family->id] = $family->title(); 48 | } 49 | 50 | return collect($result); 51 | } 52 | 53 | public function addEvent($title, $date, $place, $description = '') 54 | { 55 | $place_id = Place::getIdByTitle($place); 56 | $event = FamilyEvent::query()->updateOrCreate( 57 | [ 58 | 'family_id' => $this->id, 59 | 'title' => $title, 60 | ], 61 | [ 62 | 'family_id' => $this->id, 63 | 'title' => $title, 64 | 'description' => $description, 65 | ] 66 | ); 67 | if ($date) { 68 | $event->date = $date; 69 | $event->save(); 70 | } 71 | if ($place) { 72 | $event->places_id = $place_id; 73 | $event->save(); 74 | } 75 | } 76 | 77 | public function getWifeName() 78 | { 79 | return $this->wife ? $this->wife->fullname() : 'unknown woman'; 80 | } 81 | 82 | public function getHusbandName() 83 | { 84 | return $this->husband ? $this->husband->fullname() : 'unknown man'; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/Models/FamilyEvent.php: -------------------------------------------------------------------------------- 1 | hasOne(Family::class, 'id', 'family_id'); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Models/FamilySlgs.php: -------------------------------------------------------------------------------- 1 | false]; 19 | 20 | protected $casts = ['is_active' => 'boolean']; 21 | 22 | public function person() 23 | { 24 | return $this->belongsToMany(Person::class); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Models/PersonAlia.php: -------------------------------------------------------------------------------- 1 | 'Birth', 37 | 'DEAT' => 'Death', 38 | ]; 39 | 40 | public static function boot() 41 | { 42 | parent::boot(); 43 | 44 | self::observe(new EventActionsObserver()); 45 | } 46 | 47 | public function person() 48 | { 49 | return $this->hasOne(Person::class, 'id', 'person_id'); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Models/PersonLds.php: -------------------------------------------------------------------------------- 1 | where('title', $title)->first(); 18 | if ($place !== null) { 19 | $id = $place->id; 20 | } else { 21 | $place = self::query()->create(compact('title')); 22 | $id = $place->id; 23 | } 24 | 25 | return $id; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Models/Publication.php: -------------------------------------------------------------------------------- 1 | false]; 12 | 13 | protected $casts = ['is_active' => 'boolean']; 14 | } 15 | -------------------------------------------------------------------------------- /src/Models/Refn.php: -------------------------------------------------------------------------------- 1 | false]; 19 | 20 | protected $casts = ['is_active' => 'boolean']; 21 | 22 | public function sources() 23 | { 24 | return $this->hasMany(Source::class); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Models/Source.php: -------------------------------------------------------------------------------- 1 | false]; 19 | 20 | protected $casts = ['is_active' => 'boolean']; 21 | 22 | public function repositories() 23 | { 24 | return $this->belongsTo(Repository::class); 25 | } 26 | 27 | public function citations() 28 | { 29 | return $this->hasMany(Citation::class); 30 | } 31 | 32 | public function getCitationListAttribute() 33 | { 34 | return $this->citations()->pluck('citation.id'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Models/SourceData.php: -------------------------------------------------------------------------------- 1 | date); 12 | $model->fill($parser->parse_date()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/ServiceProvider.php: -------------------------------------------------------------------------------- 1 | commands([ 13 | GedcomImporter::class, 14 | ]); 15 | 16 | $this->app->bind('FamilyTree365/laravel-gedcom:parser', function () { 17 | return new GedcomParser(); 18 | }); 19 | } 20 | 21 | public function boot() 22 | { 23 | $this->loadMigrationsFrom(__DIR__.'/migrations/'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Utils/Importer/Addr.php: -------------------------------------------------------------------------------- 1 | getAdr1(); 21 | $adr2 = $addr->getAdr2(); 22 | $city = $addr->getCity(); 23 | $stae = $addr->getStae(); 24 | $post = $addr->getPost(); 25 | $ctry = $addr->getCtry(); 26 | 27 | $addr = MAddr::on($conn)->where([ 28 | ['adr1', '=', $adr1], 29 | ['adr2', '=', $adr2], 30 | ['city', '=', $city], 31 | 32 | ['stae', '=', $stae], 33 | ['post', '=', $post], 34 | ['ctry', '=', $ctry], 35 | ])->first(); 36 | if ($addr !== null) { 37 | $id = $addr->id; 38 | } else { 39 | $addr = MAddr::on($conn)->create(compact('adr1', 'adr2', 'city', 'stae', 'post', 'ctry')); 40 | $id = $addr->id; 41 | } 42 | 43 | return $id; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Utils/Importer/Caln.php: -------------------------------------------------------------------------------- 1 | getMedi(); 19 | 20 | $key = [ 21 | 'group'=> $group, 22 | 'gid' => $gid, 23 | 'medi' => $medi, 24 | ]; 25 | $data = [ 26 | 'group'=> $group, 27 | 'gid' => $gid, 28 | 'medi' => $medi, 29 | ]; 30 | $_caln = MCaln::on($conn)->updateOrCreate($key, $data); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Utils/Importer/Chan.php: -------------------------------------------------------------------------------- 1 | getDate(); 17 | $time = $chan->getTime(); 18 | 19 | // store chan 20 | $key = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'time'=>$time]; 21 | $data = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'time'=>$time]; 22 | $record = MChan::on($conn)->updateOrCreate($key, $data); 23 | 24 | // store Sources of Note 25 | $_group = 'chan'; 26 | $_gid = $record->id; 27 | // SourRef array 28 | $note = $chan->getNote(); 29 | if ($note && count($note) > 0) { 30 | foreach ($note as $item) { 31 | if ($item) { 32 | NoteRef::read($conn, $item, $_group, $_gid); 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Utils/Importer/Date.php: -------------------------------------------------------------------------------- 1 | getDate(); 21 | } 22 | } else { 23 | // $input_date = Carbon::parse($input_date)->timestamp; 24 | return "$input_date"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Utils/Importer/Fam/Slgs.php: -------------------------------------------------------------------------------- 1 | getStat(); 25 | $date = $slgs->getDate(); 26 | $plac = $slgs->getPlac(); 27 | $temp = $slgs->getTemp(); 28 | 29 | $key = [ 30 | 'family_id'=> $fam->id, 31 | 'stat' => $stat, 32 | 'date' => $date, 33 | 'plac' => $plac, 34 | 'temp' => $temp, 35 | ]; 36 | $data = [ 37 | 'family_id'=> $fam->id, 38 | 'stat' => $stat, 39 | 'date' => $date, 40 | 'plac' => $plac, 41 | 'temp' => $temp, 42 | ]; 43 | 44 | $record = FamilySlgs::on($conn)->updateOrCreate($key, $data); 45 | 46 | $_group = 'fam_slgs'; 47 | $_gid = $record->id; 48 | 49 | // array 50 | $sour = $slgs->getSour(); 51 | if ($sour && count($sour) > 0) { 52 | foreach ($sour as $item) { 53 | if ($item) { 54 | \FamilyTree365\LaravelGedcom\Utils\Importer\SourRef::read($conn, $item, $_group, $_gid); 55 | } 56 | } 57 | } 58 | 59 | $note = $slgs->getNote(); 60 | if ($note && count($note) > 0) { 61 | foreach ($note as $item) { 62 | \FamilyTree365\LaravelGedcom\Utils\Importer\NoteRef::read($conn, $item, $_group, $_gid); 63 | } 64 | } 65 | } catch (Throwable $e) { 66 | report($e); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/Utils/Importer/Indi/Alia.php: -------------------------------------------------------------------------------- 1 | $group, 'gid'=>$group_id, 'alia'=>$alia]; 20 | $aliaData[] = $data; 21 | } 22 | } 23 | PersonAlia::on($conn)->insert($aliaData); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Utils/Importer/Indi/Anci.php: -------------------------------------------------------------------------------- 1 | $group, 'gid'=>$group_id, 'anci'=>$subm_id]; 23 | $data = ['group'=>$group, 'gid'=>$group_id, 'anci'=>$subm_id]; 24 | $record[] = $data; 25 | } 26 | } 27 | } 28 | PersonAnci::insert($record); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Utils/Importer/Indi/Asso.php: -------------------------------------------------------------------------------- 1 | getIndi(); 18 | $rela = $asso->getRela(); 19 | 20 | // store asso 21 | $key = ['group'=>$group, 'gid'=>$group_id, 'rela'=>$rela, 'indi' => $_indi]; 22 | $data = ['group'=>$group, 'gid'=>$group_id, 'rela'=>$rela, 'indi' => $_indi]; 23 | $record = PersonAsso::on($conn)->updateOrCreate($key, $data); 24 | 25 | $_group = 'indi_asso'; 26 | $_gid = $record->id; 27 | // store Note 28 | $note = $asso->getNote(); 29 | if ($note && count($note) > 0) { 30 | foreach ($note as $item) { 31 | if ($item) { 32 | \FamilyTree365\LaravelGedcom\Utils\Importer\NoteRef::read($conn, $item, $_group, $_gid); 33 | } 34 | } 35 | } 36 | 37 | // store sourref 38 | $sour = $asso->getSour(); 39 | if ($sour && count($sour) > 0) { 40 | foreach ($sour as $item) { 41 | if ($item) { 42 | \FamilyTree365\LaravelGedcom\Utils\Importer\SourRef::read($conn, $item, $_group, $_gid); 43 | } 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Utils/Importer/Indi/Desi.php: -------------------------------------------------------------------------------- 1 | $group, 'gid'=>$group_id, 'desi'=>$desi]; 20 | $data = ['group'=>$group, 'gid'=>$group_id, 'desi'=>$desi]; 21 | $record = PersonDesi::on($conn)->updateOrCreate($key, $data); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Utils/Importer/Indi/Even/Plac.php: -------------------------------------------------------------------------------- 1 | getPlac(); 18 | } 19 | 20 | return $place; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Utils/Importer/Indi/Lds.php: -------------------------------------------------------------------------------- 1 | getStat(); 19 | $date = $lds->getDate(); 20 | $plac = $lds->getPlac(); 21 | $temp = $lds->getTemp(); 22 | 23 | $slgc_famc = ''; 24 | if ($type == 'SLGC') { 25 | $slgc_famc = $lds->getFamc(); 26 | } 27 | // store refn 28 | $key = [ 29 | 'group' => $group, 30 | 'gid' => $group_id, 31 | 'type' => $type, 32 | 'stat' => $stat, 33 | 'date' => $date, 34 | 'plac' => $plac, 35 | 'temp' => $temp, 36 | 'slgc_famc' => $slgc_famc, 37 | ]; 38 | $data = [ 39 | 'group' => $group, 40 | 'gid' => $group_id, 41 | 'type' => $type, 42 | 'stat' => $stat, 43 | 'date' => $date, 44 | 'plac' => $plac, 45 | 'temp' => $temp, 46 | 'slgc_famc' => $slgc_famc, 47 | ]; 48 | $record = PersonLds::on($conn)->updateOrCreate($key, $data); 49 | 50 | $_group = 'indi_lds'; 51 | $_gid = $record->id; 52 | // add sour 53 | $sour = $lds->getSour(); 54 | if ($sour && count($sour) > 0) { 55 | foreach ($sour as $item) { 56 | if ($item) { 57 | SourRef::read($conn, $item, $_group, $_gid, $sour_ids, $obje_ids); 58 | } 59 | } 60 | } 61 | 62 | // add note 63 | $note = $lds->getNote(); 64 | if ($note && count($note) > 0) { 65 | foreach ($note as $item) { 66 | if ($item) { 67 | NoteRef::read($conn, $item, $_group, $_gid); 68 | } 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/Utils/Importer/Indi/Name/Fone.php: -------------------------------------------------------------------------------- 1 | getType(); 17 | $name = $item->getName(); 18 | $npfx = $item->getNpfx(); 19 | $givn = $item->getGivn(); 20 | $nick = $item->getNick(); 21 | $spfx = $item->getSpfx(); 22 | $surn = $item->getSurn(); 23 | $nsfx = $item->getNsfx(); 24 | 25 | // store asso 26 | $key = [ 27 | 'group'=> $group, 28 | 'gid' => $group_id, 29 | 'type' => $type, 30 | 'name' => $name, 31 | 'npfx' => $npfx, 32 | 'givn' => $givn, 33 | 'nick' => $nick, 34 | 'spfx' => $spfx, 35 | 'surn' => $surn, 36 | 'nsfx' => $nsfx, 37 | ]; 38 | $data = [ 39 | 'group'=> $group, 40 | 'gid' => $group_id, 41 | 'type' => $type, 42 | 'name' => $name, 43 | 'npfx' => $npfx, 44 | 'givn' => $givn, 45 | 'nick' => $nick, 46 | 'spfx' => $spfx, 47 | 'surn' => $surn, 48 | 'nsfx' => $nsfx, 49 | ]; 50 | 51 | $record = PersonNameFone::on($conn)->updateOrCreate($key, $data); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Utils/Importer/Indi/Name/Romn.php: -------------------------------------------------------------------------------- 1 | getType(); 17 | $npfx = $item->getNpfx(); 18 | $givn = $item->getGivn(); 19 | $nick = $item->getNick(); 20 | $spfx = $item->getSpfx(); 21 | $surn = $item->getSurn(); 22 | $nsfx = $item->getNsfx(); 23 | 24 | // store asso 25 | $key = [ 26 | 'group'=> $group, 27 | 'gid' => $group_id, 28 | 'type' => $type, 29 | 'npfx' => $npfx, 30 | 'givn' => $givn, 31 | 'nick' => $nick, 32 | 'spfx' => $spfx, 33 | 'surn' => $surn, 34 | 'nsfx' => $nsfx, 35 | ]; 36 | $data = [ 37 | 'group'=> $group, 38 | 'gid' => $group_id, 39 | 'type' => $type, 40 | 'npfx' => $npfx, 41 | 'givn' => $givn, 42 | 'nick' => $nick, 43 | 'spfx' => $spfx, 44 | 'surn' => $surn, 45 | 'nsfx' => $nsfx, 46 | ]; 47 | 48 | $record = PersonNameRomn::on($conn)->updateOrCreate($key, $data); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Utils/Importer/Indi/Subm.php: -------------------------------------------------------------------------------- 1 | $group, 'gid'=>$group_id, 'subm'=>$subm_id]; 23 | $data = ['group'=>$group, 'gid'=>$group_id, 'subm'=>$subm_id]; 24 | $record[] = $data; 25 | } 26 | } 27 | } 28 | 29 | PersonSubm::on($conn)->insert($record); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Utils/Importer/Note.php: -------------------------------------------------------------------------------- 1 | getNote(); 19 | $rin = $note->getRin(); 20 | 21 | // store note 22 | $key = ['group'=>$group, 'gid'=>$group_id, 'note'=> utf8_encode($_note)]; 23 | $data = ['group'=>$group, 'gid'=>$group_id, 'note'=> utf8_encode($_note), 'rin'=>$rin]; 24 | $record = MNote::on($conn)->updateOrCreate($key, $data); 25 | 26 | // store Sources of Note 27 | $_group = 'note'; 28 | $_gid = $record->id; 29 | // SourRef array 30 | $sour = $note->getSour(); 31 | if ($sour && count($sour) > 0) { 32 | foreach ($sour as $item) { 33 | SourRef::read($conn, $item, $_group, $_gid); 34 | } 35 | } 36 | // Refn array 37 | $refn = $note->getRefn(); 38 | if ($refn && count($refn) > 0) { 39 | foreach ($refn as $item) { 40 | Refn::read($conn, $item, $_group, $_gid); 41 | } 42 | } 43 | 44 | // Chan 45 | $chan = $note->getChan(); 46 | if ($chan !== null) { 47 | Chan::read($conn, $chan, $_group, $_gid); 48 | } 49 | 50 | return $_gid; 51 | } catch (Throwable $e) { 52 | report($e); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Utils/Importer/NoteRef.php: -------------------------------------------------------------------------------- 1 | getNote(); 17 | 18 | // store note 19 | $key = ['group'=>$group, 'gid'=>$group_id, 'note'=>$note]; 20 | $data = ['group'=>$group, 'gid'=>$group_id, 'note'=>$note]; 21 | $record = Note::on($conn)->updateOrCreate($key, $data); 22 | 23 | // store Sources of Note 24 | $_group = 'note'; 25 | $_gid = $record->id; 26 | // SourRef array 27 | $sour = $noteref->getSour(); 28 | if ($sour && count($sour) > 0) { 29 | foreach ($sour as $item) { 30 | SourRef::read($conn, $item, $_group, $_gid); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Utils/Importer/Obje.php: -------------------------------------------------------------------------------- 1 | getId(); 21 | $rin = $obje->getRin(); // string 22 | 23 | // store Object 24 | $key = [ 25 | 'group' => $group, 26 | 'gid' => $group_id, 27 | 'rin' => $rin, 28 | 'obje_id' => $id, 29 | ]; 30 | $data = [ 31 | 'group' => $group, 32 | 'gid' => $group_id, 33 | 'rin' => $rin, 34 | 'obje_id' => $id, 35 | ]; 36 | 37 | $record = MediaObject::on($conn)->updateOrCreate($key, $data); 38 | 39 | $_group = 'obje'; 40 | $_gid = $record->id; 41 | 42 | $refn = $obje->getRefn(); // Record/Refn array 43 | if ($refn && count($refn) > 0) { 44 | foreach ($refn as $item) { 45 | Refn::read($conn, $item, $_group, $_gid); 46 | } 47 | } 48 | 49 | // store Note 50 | $note = $obje->getNote(); // Record/NoteRef array 51 | if ($note && count($note) > 0) { 52 | foreach ($note as $item) { 53 | NoteRef::read($conn, $item, $_group, $_gid); 54 | } 55 | } 56 | 57 | // store Note 58 | $files = $obje->getFile(); // Record/NoteRef array 59 | if (($files && count((is_countable($files) ? $files : [])))) { 60 | foreach ($files as $item) { 61 | \FamilyTree365\LaravelGedcom\Utils\Importer\ObjeRef\File::read($conn, $item, $_group, $_gid); 62 | } 63 | } 64 | 65 | $chan = $obje->getChan(); // Recore/Chan 66 | if ($chan !== null) { 67 | \FamilyTree365\LaravelGedcom\Utils\Importer\Chan::read($conn, $chan, $_group, $_gid); 68 | } 69 | 70 | return $_gid; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/Utils/Importer/ObjeRef.php: -------------------------------------------------------------------------------- 1 | getObje(); 21 | if (isset($obje_ids[$obje_id])) { 22 | $obje_id = $obje_ids[$obje_id]; 23 | } 24 | $titl = $objeref->getTitl(); 25 | $file = $objeref->getFile(); 26 | 27 | // store MediaObject 28 | $key = ['group'=>$group, 'gid'=>$group_id, 'titl'=>$titl]; 29 | $data = [ 30 | 'group' => $group, 31 | 'gid' => $group_id, 32 | 'obje_id'=> $obje_id, 33 | 'titl' => $titl, 34 | ]; 35 | $record = MediaObject::on($conn)->updateOrCreate($key, $data); 36 | 37 | $_group = 'objeref'; 38 | $_gid = $record->id; 39 | // store Note 40 | 41 | $files = $objeref->getFile(); 42 | if ($files && count((is_countable($files) ? $files : []))) { 43 | foreach ($files as $item) { 44 | File::read($conn, $item, $_group, $_gid); 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Utils/Importer/ObjeRef/File.php: -------------------------------------------------------------------------------- 1 | getForm(); 17 | $medi = null; 18 | $type = null; 19 | if ($form) { 20 | $medi = $form->getMedi(); 21 | } 22 | 23 | // store File 24 | $key = ['group'=>$group, 'gid'=>$group_id, 'form'=>$form, 'medi'=>$medi, 'type'=> $type]; 25 | $data = ['group'=>$group, 'gid'=>$group_id, 'form'=>$form, 'medi'=>$medi, 'type'=>$type]; 26 | $record = MediaObjeectFile::on($conn)->updateOrCreate($key, $data); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Utils/Importer/Phon.php: -------------------------------------------------------------------------------- 1 | getPhon(); 19 | } 20 | } else { 21 | if (is_array($phon)) { 22 | return json_encode($phon); 23 | } else { 24 | return "$phon"; 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Utils/Importer/Refn.php: -------------------------------------------------------------------------------- 1 | getRefn(); 17 | $type = $refn->getType(); 18 | // store refn 19 | $key = ['group'=>$group, 'gid'=>$group_id, 'refn'=>$_refn, 'type'=>$type]; 20 | $data = ['group'=>$group, 'gid'=>$group_id, 'refn'=>$_refn, 'type'=>$type]; 21 | $record = MRefn::on($conn)->updateOrCreate($key, $data); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Utils/Importer/RepoRef.php: -------------------------------------------------------------------------------- 1 | getRepo(); 20 | // store Source 21 | $key = ['group'=>$group, 'gid'=>$group_id, 'repo' => $repo]; 22 | $data = [ 23 | 'group'=> $group, 24 | 'gid' => $group_id, 25 | 'repo' => $repo, 26 | ]; 27 | $record = Repository::on($conn)->updateOrCreate($key, $data); 28 | 29 | $_group = 'reporef'; 30 | $_gid = $record->id; 31 | // store Note 32 | $notes = $reporef->getNote(); 33 | if ($notes && count($notes) > 0) { 34 | foreach ($notes as $item) { 35 | NoteRef::read($conn, $item, $_group, $_gid); 36 | } 37 | } 38 | 39 | // store Caln 40 | $caln = $reporef->getCaln(); 41 | if ($caln && count($caln) > 0) { 42 | foreach ($caln as $item) { 43 | if ($item) { 44 | Caln::read($conn, $item, $_group, $_gid); 45 | } 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Utils/Importer/Sour/Data.php: -------------------------------------------------------------------------------- 1 | getDate(); 19 | $agnc = $data->getAgnc(); 20 | $text = $data->getText(); 21 | 22 | // store Data of sources 23 | $key = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'text'=>$text, 'agnc'=>$agnc]; 24 | $_data = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'text'=>$text, 'agnc'=>$agnc]; 25 | $record = SourceData::on($conn)->updateOrCreate($key, $_data); 26 | 27 | $_group = 'sourcedata'; 28 | $_gid = $record->id; 29 | // \Gedcom\Record\Sour\Data\Even array 30 | $even = $data->getEven(); 31 | if ($even && count($even) > 0) { 32 | foreach ($even as $item) { 33 | Even::read($conn, $item, $_group, $_gid); 34 | } 35 | } 36 | // \Gedcom\Record\NoteRef array 37 | $note = $data->getNote(); 38 | if ($note && count($note) > 0) { 39 | foreach ($note as $item) { 40 | NoteRef::read($conn, $item, $_group, $_gid); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Utils/Importer/Sour/Data/Even.php: -------------------------------------------------------------------------------- 1 | getDate(); 17 | $plac = $even->getPlac(); 18 | 19 | // store Even of source/data 20 | $key = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'plac'=>$plac]; 21 | $data = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'plac'=>$plac]; 22 | $record = SourceDataEven::on($conn)->updateOrCreate($key, $data); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Utils/Importer/Sour/Repo.php: -------------------------------------------------------------------------------- 1 | getRepo(); 18 | if (empty($repo_id)) { 19 | $repo_id = rand(1, 10000); 20 | } 21 | $_caln = $data->getCaln(); 22 | $caln = ''; 23 | if ($_caln != null && count($_caln) > 0) { 24 | $temp = []; 25 | foreach ($_caln as $item) { 26 | $__caln = $item->getCaln(); 27 | $__medi = $item->getMedi(); 28 | $temp_item = $__caln.':'.$__medi; 29 | $temp[] = $temp_item; 30 | } 31 | $caln = implode(',', $temp); 32 | unset($temp); 33 | // example 34 | // +1 1123 123123:avi,+1 123 123 123:mpg 35 | } 36 | // store Data of sources 37 | $key = ['group'=>$group, 'gid'=>$group_id, 'repo_id'=>$repo_id]; 38 | $_data = ['group'=>$group, 'gid'=>$group_id, 'repo_id'=>$repo_id, 'caln'=>$caln]; 39 | $record = SourceRepo::on($conn)->updateOrCreate($key, $_data); 40 | 41 | $_group = 'sourcerepo'; 42 | $_gid = $record->id; 43 | 44 | // \Gedcom\Record\NoteRef array 45 | $note = $data->getNote(); 46 | if ($note && count($note) > 0) { 47 | foreach ($note as $item) { 48 | NoteRef::read($conn, $item, $_group, $_gid); 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Utils/Importer/SourRef.php: -------------------------------------------------------------------------------- 1 | getSour(); 23 | if (!isset($sour_ids[$sour])) { 24 | return; 25 | } 26 | $sour_id = $sour_ids[$sour]; 27 | $text = $sourref->getText(); 28 | $quay = $sourref->getQuay(); 29 | $page = $sourref->getPage(); 30 | 31 | // store Source 32 | $key = ['group'=>$group, 'gid'=>$group_id, 'sour_id'=>$sour_id]; 33 | $data = [ 34 | 'group' => $group, 35 | 'gid' => $group_id, 36 | 'sour_id'=> $sour_id, 37 | 'text' => $text, 38 | 'quay' => $quay, 39 | 'page' => $page, 40 | ]; 41 | $record = SourceRef::on($conn)->updateOrCreate($key, $data); 42 | 43 | $_group = 'sourref'; 44 | $_gid = $record->id; 45 | // store MediaObje 46 | $objes = $sourref->getObje(); 47 | if ($objes && count($objes) > 0) { 48 | foreach ($objes as $item) { 49 | ObjeRef::read($conn, $item, $_group, $_gid, $obje_ids); 50 | } 51 | } 52 | 53 | // store Note 54 | $notes = $sourref->getNote(); 55 | if ($notes && count($notes) > 0) { 56 | foreach ($notes as $item) { 57 | NoteRef::read($conn, $item, $_group, $_gid); 58 | } 59 | } 60 | 61 | // store Data 62 | $data = $sourref->getData(); 63 | if ($data) { 64 | Data::read($conn, $data, $_group, $_gid); 65 | } 66 | 67 | // store \Gedcom\Record\SourRef\Even 68 | $even = $sourref->getEven(); 69 | if ($even) { 70 | Even::read($conn, $even, $_group, $_gid); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/Utils/Importer/SourRef/Even.php: -------------------------------------------------------------------------------- 1 | getEven(); 17 | $role = $even->getRole(); 18 | 19 | // store Even of source/data 20 | $key = ['group'=>$group, 'gid'=>$group_id, 'even'=>$_even, 'role'=>$role]; 21 | $data = ['group'=>$group, 'gid'=>$group_id, 'even'=>$_even, 'role'=>$role]; 22 | $record = SourceRefEven::on($conn)->updateOrCreate($key, $data); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Utils/Importer/Subn.php: -------------------------------------------------------------------------------- 1 | getSubm(); 20 | $subm = null; 21 | if (isset($subm_ids[$subm])) { 22 | $subm = $subm_ids[$_subm]; 23 | } 24 | $famf = $subn->getFamf(); 25 | $temp = $subn->getTemp(); 26 | $ance = $subn->getAnce(); 27 | $desc = $subn->getDesc(); 28 | $ordi = $subn->getOrdi(); 29 | $rin = $subn->getRin(); 30 | $record = MSubn::on($conn)->updateOrCreate(compact('subm', 'famf', 'temp', 'ance', 'desc', 'ordi', 'rin'), compact('subm', 'famf', 'temp', 'ance', 'desc', 'ordi', 'rin')); 31 | 32 | $_group = 'subn'; 33 | $_gid = $record->id; 34 | 35 | $note = $subn->getNote(); // array --- 36 | 37 | if ($note != null && count($note) > 0) { 38 | foreach ($note as $item) { 39 | \FamilyTree365\LaravelGedcom\Utils\Importer\NoteRef::read($conn, $item, $_group, $_gid); 40 | } 41 | } 42 | $chan = $subn->getChan() ?? null; // Record\Chan--- 43 | if ($chan !== null) { 44 | \FamilyTree365\LaravelGedcom\Utils\Importer\Chan::read($conn, $chan, $_group, $_gid); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Utils/exporter/Addr.php: -------------------------------------------------------------------------------- 1 | getAdr1(); 21 | $adr2 = $addr->getAdr2(); 22 | $city = $addr->getCity(); 23 | $stae = $addr->getStae(); 24 | $post = $addr->getPost(); 25 | $ctry = $addr->getCtry(); 26 | 27 | $addr = MAddr::on($conn)->where([ 28 | ['adr1', '=', $adr1], 29 | ['adr2', '=', $adr2], 30 | ['city', '=', $city], 31 | 32 | ['stae', '=', $stae], 33 | ['post', '=', $post], 34 | ['ctry', '=', $ctry], 35 | ])->first(); 36 | if ($addr !== null) { 37 | $id = $addr->id; 38 | } else { 39 | $addr = MAddr::on($conn)->create(compact('adr1', 'adr2', 'city', 'stae', 'post', 'ctry')); 40 | $id = $addr->id; 41 | } 42 | 43 | return $id; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Utils/exporter/Caln.php: -------------------------------------------------------------------------------- 1 | getMedi(); 19 | 20 | $key = [ 21 | 'group'=> $group, 22 | 'gid' => $gid, 23 | 'medi' => $medi, 24 | ]; 25 | $data = [ 26 | 'group'=> $group, 27 | 'gid' => $gid, 28 | 'medi' => $medi, 29 | ]; 30 | $_caln = MCaln::on($conn)->updateOrCreate($key, $data); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Utils/exporter/Chan.php: -------------------------------------------------------------------------------- 1 | getDate(); 17 | $time = $chan->getTime(); 18 | 19 | // store chan 20 | $key = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'time'=>$time]; 21 | $data = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'time'=>$time]; 22 | $record = MChan::on($conn)->updateOrCreate($key, $data); 23 | 24 | // store Sources of Note 25 | $_group = 'chan'; 26 | $_gid = $record->id; 27 | // SourRef array 28 | $note = $chan->getNote(); 29 | if ($note && count($note) > 0) { 30 | foreach ($note as $item) { 31 | if ($item) { 32 | NoteRef::read($conn, $item, $_group, $_gid); 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Utils/exporter/Date.php: -------------------------------------------------------------------------------- 1 | getDate(); 21 | } 22 | } else { 23 | // $input_date = Carbon::parse($input_date)->timestamp; 24 | return "$input_date"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Utils/exporter/Fam/Slgs.php: -------------------------------------------------------------------------------- 1 | getStat(); 25 | $date = $slgs->getDate(); 26 | $plac = $slgs->getPlac(); 27 | $temp = $slgs->getTemp(); 28 | 29 | $key = [ 30 | 'family_id'=> $fam->id, 31 | 'stat' => $stat, 32 | 'date' => $date, 33 | 'plac' => $plac, 34 | 'temp' => $temp, 35 | ]; 36 | $data = [ 37 | 'family_id'=> $fam->id, 38 | 'stat' => $stat, 39 | 'date' => $date, 40 | 'plac' => $plac, 41 | 'temp' => $temp, 42 | ]; 43 | 44 | $record = FamilySlgs::on($conn)->updateOrCreate($key, $data); 45 | 46 | $_group = 'fam_slgs'; 47 | $_gid = $record->id; 48 | 49 | // array 50 | $sour = $slgs->getSour(); 51 | if ($sour && count($sour) > 0) { 52 | foreach ($sour as $item) { 53 | if ($item) { 54 | \FamilyTree365\LaravelGedcom\Utils\Importer\SourRef::read($conn, $item, $_group, $_gid); 55 | } 56 | } 57 | } 58 | 59 | $note = $slgs->getNote(); 60 | if ($note && count($note) > 0) { 61 | foreach ($note as $item) { 62 | \FamilyTree365\LaravelGedcom\Utils\Importer\NoteRef::read($conn, $item, $_group, $_gid); 63 | } 64 | } 65 | } catch (Throwable $e) { 66 | report($e); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/Utils/exporter/Indi/Alia.php: -------------------------------------------------------------------------------- 1 | $group, 'gid'=>$group_id, 'alia'=>$alia]; 20 | $aliaData[] = $data; 21 | } 22 | } 23 | PersonAlia::on($conn)->insert($aliaData); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Utils/exporter/Indi/Anci.php: -------------------------------------------------------------------------------- 1 | $group, 'gid'=>$group_id, 'anci'=>$subm_id]; 23 | $data = ['group'=>$group, 'gid'=>$group_id, 'anci'=>$subm_id]; 24 | $record[] = $data; 25 | } 26 | } 27 | } 28 | PersonAnci::insert($record); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Utils/exporter/Indi/Asso.php: -------------------------------------------------------------------------------- 1 | getIndi(); 18 | $rela = $asso->getRela(); 19 | 20 | // store asso 21 | $key = ['group'=>$group, 'gid'=>$group_id, 'rela'=>$rela, 'indi' => $_indi]; 22 | $data = ['group'=>$group, 'gid'=>$group_id, 'rela'=>$rela, 'indi' => $_indi]; 23 | $record = PersonAsso::on($conn)->updateOrCreate($key, $data); 24 | 25 | $_group = 'indi_asso'; 26 | $_gid = $record->id; 27 | // store Note 28 | $note = $asso->getNote(); 29 | if ($note && count($note) > 0) { 30 | foreach ($note as $item) { 31 | if ($item) { 32 | \FamilyTree365\LaravelGedcom\Utils\Importer\NoteRef::read($conn, $item, $_group, $_gid); 33 | } 34 | } 35 | } 36 | 37 | // store sourref 38 | $sour = $asso->getSour(); 39 | if ($sour && count($sour) > 0) { 40 | foreach ($sour as $item) { 41 | if ($item) { 42 | \FamilyTree365\LaravelGedcom\Utils\Importer\SourRef::read($conn, $item, $_group, $_gid); 43 | } 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Utils/exporter/Indi/Desi.php: -------------------------------------------------------------------------------- 1 | $group, 'gid'=>$group_id, 'desi'=>$desi]; 20 | $data = ['group'=>$group, 'gid'=>$group_id, 'desi'=>$desi]; 21 | $record = PersonDesi::on($conn)->updateOrCreate($key, $data); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Utils/exporter/Indi/Even/Plac.php: -------------------------------------------------------------------------------- 1 | getPlac(); 18 | } 19 | 20 | return $place; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Utils/exporter/Indi/Lds.php: -------------------------------------------------------------------------------- 1 | getStat(); 19 | $date = $lds->getDate(); 20 | $plac = $lds->getPlac(); 21 | $temp = $lds->getTemp(); 22 | 23 | $slgc_famc = ''; 24 | if ($type == 'SLGC') { 25 | $slgc_famc = $lds->getFamc(); 26 | } 27 | // store refn 28 | $key = [ 29 | 'group' => $group, 30 | 'gid' => $group_id, 31 | 'type' => $type, 32 | 'stat' => $stat, 33 | 'date' => $date, 34 | 'plac' => $plac, 35 | 'temp' => $temp, 36 | 'slgc_famc' => $slgc_famc, 37 | ]; 38 | $data = [ 39 | 'group' => $group, 40 | 'gid' => $group_id, 41 | 'type' => $type, 42 | 'stat' => $stat, 43 | 'date' => $date, 44 | 'plac' => $plac, 45 | 'temp' => $temp, 46 | 'slgc_famc' => $slgc_famc, 47 | ]; 48 | $record = PersonLds::on($conn)->updateOrCreate($key, $data); 49 | 50 | $_group = 'indi_lds'; 51 | $_gid = $record->id; 52 | // add sour 53 | $sour = $lds->getSour(); 54 | if ($sour && count($sour) > 0) { 55 | foreach ($sour as $item) { 56 | if ($item) { 57 | SourRef::read($conn, $item, $_group, $_gid, $sour_ids, $obje_ids); 58 | } 59 | } 60 | } 61 | 62 | // add note 63 | $note = $lds->getNote(); 64 | if ($note && count($note) > 0) { 65 | foreach ($note as $item) { 66 | if ($item) { 67 | NoteRef::read($conn, $item, $_group, $_gid); 68 | } 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/Utils/exporter/Indi/Name/Fone.php: -------------------------------------------------------------------------------- 1 | getType(); 17 | $name = $item->getName(); 18 | $npfx = $item->getNpfx(); 19 | $givn = $item->getGivn(); 20 | $nick = $item->getNick(); 21 | $spfx = $item->getSpfx(); 22 | $surn = $item->getSurn(); 23 | $nsfx = $item->getNsfx(); 24 | 25 | // store asso 26 | $key = [ 27 | 'group'=> $group, 28 | 'gid' => $group_id, 29 | 'type' => $type, 30 | 'name' => $name, 31 | 'npfx' => $npfx, 32 | 'givn' => $givn, 33 | 'nick' => $nick, 34 | 'spfx' => $spfx, 35 | 'surn' => $surn, 36 | 'nsfx' => $nsfx, 37 | ]; 38 | $data = [ 39 | 'group'=> $group, 40 | 'gid' => $group_id, 41 | 'type' => $type, 42 | 'name' => $name, 43 | 'npfx' => $npfx, 44 | 'givn' => $givn, 45 | 'nick' => $nick, 46 | 'spfx' => $spfx, 47 | 'surn' => $surn, 48 | 'nsfx' => $nsfx, 49 | ]; 50 | 51 | $record = PersonNameFone::on($conn)->updateOrCreate($key, $data); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Utils/exporter/Indi/Name/Romn.php: -------------------------------------------------------------------------------- 1 | getType(); 17 | $npfx = $item->getNpfx(); 18 | $givn = $item->getGivn(); 19 | $nick = $item->getNick(); 20 | $spfx = $item->getSpfx(); 21 | $surn = $item->getSurn(); 22 | $nsfx = $item->getNsfx(); 23 | 24 | // store asso 25 | $key = [ 26 | 'group'=> $group, 27 | 'gid' => $group_id, 28 | 'type' => $type, 29 | 'npfx' => $npfx, 30 | 'givn' => $givn, 31 | 'nick' => $nick, 32 | 'spfx' => $spfx, 33 | 'surn' => $surn, 34 | 'nsfx' => $nsfx, 35 | ]; 36 | $data = [ 37 | 'group'=> $group, 38 | 'gid' => $group_id, 39 | 'type' => $type, 40 | 'npfx' => $npfx, 41 | 'givn' => $givn, 42 | 'nick' => $nick, 43 | 'spfx' => $spfx, 44 | 'surn' => $surn, 45 | 'nsfx' => $nsfx, 46 | ]; 47 | 48 | $record = PersonNameRomn::on($conn)->updateOrCreate($key, $data); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Utils/exporter/Indi/Subm.php: -------------------------------------------------------------------------------- 1 | $group, 'gid'=>$group_id, 'subm'=>$subm_id]; 23 | $data = ['group'=>$group, 'gid'=>$group_id, 'subm'=>$subm_id]; 24 | $record[] = $data; 25 | } 26 | } 27 | } 28 | 29 | PersonSubm::on($conn)->insert($record); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Utils/exporter/Note.php: -------------------------------------------------------------------------------- 1 | getNote(); 19 | $rin = $note->getRin(); 20 | 21 | // store note 22 | $key = ['group'=>$group, 'gid'=>$group_id, 'note'=> utf8_encode($_note)]; 23 | $data = ['group'=>$group, 'gid'=>$group_id, 'note'=> utf8_encode($_note), 'rin'=>$rin]; 24 | $record = MNote::on($conn)->updateOrCreate($key, $data); 25 | 26 | // store Sources of Note 27 | $_group = 'note'; 28 | $_gid = $record->id; 29 | // SourRef array 30 | $sour = $note->getSour(); 31 | if ($sour && count($sour) > 0) { 32 | foreach ($sour as $item) { 33 | SourRef::read($conn, $item, $_group, $_gid); 34 | } 35 | } 36 | // Refn array 37 | $refn = $note->getRefn(); 38 | if ($refn && count($refn) > 0) { 39 | foreach ($refn as $item) { 40 | Refn::read($conn, $item, $_group, $_gid); 41 | } 42 | } 43 | 44 | // Chan 45 | $chan = $note->getChan(); 46 | if ($chan !== null) { 47 | Chan::read($conn, $chan, $_group, $_gid); 48 | } 49 | 50 | return $_gid; 51 | } catch (Throwable $e) { 52 | report($e); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Utils/exporter/NoteRef.php: -------------------------------------------------------------------------------- 1 | getNote(); 17 | 18 | // store note 19 | $key = ['group'=>$group, 'gid'=>$group_id, 'note'=>$note]; 20 | $data = ['group'=>$group, 'gid'=>$group_id, 'note'=>$note]; 21 | $record = Note::on($conn)->updateOrCreate($key, $data); 22 | 23 | // store Sources of Note 24 | $_group = 'note'; 25 | $_gid = $record->id; 26 | // SourRef array 27 | $sour = $noteref->getSour(); 28 | if ($sour && count($sour) > 0) { 29 | foreach ($sour as $item) { 30 | SourRef::read($conn, $item, $_group, $_gid); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Utils/exporter/Obje.php: -------------------------------------------------------------------------------- 1 | getId(); 21 | $rin = $obje->getRin(); // string 22 | 23 | // store Object 24 | $key = [ 25 | 'group' => $group, 26 | 'gid' => $group_id, 27 | 'rin' => $rin, 28 | 'obje_id' => $id, 29 | ]; 30 | $data = [ 31 | 'group' => $group, 32 | 'gid' => $group_id, 33 | 'rin' => $rin, 34 | 'obje_id' => $id, 35 | ]; 36 | 37 | $record = MediaObject::on($conn)->updateOrCreate($key, $data); 38 | 39 | $_group = 'obje'; 40 | $_gid = $record->id; 41 | 42 | $refn = $obje->getRefn(); // Record/Refn array 43 | if ($refn && count($refn) > 0) { 44 | foreach ($refn as $item) { 45 | Refn::read($conn, $item, $_group, $_gid); 46 | } 47 | } 48 | 49 | // store Note 50 | $note = $obje->getNote(); // Record/NoteRef array 51 | if ($note && count($note) > 0) { 52 | foreach ($note as $item) { 53 | NoteRef::read($conn, $item, $_group, $_gid); 54 | } 55 | } 56 | 57 | // store Note 58 | $files = $obje->getFile(); // Record/NoteRef array 59 | if (($files && count((is_countable($files) ? $files : [])))) { 60 | foreach ($files as $item) { 61 | \FamilyTree365\LaravelGedcom\Utils\Importer\ObjeRef\File::read($conn, $item, $_group, $_gid); 62 | } 63 | } 64 | 65 | $chan = $obje->getChan(); // Recore/Chan 66 | if ($chan !== null) { 67 | \FamilyTree365\LaravelGedcom\Utils\Importer\Chan::read($conn, $chan, $_group, $_gid); 68 | } 69 | 70 | return $_gid; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/Utils/exporter/ObjeRef.php: -------------------------------------------------------------------------------- 1 | getObje(); 21 | if (isset($obje_ids[$obje_id])) { 22 | $obje_id = $obje_ids[$obje_id]; 23 | } 24 | $titl = $objeref->getTitl(); 25 | $file = $objeref->getFile(); 26 | 27 | // store MediaObject 28 | $key = ['group'=>$group, 'gid'=>$group_id, 'titl'=>$titl]; 29 | $data = [ 30 | 'group' => $group, 31 | 'gid' => $group_id, 32 | 'obje_id'=> $obje_id, 33 | 'titl' => $titl, 34 | ]; 35 | $record = MediaObject::on($conn)->updateOrCreate($key, $data); 36 | 37 | $_group = 'objeref'; 38 | $_gid = $record->id; 39 | // store Note 40 | 41 | $files = $objeref->getFile(); 42 | if ($files && count((is_countable($files) ? $files : []))) { 43 | foreach ($files as $item) { 44 | File::read($conn, $item, $_group, $_gid); 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Utils/exporter/ObjeRef/File.php: -------------------------------------------------------------------------------- 1 | getForm(); 17 | $medi = null; 18 | $type = null; 19 | if ($form) { 20 | $medi = $form->getMedi(); 21 | } 22 | 23 | // store File 24 | $key = ['group'=>$group, 'gid'=>$group_id, 'form'=>$form, 'medi'=>$medi, 'type'=> $type]; 25 | $data = ['group'=>$group, 'gid'=>$group_id, 'form'=>$form, 'medi'=>$medi, 'type'=>$type]; 26 | $record = MediaObjeectFile::on($conn)->updateOrCreate($key, $data); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Utils/exporter/Phon.php: -------------------------------------------------------------------------------- 1 | getPhon(); 19 | } 20 | } else { 21 | if (is_array($phon)) { 22 | return json_encode($phon); 23 | } else { 24 | return "$phon"; 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Utils/exporter/Refn.php: -------------------------------------------------------------------------------- 1 | getRefn(); 17 | $type = $refn->getType(); 18 | // store refn 19 | $key = ['group'=>$group, 'gid'=>$group_id, 'refn'=>$_refn, 'type'=>$type]; 20 | $data = ['group'=>$group, 'gid'=>$group_id, 'refn'=>$_refn, 'type'=>$type]; 21 | $record = MRefn::on($conn)->updateOrCreate($key, $data); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Utils/exporter/RepoRef.php: -------------------------------------------------------------------------------- 1 | getRepo(); 20 | // store Source 21 | $key = ['group'=>$group, 'gid'=>$group_id, 'repo' => $repo]; 22 | $data = [ 23 | 'group'=> $group, 24 | 'gid' => $group_id, 25 | 'repo' => $repo, 26 | ]; 27 | $record = Repository::on($conn)->updateOrCreate($key, $data); 28 | 29 | $_group = 'reporef'; 30 | $_gid = $record->id; 31 | // store Note 32 | $notes = $reporef->getNote(); 33 | if ($notes && count($notes) > 0) { 34 | foreach ($notes as $item) { 35 | NoteRef::read($conn, $item, $_group, $_gid); 36 | } 37 | } 38 | 39 | // store Caln 40 | $caln = $reporef->getCaln(); 41 | if ($caln && count($caln) > 0) { 42 | foreach ($caln as $item) { 43 | if ($item) { 44 | Caln::read($conn, $item, $_group, $_gid); 45 | } 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Utils/exporter/Sour/Data.php: -------------------------------------------------------------------------------- 1 | getDate(); 19 | $agnc = $data->getAgnc(); 20 | $text = $data->getText(); 21 | 22 | // store Data of sources 23 | $key = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'text'=>$text, 'agnc'=>$agnc]; 24 | $_data = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'text'=>$text, 'agnc'=>$agnc]; 25 | $record = SourceData::on($conn)->updateOrCreate($key, $_data); 26 | 27 | $_group = 'sourcedata'; 28 | $_gid = $record->id; 29 | // \Gedcom\Record\Sour\Data\Even array 30 | $even = $data->getEven(); 31 | if ($even && count($even) > 0) { 32 | foreach ($even as $item) { 33 | Even::read($conn, $item, $_group, $_gid); 34 | } 35 | } 36 | // \Gedcom\Record\NoteRef array 37 | $note = $data->getNote(); 38 | if ($note && count($note) > 0) { 39 | foreach ($note as $item) { 40 | NoteRef::read($conn, $item, $_group, $_gid); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Utils/exporter/Sour/Data/Even.php: -------------------------------------------------------------------------------- 1 | getDate(); 17 | $plac = $even->getPlac(); 18 | 19 | // store Even of source/data 20 | $key = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'plac'=>$plac]; 21 | $data = ['group'=>$group, 'gid'=>$group_id, 'date'=>$date, 'plac'=>$plac]; 22 | $record = SourceDataEven::on($conn)->updateOrCreate($key, $data); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Utils/exporter/Sour/Repo.php: -------------------------------------------------------------------------------- 1 | getRepo(); 18 | if (empty($repo_id)) { 19 | $repo_id = rand(1, 10000); 20 | } 21 | $_caln = $data->getCaln(); 22 | $caln = ''; 23 | if ($_caln != null && count($_caln) > 0) { 24 | $temp = []; 25 | foreach ($_caln as $item) { 26 | $__caln = $item->getCaln(); 27 | $__medi = $item->getMedi(); 28 | $temp_item = $__caln.':'.$__medi; 29 | $temp[] = $temp_item; 30 | } 31 | $caln = implode(',', $temp); 32 | unset($temp); 33 | // example 34 | // +1 1123 123123:avi,+1 123 123 123:mpg 35 | } 36 | // store Data of sources 37 | $key = ['group'=>$group, 'gid'=>$group_id, 'repo_id'=>$repo_id]; 38 | $_data = ['group'=>$group, 'gid'=>$group_id, 'repo_id'=>$repo_id, 'caln'=>$caln]; 39 | $record = SourceRepo::on($conn)->updateOrCreate($key, $_data); 40 | 41 | $_group = 'sourcerepo'; 42 | $_gid = $record->id; 43 | 44 | // \Gedcom\Record\NoteRef array 45 | $note = $data->getNote(); 46 | if ($note && count($note) > 0) { 47 | foreach ($note as $item) { 48 | NoteRef::read($conn, $item, $_group, $_gid); 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Utils/exporter/SourRef.php: -------------------------------------------------------------------------------- 1 | getSour(); 23 | if (!isset($sour_ids[$sour])) { 24 | return; 25 | } 26 | $sour_id = $sour_ids[$sour]; 27 | $text = $sourref->getText(); 28 | $quay = $sourref->getQuay(); 29 | $page = $sourref->getPage(); 30 | 31 | // store Source 32 | $key = ['group'=>$group, 'gid'=>$group_id, 'sour_id'=>$sour_id]; 33 | $data = [ 34 | 'group' => $group, 35 | 'gid' => $group_id, 36 | 'sour_id'=> $sour_id, 37 | 'text' => $text, 38 | 'quay' => $quay, 39 | 'page' => $page, 40 | ]; 41 | $record = SourceRef::on($conn)->updateOrCreate($key, $data); 42 | 43 | $_group = 'sourref'; 44 | $_gid = $record->id; 45 | // store MediaObje 46 | $objes = $sourref->getObje(); 47 | if ($objes && count($objes) > 0) { 48 | foreach ($objes as $item) { 49 | ObjeRef::read($conn, $item, $_group, $_gid, $obje_ids); 50 | } 51 | } 52 | 53 | // store Note 54 | $notes = $sourref->getNote(); 55 | if ($notes && count($notes) > 0) { 56 | foreach ($notes as $item) { 57 | NoteRef::read($conn, $item, $_group, $_gid); 58 | } 59 | } 60 | 61 | // store Data 62 | $data = $sourref->getData(); 63 | if ($data) { 64 | Data::read($conn, $data, $_group, $_gid); 65 | } 66 | 67 | // store \Gedcom\Record\SourRef\Even 68 | $even = $sourref->getEven(); 69 | if ($even) { 70 | Even::read($conn, $even, $_group, $_gid); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/Utils/exporter/SourRef/Even.php: -------------------------------------------------------------------------------- 1 | getEven(); 17 | $role = $even->getRole(); 18 | 19 | // store Even of source/data 20 | $key = ['group'=>$group, 'gid'=>$group_id, 'even'=>$_even, 'role'=>$role]; 21 | $data = ['group'=>$group, 'gid'=>$group_id, 'even'=>$_even, 'role'=>$role]; 22 | $record = SourceRefEven::on($conn)->updateOrCreate($key, $data); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Utils/exporter/Subn.php: -------------------------------------------------------------------------------- 1 | getSubm(); 20 | $subm = null; 21 | if (isset($subm_ids[$subm])) { 22 | $subm = $subm_ids[$_subm]; 23 | } 24 | $famf = $subn->getFamf(); 25 | $temp = $subn->getTemp(); 26 | $ance = $subn->getAnce(); 27 | $desc = $subn->getDesc(); 28 | $ordi = $subn->getOrdi(); 29 | $rin = $subn->getRin(); 30 | $record = MSubn::on($conn)->updateOrCreate(compact('subm', 'famf', 'temp', 'ance', 'desc', 'ordi', 'rin'), compact('subm', 'famf', 'temp', 'ance', 'desc', 'ordi', 'rin')); 31 | 32 | $_group = 'subn'; 33 | $_gid = $record->id; 34 | 35 | $note = $subn->getNote(); // array --- 36 | 37 | if ($note != null && count($note) > 0) { 38 | foreach ($note as $item) { 39 | \FamilyTree365\LaravelGedcom\Utils\Importer\NoteRef::read($conn, $item, $_group, $_gid); 40 | } 41 | } 42 | $chan = $subn->getChan() ?? null; // Record\Chan--- 43 | if ($chan !== null) { 44 | \FamilyTree365\LaravelGedcom\Utils\Importer\Chan::read($conn, $chan, $_group, $_gid); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/factories/AddrFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->address(), 26 | 'adr2' => $this->faker->address(), 27 | 'city' => $this->faker->city(), 28 | 'stae' => $this->faker->state(), 29 | 'post' => $this->faker->postcode(), 30 | 'ctry' => $this->faker->countryCode(), 'created_at', 'updated_at', 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/factories/AuthorFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->words(), 'is_active', 'name' => $this->faker->name(), 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/factories/ChanFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement(1, 2), 'date' => $this->faker->date(), 'time' => $this->faker->time(), 'created_at', 'updated_at', 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/factories/CitationFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'description' => $this->faker->text(), 27 | 'repository_id' => Repository::factory(), 28 | 'volume' => $this->faker->randomElement(1, 2, 3, 4, 5), 29 | 'page' => $this->faker->randomNumber(500), 'is_active', 30 | 'confidence' => $this->faker->word(), 31 | 'source_id' => $this->faker->randomElement(1, 2, 3, 4), 32 | 33 | ]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/factories/EventFactory.php: -------------------------------------------------------------------------------- 1 | Family::factory(), 28 | 'places_id' => Place::factory(), 29 | 'date' => $this->faker->date(), 30 | 'title' => $this->faker->word(), 31 | 'description' => $this->faker->text(), 32 | 'year' => $this->faker->year(), 33 | 'month' => $this->faker->month(), 34 | 'day' => $this->faker->dayOfMonth(), 35 | 'type' => $this->faker->word(), 36 | 'plac' => $this->faker->word(), 37 | 'phon' => $this->faker->phoneNumber(), 38 | 'caus' => $this->faker->word(), 39 | 'age' => $this->faker->numberBetween(10, 79), 40 | 'husb' => $this->faker->word(), 41 | 'wife' => $this->faker->word(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/factories/FamilyFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->text(), 'is_active', 'husband_id'=> $this->faker->randomElement(1, 2, 3), 'wife_id'=> $this->faker->randomElement(1, 2, 3), 'type_id' => Type::factory(), 27 | 'chan' => $this->faker->words(), 'nchi' => $this->faker->words(), 'rin' => $this->faker->word(), 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/factories/FamilySlgsFactory.php: -------------------------------------------------------------------------------- 1 | Family::factory(), 'stat' => $this->faker->words(), 27 | 'date' => $this->faker->date(), 'plac' => $this->faker->word(), 'temp' => $this->faker->word(), 'created_at', 'updated_at', 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/factories/ImportJobFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->randomElement(1, 2), 'slug' => $this->faker->word(), 'status', 'created_at', 'updated_at', 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/factories/MediaObjectFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 26 | 'titl' => $this->faker->word(), , 'obje_id' => $this->faker->randomElement('1', '2'), 27 | 'rin' => $this->faker->word(), 'created_at', 'updated_at', 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/factories/MediaObjectFileFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 26 | 'form' => $this->faker->word(), 'medi' => $this->faker->word(), 'type' => $this->faker->word(), 'created_at', 'updated_at', 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/factories/NoteFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 26 | 'note' => $this->faker->text(), 'rin' => $this->faker->word(), 'name' => $this->faker->word(), 27 | 'description' => $this->faker->text(), 'is_active', 'type_id', 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/factories/PersonAliaFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 26 | $this->faker->word(), 'import_confirm', 'created_at', 'updated_at', 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/factories/PersonAnciFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 'anci' => $this->faker->word(), 'created_at', 'updated_at', 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/factories/PersonAssoFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 26 | 'indi' => $this->faker->word(), 'rela'=> $this->faker->word(), 'import_confirm', 'created_at', 'updated_at', 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/factories/PersonDesiFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 26 | 'desi' => $this->faker->word(), , 'created_at', 'updated_at', 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/factories/PersonEventFactory.php: -------------------------------------------------------------------------------- 1 | Person::factory(), 28 | 'title' => $this->faker->jobTitle(), 29 | 'type' => $this->faker->jobTitle(), 30 | 'attr' => $this->faker->text(), 31 | 'date' => $this->faker->date(), 32 | 'plac' => $this->faker->address(), 33 | 'phon' => $this->faker->phoneNumber(), 34 | 'caus' => $this->faker->text(), 35 | 'age' => $this->faker->randomNumber(50), 36 | 'agnc' => $this->faker->word(), 37 | 'places_id' => Place::factory(), 38 | 'description' => $this->faker->text(), 39 | 'year' => $this->faker->year(), 40 | 'month' => $this->faker->month(), 41 | 'day' => $this->faker->dayOfMonth(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/factories/PersonFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->name(), 'email' => $this->faker->email(), 'phone' => $this->faker->phoneNumber(), 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/factories/PersonLdsFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 26 | 'type' => $this->faker->word(), 'stat' => $this->faker->word(), 27 | 'date' => $this->faker->date(), 'plac' => $this->faker->word(), 28 | 'temp' => $this->faker->text(), 'slac_famc' => $this->faker->word(), 'created_at', 'updated_at', 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/factories/PersonNameFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 26 | 'type' => $this->faker->word(), 'name' => $this->faker->name(), 27 | 'npfx' => $this->faker->word(), 'givn' => $this->faker->firstName(), 28 | 'nick' => $this->faker->userName(), 'spfx', 'surn' => $this->faker->lastName(), 'nsfx', 'created_at', 'updated_at', 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/factories/PersonNameFoneFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 26 | 'type' => $this->faker->word(), 'name' => $this->faker->name(), 27 | 'npfx' => $this->faker->word(), 'givn' => $this->faker->firstName(), 28 | 'nick' => $this->faker->userName(), 'spfx', 'surn' => $this->faker->lastName(), 'nsfx', 'created_at', 'updated_at', 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/factories/PersonNameRomnFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 27 | 'type' => $this->faker->word(), 'name' => $this->faker->name(), 28 | 'npfx' => $this->faker->word(), 'givn' => $this->faker->firstName(), 29 | 'nick' => $this->faker->userName(), 'spfx', 'surn' => $this->faker->lastName(), 'nsfx', 'created_at', 'updated_at', 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/factories/PersonSubmFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 'subm' => $this->faker->word(), , 'created_at', 'updated_at', 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/factories/PlaceFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->words(), 'title' => $this->faker->word(), 'date' => $this->faker->date(), 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/factories/PublicationFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->text(), 'is_active', 'name' => $this->faker->word(), 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/factories/RefnFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 'refn' => $this->faker->word(), 'type' => $this->faker->word(), 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/factories/RepositoryFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 28 | 'name' => $this->faker->word(), 29 | 'addr_id' => Addr::factory(), 30 | 'rin' => $this->faker->word(), 31 | 'phon' => $this->faker->phoneNumber(), 32 | 'email' => $this->faker->email(), 33 | 'fax', 34 | 'www' => $this->faker->url(), 35 | 'name' => $this->faker->name(), 36 | 'description' => $this->faker->text(), 37 | 'type_id' => Type::factory(), 38 | 'is_active', 39 | ]; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/factories/SourceDataEvenFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 26 | 'date' => $this->faker->date(), 'plac' => $this->faker->word(), 'created_at', 'updated_at', 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/factories/SourceDataFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'gid' => $this->faker->randomElement('1', '2'), 26 | 'date' => $this->faker->date(), 27 | 'text' => $this->faker->text(), 28 | 'agnc' => $this->faker->word(), 'created_at', 'updated_at', 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/factories/SourceFactory.php: -------------------------------------------------------------------------------- 1 | @ $this->faker->word(), 30 | 'titl' => $this->faker->word(), 31 | 'auth', 32 | 'data' => $this->faker->word(), 33 | 'text' => $this->faker->word(), 34 | 'publ' => $this->faker->text(), 35 | 'abbr' => $this->faker->word(), 36 | 'name' => $this->faker->word(), 37 | 'description' => $this->faker->word(), 38 | 'repository_id' => Repository::factory(), 39 | 'author_id' => Author::factory(), 40 | 'publication_id' => Publication::factory(), 41 | 'type_id' => Type::factory(), 42 | 'is_active', 'group' => $this->faker->word(), 43 | 'gid' => $this->faker->word(), 44 | 'quay' => $this->faker->word(), 45 | 'page' => $this->faker->word(), 46 | ]; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/factories/SourceRefEvenFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 26 | 'gid' => $this->faker->randomElement('1', '2'), 27 | 'even' => $this->faker->word(), 28 | 'role' => $this->faker->word(), 'created_at', 'updated_at', 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/factories/SourceRefFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 27 | 'gid' => $this->faker->randomElement('1', '2'), 'sour_id' => Source::factory(), 28 | 'text' => $this->faker->word(), 'quay' => $this->faker->word(), 'page' => $this->faker->word(), 'created_at', 'updated_at', 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/factories/SourceRepoFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 27 | 'gid' => $this->faker->randomElement('1', '2'), 28 | 'repo_id' => Repository::factory(), 29 | 'caln' => $this->faker->word(), 30 | 'created_at', 'updated_at', 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/factories/SubmFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 27 | 'gid' => $this->faker->randomElement('1', '2'), 28 | 'name' => $this->faker->word(), 29 | 'addr_id' => Addr::factory(), 30 | 'rin' => $this->faker->word(), 31 | 'rfn' => $this->faker->word(), 32 | 'lang' => $this->faker->languageCode(), 33 | 'phon' => $this->faker->phoneNumber(), 34 | 'email' => $this->faker->email(), 'fax' => $this->faker->word(), 'www' => $this->faker->url(), 35 | 'created_at' => $this->faker->date(), 'updated_at', 36 | ]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/factories/SubnFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->word(), 'famf' => $this->faker->word(), 'temp' => $this->faker->word(), 27 | 'ance' => $this->faker->word(), 'desc' => $this->faker->randomElement('0', '1'), 28 | 'ordi' => $this->faker->word(), 'rin' => $this->faker->word(), 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/migrations/2020_01_01_120000_create_default_people_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | 14 | $table->tinyInteger('title')->nullable(); 15 | $table->string('name')->index(); 16 | $table->string('appellative')->index()->nullable(); 17 | 18 | $table->string('uid')->nullable()->unique(); 19 | $table->string('email')->unique()->nullable(); 20 | $table->string('phone')->nullable(); 21 | $table->string('birthday')->nullable(); 22 | 23 | $table->string('bank')->nullable(); 24 | $table->string('bank_account')->nullable(); 25 | 26 | $table->text('obs')->nullable(); 27 | 28 | $table->integer('created_by')->unsigned()->index()->nullable(); 29 | 30 | $table->integer('updated_by')->unsigned()->index()->nullable(); 31 | 32 | $table->timestamps(); 33 | }); 34 | } 35 | } 36 | 37 | public function down() 38 | { 39 | Schema::dropIfExists('people'); 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /src/migrations/2020_04_10_154637_create_citations_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name'); 18 | $table->text('description'); 19 | $table->dateTime('date')->nullable(); 20 | $table->integer('is_active'); 21 | $table->integer('volume'); 22 | $table->integer('page'); 23 | $table->integer('confidence'); 24 | $table->integer('source_id')->references('id')->on('sources'); 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::dropIfExists('citations'); 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /src/migrations/2020_04_10_154850_create_families_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->text('description')->nullable(); 18 | $table->integer('is_active')->nullable(); 19 | $table->integer('type_id')->nullable(); 20 | $table->integer('husband_id')->references('id')->on('persons')->nullable(); 21 | $table->integer('wife_id')->references('id')->on('persons')->nullable(); 22 | $table->timestamps(); 23 | $table->softDeletes(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('families'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /src/migrations/2020_04_10_155019_create_notes_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name')->nullable(); 18 | $table->text('description')->nullable(); 19 | $table->dateTime('date')->nullable(); 20 | $table->integer('type_id')->nullable(); 21 | $table->integer('is_active')->nullable(); 22 | $table->string('group')->nullable(); 23 | $table->string('gid')->nullable(); 24 | $table->longText('note')->nullable(); 25 | $table->string('rin')->nullable(); 26 | $table->timestamps(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::dropIfExists('notes'); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /src/migrations/2020_04_10_155134_create_places_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('title'); 18 | $table->text('description'); 19 | $table->string('date')->nullable(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('places'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/migrations/2020_04_10_155307_create_repositories_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('name')->nullable(); 20 | $table->text('description')->nullable(); 21 | $table->dateTime('date')->nullable(); 22 | $table->integer('is_active')->nullable(); 23 | $table->integer('type_id')->nullable(); 24 | $table->string('repo')->nullable(); 25 | $table->integer('addr_id')->nullable(); 26 | $table->string('rin')->nullable(); 27 | $table->string('phon')->nullable(); 28 | $table->string('email')->nullable(); 29 | $table->string('fax')->nullable(); 30 | $table->string('www')->nullable(); 31 | $table->timestamps(); 32 | }); 33 | } 34 | 35 | /** 36 | * Reverse the migrations. 37 | * 38 | * @return void 39 | */ 40 | public function down() 41 | { 42 | Schema::dropIfExists('repositories'); 43 | } 44 | }; 45 | -------------------------------------------------------------------------------- /src/migrations/2020_04_10_155413_create_sources_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name')->nullable(); 18 | $table->text('description')->nullable(); 19 | $table->string('date')->nullable(); 20 | $table->integer('is_active')->nullable(); 21 | $table->integer('author_id')->nullable(); 22 | $table->integer('repository_id')->references('id')->on('repositories')->nullable(); 23 | $table->integer('publication_id')->nullable(); 24 | $table->integer('type_id')->nullable(); 25 | $table->string('sour')->nullable(); 26 | $table->text('titl')->nullable(); 27 | $table->string('auth')->nullable(); 28 | $table->string('data')->nullable(); 29 | $table->text('text')->nullable(); 30 | $table->text('publ')->nullable(); 31 | $table->string('abbr')->nullable(); 32 | $table->string('group')->nullable(); 33 | $table->integer('gid')->nullable(); 34 | $table->string('quay')->nullable(); 35 | $table->text('page')->nullable(); 36 | $table->string('rin')->nullable(); 37 | $table->string('note')->nullable(); 38 | $table->timestamps(); 39 | }); 40 | } 41 | 42 | /** 43 | * Reverse the migrations. 44 | * 45 | * @return void 46 | */ 47 | public function down() 48 | { 49 | Schema::dropIfExists('sources'); 50 | } 51 | }; 52 | -------------------------------------------------------------------------------- /src/migrations/2020_04_10_171030_create_types_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | // $table->string('name'); 18 | // $table->string('description'); 19 | // $table->integer('is_active'); 20 | // $table->timestamps(); 21 | // }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | // Schema::dropIfExists('types'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/migrations/2020_04_24_211718_create_authors_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('name'); 18 | $table->string('description'); 19 | $table->integer('is_active'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('authors'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/migrations/2020_04_24_211852_create_publications_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('name'); 18 | $table->string('description'); 19 | $table->integer('is_active'); 20 | 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('publications'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /src/migrations/2020_06_01_112223_create_persons_events_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('converted_date')->nullable(); 18 | $table->timestamps(); 19 | $table->softDeletes(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('person_events'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /src/migrations/2020_06_01_112242_create_family_events_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('family_id')->references('id')->on('families'); 18 | $table->integer('places_id')->references('id')->on('places')->nullable(); 19 | $table->text('date')->nullable(); 20 | $table->string('title')->nullable(); 21 | $table->text('description')->nullable(); 22 | $table->string('converted_date')->nullable(); 23 | $table->timestamps(); 24 | $table->softDeletes(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::drop('family_events'); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /src/migrations/2020_06_03_192100_add_columns_for_people_table.php: -------------------------------------------------------------------------------- 1 | string('gid')->nullable(); 12 | $table->string('givn')->nullable(); 13 | $table->string('surn', 191)->nullable(); 14 | $table->string('name', 191)->nullable()->change(); 15 | 16 | $table->string('type')->nullable(); 17 | $table->string('npfx')->nullable(); 18 | $table->string('nick')->nullable(); 19 | $table->string('spfx')->nullable(); 20 | $table->string('nsfx')->nullable(); 21 | 22 | $table->char('sex', 1)->nullable(); 23 | $table->text('description')->nullable(); 24 | $table->integer('child_in_family_id')->references('id')->on('families')->nullable(); 25 | $table->softDeletes(); 26 | // $table->dropColumn('bank'); 27 | // $table->dropColumn('bank_account'); 28 | $table->dropUnique(['uid']); 29 | }); 30 | } 31 | 32 | public function down() 33 | { 34 | Schema::table('people', function ($table) { 35 | // $table->string('bank'); 36 | // $table->string('bank_account'); 37 | $table->dropColumn('gid'); 38 | $table->dropColumn('givn'); 39 | $table->dropColumn('surn'); 40 | $table->string('name')->nullable(false)->change(); 41 | $table->dropColumn('sex'); 42 | $table->dropColumn('description'); 43 | $table->dropColumn('child_in_family_id'); 44 | $table->dropColumn('deleted_at'); 45 | }); 46 | } 47 | }; 48 | -------------------------------------------------------------------------------- /src/migrations/2020_06_11_150000_update_add_columns_person_events_table.php: -------------------------------------------------------------------------------- 1 | unsignedBigInteger('person_id')->nullable(); 18 | $table->string('title')->nullable(); 19 | $table->string('date')->nullable(); 20 | $table->string('description')->nullable(); 21 | $table->unsignedBigInteger('places_id')->nullable()->after('description'); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | // 33 | Schema::table('person_events', function (Blueprint $table) { 34 | $table->dropColumn('person_id'); 35 | $table->dropColumn('title'); 36 | $table->dropColumn('description'); 37 | $table->dropColumn('places_id'); 38 | $table->dropColumn('deleted_at'); 39 | }); 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /src/migrations/2020_06_11_152802_update_description_default_places_table.php: -------------------------------------------------------------------------------- 1 | dropColumn('description'); 19 | }); 20 | } 21 | Schema::table('places', function (Blueprint $table) { 22 | $table->text('description')->nullable()->after('date'); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | // 34 | Schema::table('places', function (Blueprint $table) { 35 | $table->dropColumn('description'); 36 | }); 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /src/migrations/2020_06_11_173643_update_add_columns_people_table.php: -------------------------------------------------------------------------------- 1 | string('chan')->nullable(); 18 | $table->string('rin')->nullable(); 19 | $table->string('resn')->nullable(); 20 | $table->string('rfn')->nullable(); 21 | $table->string('afn')->nullable(); 22 | $table->string('deathday')->nullable()->after('birthday'); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | // 34 | Schema::table('people', function (Blueprint $table) { 35 | $table->dropColumn('chan'); 36 | $table->dropColumn('rin'); 37 | $table->dropColumn('resn'); 38 | $table->dropColumn('rfn'); 39 | $table->dropColumn('afn'); 40 | $table->dropColumn('deathday'); 41 | }); 42 | } 43 | }; 44 | -------------------------------------------------------------------------------- /src/migrations/2020_06_11_175726_update_add_columns_family_table.php: -------------------------------------------------------------------------------- 1 | string('chan')->nullable(); 18 | $table->string('nchi')->nullable(); 19 | $table->string('rin')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | // 31 | Schema::table('families', function (Blueprint $table) { 32 | $table->dropColumn('chan'); 33 | $table->dropColumn('nchi'); 34 | $table->dropColumn('rin'); 35 | }); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /src/migrations/2020_06_12_173700_create_subns_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('subm')->nullable(); 18 | $table->string('famf')->nullable(); 19 | $table->string('temp')->nullable(); 20 | $table->string('ance')->nullable(); 21 | $table->string('desc')->nullable(); 22 | $table->string('ordi')->nullable(); 23 | $table->string('rin')->nullable(); 24 | 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::dropIfExists('subns'); 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /src/migrations/2020_06_12_190711_create_subm_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('name')->nullable(); 20 | $table->integer('addr_id')->nullable(); 21 | $table->string('rin')->nullable(); 22 | $table->string('rfn')->nullable(); 23 | $table->string('lang')->nullable(); 24 | $table->string('phon')->nullable(); 25 | $table->string('email')->nullable(); 26 | $table->string('fax')->nullable(); 27 | $table->string('www')->nullable(); 28 | $table->timestamps(); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | * 35 | * @return void 36 | */ 37 | public function down() 38 | { 39 | Schema::dropIfExists('subms'); 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /src/migrations/2020_06_13_003901_create_media_objects_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->integer('gid')->nullable(); 18 | $table->string('group')->nullable(); 19 | $table->string('titl')->nullable(); 20 | $table->string('obje_id')->nullable(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('media_objects'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /src/migrations/2020_06_23_031852_create_importjobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->unsignedBigInteger('user_id')->nullable(); 18 | $table->string('slug')->nullable(); 19 | $table->string('status')->nullable(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('importjobs'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/migrations/2020_06_24_084354_create_sourcedata_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('date')->nullable(); 20 | $table->string('text')->nullable(); 21 | $table->string('agnc')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('source_data'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/migrations/2020_06_24_085159_create_source_data_even_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->string('gid')->nullable(); 19 | $table->string('date')->nullable(); 20 | $table->string('plac')->nullable(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('source_data_even'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /src/migrations/2020_06_24_090326_create_sourceref_even_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('even')->nullable(); 20 | $table->string('role')->nullable(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('sourceref_even'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /src/migrations/2020_06_24_092055_create_person_alia_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('alia')->nullable(); 20 | $table->integer('import_confirm')->default(0); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('person_alia'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /src/migrations/2020_06_24_093608_create_person_asso_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('indi')->nullable(); 20 | $table->string('rela')->nullable(); 21 | $table->integer('import_confirm')->default(0); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('person_asso'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/migrations/2020_06_24_094758_create_person_subm_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('subm')->nullable(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('person_subm'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/migrations/2020_06_24_095241_create_person_anci_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('anci')->nullable(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('person_anci'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/migrations/2020_06_24_103355_create_refn_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('refn')->nullable(); 20 | $table->string('type')->nullable(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('refn'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /src/migrations/2020_06_24_105140_create_person_lds_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('type')->nullable(); 20 | $table->string('stat')->nullable(); 21 | $table->string('date')->nullable(); 22 | $table->string('plac')->nullable(); 23 | $table->string('temp')->nullable(); 24 | $table->string('slac_famc')->nullable(); 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::dropIfExists('person_lds'); 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /src/migrations/2020_06_24_135407_create_chans_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('date')->nullable(); 20 | $table->string('time')->nullable(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('chans'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /src/migrations/2020_06_25_040418_create_family_slgs_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->integer('family_id')->nullable(); 18 | $table->string('stat')->nullable(); 19 | $table->string('date')->nullable(); 20 | $table->string('plac')->nullable(); 21 | $table->string('temp')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('family_slgs'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/migrations/2020_06_25_052028_create_addrs_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('adr1')->nullable(); 18 | $table->string('adr2')->nullable(); 19 | $table->string('city')->nullable(); 20 | $table->string('stae')->nullable(); 21 | $table->string('post')->nullable(); 22 | $table->string('ctry')->nullable(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('addrs'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /src/migrations/2020_08_21_100421_create_personname_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('name')->nullable(); 20 | $table->string('type')->nullable(); 21 | $table->string('npfx')->nullable(); 22 | $table->string('givn')->nullable(); 23 | $table->string('nick')->nullable(); 24 | $table->string('spfx')->nullable(); 25 | $table->string('surn')->nullable(); 26 | $table->string('nsfx')->nullable(); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::dropIfExists('personname'); 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /src/migrations/2020_08_21_110811_create_person_name_fone_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('name')->nullable(); 20 | $table->string('type')->nullable(); 21 | $table->string('npfx')->nullable(); 22 | $table->string('givn')->nullable(); 23 | $table->string('nick')->nullable(); 24 | $table->string('spfx')->nullable(); 25 | $table->string('surn')->nullable(); 26 | $table->string('nsfx')->nullable(); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::dropIfExists('person_name_fone'); 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /src/migrations/2020_08_21_111106_create_person_name_romn_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('name')->nullable(); 20 | $table->string('type')->nullable(); 21 | $table->string('npfx')->nullable(); 22 | $table->string('givn')->nullable(); 23 | $table->string('nick')->nullable(); 24 | $table->string('spfx')->nullable(); 25 | $table->string('surn')->nullable(); 26 | $table->string('nsfx')->nullable(); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::dropIfExists('person_name_romn'); 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /src/migrations/2020_08_21_124830_create_source_ref_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->integer('sour_id')->nullable(); 20 | $table->string('text')->nullable(); 21 | $table->string('quay')->nullable(); 22 | $table->string('page')->nullable(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('source_ref'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /src/migrations/2020_08_30_035717_create_media_objects_file_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('form')->nullable(); 18 | $table->string('medi')->nullable(); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('media_objects_file'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /src/migrations/2020_08_31_092310_create_source_repo_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group'); 18 | $table->integer('gid'); 19 | $table->string('repo_id'); 20 | $table->text('caln'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('source_repo'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /src/migrations/2020_09_12_000100_update_person_events_table.php: -------------------------------------------------------------------------------- 1 | text('attr')->nullable()->change(); 19 | }); 20 | } 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | // 31 | Schema::table('person_events', function (Blueprint $table) { 32 | $table->text('attr')->nullable(false)->change(); 33 | }); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/migrations/2020_09_12_151600_add_column_for_media_objects_table.php: -------------------------------------------------------------------------------- 1 | string('rin')->nullable(); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('media_objects', function ($table) { 28 | $table->dropColumn('rin'); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /src/migrations/2020_10_13_093608_create_person_desi_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('group')->nullable(); 18 | $table->integer('gid')->nullable(); 19 | $table->string('desi')->nullable(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('person_desi'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/migrations/2021_05_28_121021_add_index_key_people_table.php: -------------------------------------------------------------------------------- 1 | index(['id', 'uid']); 19 | } 20 | }); 21 | } 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | if (Schema::hasTable('people')) { 32 | Schema::table('people', function (Blueprint $table) { 33 | if (Schema::hasColumn('people', 'uid')) { 34 | $table->dropIndex(['id', 'uid']); 35 | } 36 | }); 37 | } 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /src/migrations/2021_05_28_121232_add_index_key_person_event_table.php: -------------------------------------------------------------------------------- 1 | index(['id', 'person_id', 'addr_id']); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('person_events', function (Blueprint $table) { 28 | $table->dropIndex(['id', 'person_id', 'addr_id']); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /src/migrations/2021_05_28_122429_add_index_key_person_name_table.php: -------------------------------------------------------------------------------- 1 | index(['id', 'gid']); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('person_name', function (Blueprint $table) { 28 | $table->dropIndex(['id', 'gid']); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /src/migrations/2021_08_25_031507_set_string_column_husband_id_and_wife_id_to_families_table.php: -------------------------------------------------------------------------------- 1 | string('husband_id')->nullable()->change(); 17 | $table->string('wife_id')->nullable()->change(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('families', function (Blueprint $table) { 29 | $table->integer('husband_id')->nullable()->change(); 30 | $table->integer('wife_id')->nullable()->change(); 31 | }); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/migrations/2021_08_25_121115_add_column_birth_year_and_death_year_to_people_table.php: -------------------------------------------------------------------------------- 1 | smallInteger('birth_year')->nullable()->after('birthday'); 17 | $table->smallInteger('death_year')->nullable()->after('deathday'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('people', function (Blueprint $table) { 29 | $table->dropColumn(['birth_year', 'death_year']); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /src/migrations/2021_08_25_155050_add_column_burialday_and_burial_year_to_people_table.php: -------------------------------------------------------------------------------- 1 | string('burial_day')->nullable()->after('death_year'); 17 | $table->smallInteger('burial_year')->nullable()->after('burial_day'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('people', function (Blueprint $table) { 29 | $table->dropColumn(['burial_day', 'burial_year']); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /src/migrations/2021_08_25_173355_drop_column_chan_to_people_table.php: -------------------------------------------------------------------------------- 1 | dropColumn('chan'); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('people', function (Blueprint $table) { 28 | $table->string('chan')->nullable()->after('deleted_at'); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /src/migrations/2021_08_25_173444_add_column_chan_to_people_table.php: -------------------------------------------------------------------------------- 1 | dateTime('chan')->nullable()->after('deleted_at'); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('people', function (Blueprint $table) { 28 | $table->dropColumn('chan'); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /src/migrations/2021_08_26_203720_remove_column_chan_to_people_table.php: -------------------------------------------------------------------------------- 1 | dropColumn('chan'); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('people', function (Blueprint $table) { 28 | $table->dateTime('chan')->nullable()->after('deleted_at'); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /src/migrations/2021_08_26_203800_add_microsecond_in_column_chan_to_people_table.php: -------------------------------------------------------------------------------- 1 | string('chan')->nullable()->after('deleted_at'); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('people', function (Blueprint $table) { 28 | $table->dropColumn('chan'); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /src/migrations/2021_08_26_222539_add_column_dati_plac_famc_fams_to_people_table.php: -------------------------------------------------------------------------------- 1 | string('birthday_dati')->nullable(); 17 | $table->string('birthday_plac')->nullable(); 18 | $table->string('deathday_dati')->nullable(); 19 | $table->string('deathday_plac')->nullable(); 20 | $table->string('deathday_caus')->nullable(); 21 | $table->string('burial_day_dati')->nullable(); 22 | $table->string('burial_day_plac')->nullable(); 23 | $table->string('famc')->nullable(); 24 | $table->string('fams')->nullable(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::table('people', function (Blueprint $table) { 36 | $table->dropColumn([ 37 | 'birthday_dati', 38 | 'birthday_plac', 39 | 'deathday_dati', 40 | 'deathday_plac', 41 | 'deathday_caus', 42 | 'burial_day_dati', 43 | 'burial_day_plac', 44 | 'famc', 45 | 'fams', 46 | ]); 47 | }); 48 | } 49 | }; 50 | -------------------------------------------------------------------------------- /src/migrations/2021_08_27_183956_add_column_month_to_people_table.php: -------------------------------------------------------------------------------- 1 | unsignedTinyInteger('birth_month')->nullable()->after('birthday'); 17 | $table->unsignedTinyInteger('death_month')->nullable()->after('deathday'); 18 | $table->unsignedTinyInteger('burial_month')->nullable()->after('burial_day'); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::table('people', function (Blueprint $table) { 30 | $table->dropColumn(['birth_month', 'death_month', 'burial_month']); 31 | }); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/migrations/2021_08_27_192146_add_column_titl_and_chr_to_people_table.php: -------------------------------------------------------------------------------- 1 | string('titl')->nullable(); 17 | $table->string('chr')->nullable(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('people', function (Blueprint $table) { 29 | $table->dropColumn(['titl', 'chr']); 30 | }); 31 | } 32 | }; 33 | --------------------------------------------------------------------------------