| 
									
										
										
										
											2022-03-06 02:02:12 +11:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use Illuminate\Database\Migrations\Migration; | 
					
						
							|  |  |  | use Illuminate\Database\Schema\Blueprint; | 
					
						
							|  |  |  | use Illuminate\Support\Facades\Schema; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class CreatePricingTable extends Migration | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Run the migrations. | 
					
						
							|  |  |  |      * @return void | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function up() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         Schema::create('pricings', function (Blueprint $table) { | 
					
						
							|  |  |  |             $table->id()->autoIncrement(); | 
					
						
							|  |  |  |             $table->char('service_id', 8)->unique(); | 
					
						
							|  |  |  |             $table->tinyInteger('service_type'); | 
					
						
							|  |  |  |             $table->tinyInteger('active')->default(1); | 
					
						
							|  |  |  |             $table->char('currency', 3); | 
					
						
							| 
									
										
										
										
											2024-12-09 23:15:03 +11:00
										 |  |  |             $table->decimal('price', 10, 2); | 
					
						
							| 
									
										
										
										
											2022-03-06 02:02:12 +11:00
										 |  |  |             $table->tinyInteger('term'); | 
					
						
							| 
									
										
										
										
											2024-12-09 23:15:03 +11:00
										 |  |  |             $table->decimal('as_usd', 10, 2); | 
					
						
							|  |  |  |             $table->decimal('usd_per_month', 10, 2); | 
					
						
							| 
									
										
										
										
											2022-03-06 02:02:12 +11:00
										 |  |  |             $table->date('next_due_date'); | 
					
						
							|  |  |  |             $table->timestamps(); | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Reverse the migrations. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return void | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function down() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2024-12-09 23:15:03 +11:00
										 |  |  |         Schema::dropIfExists('pricings'); | 
					
						
							| 
									
										
										
										
											2022-03-06 02:02:12 +11:00
										 |  |  |     } | 
					
						
							|  |  |  | } |